https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/77221
Commit 8ed1d8196bef89c3099be4ce4aa65f613ab819cc made an AllocaInst interesting only if `!ClSkipPromotableAllocas || !isAllocaPromotable(&AI)`, which greatly removed memory operand instrumention for -O0. However, this optimization is subsumed by StackSafetyAnalysis and therefore unnecessary when we enable StackSafetyAnalysis by default. Actually, having the `!ClSkipPromotableAllocas || !isAllocaPromotable(&AI)` condition before `!(SSGI && SSGI->isSafe(AI)))` has an interesting false positive involving MemIntrinsic (see `hoist-argument-init-insts.ll`): * `isInterestingAlloca` is transitively called by `getInterestingMemoryOperands` and `FunctionStackPoisoner`. * If `getInterestingMemoryOperands` never calls `StackSafetyGlobalInfo::getInfo`, and a MemIntrinsic is converted to `__asan_memcpy` by `instrumentMemIntrinsic`, when `StackSafetyGlobalInfo::getInfo` is called, StackSafetyAnalysis will consider `__asan_memcpy` as unsafe, leading to an unnecessary alloca instrumentation _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits