[llvm] [LowerAllowCheck] preserve CFG analyses (PR #145816)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 25 16:55:28 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: Florian Mayer (fmayer)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/145816.diff


1 Files Affected:

- (modified) llvm/lib/Transforms/Instrumentation/LowerAllowCheckPass.cpp (+3-1) 


``````````diff
diff --git a/llvm/lib/Transforms/Instrumentation/LowerAllowCheckPass.cpp b/llvm/lib/Transforms/Instrumentation/LowerAllowCheckPass.cpp
index 10e908ef73ce5..1733d9f8dd77e 100644
--- a/llvm/lib/Transforms/Instrumentation/LowerAllowCheckPass.cpp
+++ b/llvm/lib/Transforms/Instrumentation/LowerAllowCheckPass.cpp
@@ -159,7 +159,9 @@ PreservedAnalyses LowerAllowCheckPass::run(Function &F,
       AM.getResult<OptimizationRemarkEmitterAnalysis>(F);
 
   return removeUbsanTraps(F, BFI, PSI, ORE, Opts.cutoffs)
-             ? PreservedAnalyses::none()
+             // We do not change the CFG, we only replace the intrinsics with
+             // true or false.
+             ? PreservedAnalyses::none().preserveSet<CFGAnalyses>()
              : PreservedAnalyses::all();
 }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/145816


More information about the llvm-commits mailing list