OSDN Git Service

[SLPVectorizer] Use InstructionsState Op/Alt opcodes directly. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 1 Jul 2018 13:41:58 +0000 (13:41 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 1 Jul 2018 13:41:58 +0000 (13:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336063 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Vectorize/SLPVectorizer.cpp

index e075973..7ab6279 100644 (file)
@@ -2837,10 +2837,8 @@ void BoUpSLP::setInsertPointAfterBundle(ArrayRef<Value *> VL,
   // should be in this block.
   auto *Front = cast<Instruction>(S.OpValue);
   auto *BB = Front->getParent();
-  const unsigned Opcode = S.Opcode;
-  const unsigned AltOpcode = S.AltOpcode;
   assert(llvm::all_of(make_range(VL.begin(), VL.end()), [=](Value *V) -> bool {
-    return !sameOpcodeOrAlt(Opcode, AltOpcode,
+    return !sameOpcodeOrAlt(S.Opcode, S.AltOpcode,
                             cast<Instruction>(V)->getOpcode()) ||
            cast<Instruction>(V)->getParent() == BB;
   }));
@@ -2882,7 +2880,7 @@ void BoUpSLP::setInsertPointAfterBundle(ArrayRef<Value *> VL,
   if (!LastInst) {
     SmallPtrSet<Value *, 16> Bundle(VL.begin(), VL.end());
     for (auto &I : make_range(BasicBlock::iterator(Front), BB->end())) {
-      if (Bundle.erase(&I) && sameOpcodeOrAlt(Opcode, AltOpcode, I.getOpcode()))
+      if (Bundle.erase(&I) && sameOpcodeOrAlt(S.Opcode, S.AltOpcode, I.getOpcode()))
         LastInst = &I;
       if (Bundle.empty())
         break;