[llvm] [CGP] Drop poison-generating flags after hoisting (PR #90382)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 28 04:59:31 PDT 2024


================
@@ -8268,8 +8268,10 @@ static bool optimizeBranch(BranchInst *Branch, const TargetLowering &TLI,
     if (CmpC.isPowerOf2() && Cmp->getPredicate() == ICmpInst::ICMP_ULT &&
         match(UI, m_Shr(m_Specific(X), m_SpecificInt(CmpC.logBase2())))) {
       IRBuilder<> Builder(Branch);
-      if (UI->getParent() != Branch->getParent())
+      if (UI->getParent() != Branch->getParent()) {
----------------
nikic wrote:

Shouldn't the poison flags always be dropped? I believe the relevant change here is that we introduce a new use of the instruction, not that we move it.

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


More information about the llvm-commits mailing list