[InstCombine] add FIXME comment to shuffle transform; NFC
authorSanjay Patel <spatel@rotateright.com>
Tue, 4 Feb 2020 17:59:23 +0000 (12:59 -0500)
committerSanjay Patel <spatel@rotateright.com>
Tue, 4 Feb 2020 18:02:06 +0000 (13:02 -0500)
Existing tests:
rG5d04e008f708
rG2a191cf8500f
...should verify that the underlying analysis doesn't improve
too much without updating this user code.

llvm/lib/Transforms/InstCombine/InstructionCombining.cpp

index f6bc833..6f22190 100644 (file)
@@ -1701,6 +1701,9 @@ Instruction *InstCombiner::foldVectorBinop(BinaryOperator &Inst) {
         BO->getOpcode() != Opcode)
       return nullptr;
 
+    // FIXME: This may not be safe if the analysis allows undef elements. By
+    //        moving 'Y' before the splat shuffle, we are implicitly assuming
+    //        that it is not undef/poison at the splat index.
     Value *Y, *OtherOp;
     if (isSplatValue(BO->getOperand(0), SplatIndex->getZExtValue())) {
       Y = BO->getOperand(0);