[PATCH] D103316: Hoist llvm.assume into single predecessor if block otherwise empty
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 14 13:14:14 PDT 2021
nikic added a comment.
@bjope This SimplifyCFG patch allows us to remove the assume dropping code in CGP subsequently.
================
Comment at: llvm/lib/Transforms/Utils/Local.cpp:1112
+ auto *OrCond =
+ IRB.CreateOr(Cond, newIfAvailable(Assume->getOperand(0)));
+ // Note that any Operand Bundle is dropped at this point.
----------------
This needs to be CreateLogicalOr.
================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:307
+ // Bail if side-effects.
+ if (I->mayHaveSideEffects() && !isa<AssumeInst>(I))
+ return false;
----------------
You need isSafeToSpeculativelyExecute() here, not just !mayHaveSideEffects().
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103316/new/
https://reviews.llvm.org/D103316
More information about the llvm-commits
mailing list