MaskRay wrote:

> > > > We need to calculate StackSafetyGlobalInfo before inserting 
> > > > `__asan_memcpy`
> > 
> > 
> > Yes, but this is currently not guaranteed. This patch will ensure this 
> > property and fix the issue.
> 
> Then the correct way to fix this issue to avoid lazy getInfo(). It should be 
> calculated at SSI = &MAM.getResult(M); Having analysis calculated before 
> modifications is quite important here.

We can set `-mllvm -stack-safety-run` to force `getInfo`, but it seems that the 
current lazy `getInfo` works as this patch does.

> > > And I would expect that neither 
> > > [8ed1d81](https://github.com/llvm/llvm-project/commit/8ed1d8196bef89c3099be4ce4aa65f613ab819cc)
> > >  or StackSafety should apply to -O0
> > 
> > 
> > @AnnaZaks for 
> > [8ed1d81](https://github.com/llvm/llvm-project/commit/8ed1d8196bef89c3099be4ce4aa65f613ab819cc)
> >  `[asan] Skip promotable allocas to improve performance at -O0`
> 
> Turning off isAllocaPromotable is LGTM, I would probably recommend just 
> switch opt<> default to false, and keep it just in case.
> 
> I don't see @AnnaZaks active here recently. @yln @rsundahl instead

Let me rename `ClSkipPromotableAllocas` (misleading option name even before 
this patch) to `ClSkipUninterestingAllocas`.
There are some cases that `ClSkipUninterestingAllocas=0` ignores AllocaInsts 
that `ClSkipUninterestingAllocas=1` doesn't.

FWIW I've built a stage-2 -O0 asan clang and a stage-2 -O3 asan clang. The size 
does not change with or without this patch.


https://github.com/llvm/llvm-project/pull/77221
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to