[PATCH] D101507: [SimplifyCFG] Ignore llvm.assume when looking for side effects

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 29 15:05:54 PDT 2021


tejohnson marked an inline comment as done.
tejohnson added a comment.

In D101507#2726052 <https://reviews.llvm.org/D101507#2726052>, @nikic wrote:

> I believe you're looking for `isGuaranteedToTransferExecutionToSuccessor()` here. We don't actually care whether there are side-effects, it only matters whether we are guaranteed to reach the UB.

Ah great, switched to using that. This necessitating adjusting one test that otherwise got optimized away with the change.



================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:6568
          i != UI; ++i)
-      if (i == I->getParent()->end() || i->mayHaveSideEffects())
+      if (i == I->getParent()->end() ||
+          // Explicitly check for and ignore llvm.assume intrinsics, which are
----------------
xbolva00 wrote:
> Split?
> 
> if (i == I->getParent()->end())
>       return false;
Good idea, done.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101507/new/

https://reviews.llvm.org/D101507



More information about the llvm-commits mailing list