[llvm] f7f947e - [InstCombine] Remove some uninteresting FIXMEs (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 12 01:36:37 PST 2024


Author: Nikita Popov
Date: 2024-02-12T10:36:29+01:00
New Revision: f7f947e6208cb65ab1a29c4573bf927f967b9d5d

URL: https://github.com/llvm/llvm-project/commit/f7f947e6208cb65ab1a29c4573bf927f967b9d5d
DIFF: https://github.com/llvm/llvm-project/commit/f7f947e6208cb65ab1a29c4573bf927f967b9d5d.diff

LOG: [InstCombine] Remove some uninteresting FIXMEs (NFC)

If there are two undef operands, the select would get folded away
entirely. One undef operand can occur if the other two operands
do not satisfy the poison implication check. However, I don't think
that handling this edge case is worthwhile in this fold. If we
wanted to handle this, it would be more natural to do so in the
simplifyValueKnownNonZero() fold (as this is actually the property
we would be exploiting -- this doesn't really have any relation
to taking the log2).

Added: 
    

Modified: 
    llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
index f9cee9dfcfada..0bd4b6d1a835a 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
@@ -1299,9 +1299,6 @@ static Value *takeLog2(IRBuilderBase &Builder, Value *Op, unsigned Depth,
   }
 
   // log2(Cond ? X : Y) -> Cond ? log2(X) : log2(Y)
-  // FIXME: missed optimization: if one of the hands of select is/contains
-  //        undef, just directly pick the other one.
-  // FIXME: can both hands contain undef?
   // FIXME: Require one use?
   if (SelectInst *SI = dyn_cast<SelectInst>(Op))
     if (Value *LogX = takeLog2(Builder, SI->getOperand(1), Depth,


        


More information about the llvm-commits mailing list