[SLP][NFC]Cleanup up operands of the removed insertelements, NFC.
authorAlexey Bataev <a.bataev@outlook.com>
Fri, 1 Jul 2022 00:10:04 +0000 (17:10 -0700)
committerAlexey Bataev <a.bataev@outlook.com>
Fri, 1 Jul 2022 00:51:43 +0000 (17:51 -0700)
Replace all operands of the insertelement instruction, replaced by
shuffles, by poisons to avoid false-positive reports about incorrect function.

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

index a958c36..019a096 100644 (file)
@@ -8827,6 +8827,8 @@ BoUpSLP::vectorizeTree(ExtraValueToDebugLocsMap &ExternallyUsedValues) {
     }
     LastInsert->replaceAllUsesWith(NewInst);
     for (InsertElementInst *IE : reverse(ShuffledInserts[I].InsertElements)) {
+      IE->replaceUsesOfWith(IE->getOperand(0),
+                            PoisonValue::get(IE->getOperand(0)->getType()));
       IE->replaceUsesOfWith(IE->getOperand(1),
                             PoisonValue::get(IE->getOperand(1)->getType()));
       eraseInstruction(IE);