[llvm] r344718 - [TI removal] Switch NewGVN to directly use `Instruction`.

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 17 17:39:46 PDT 2018


Author: chandlerc
Date: Wed Oct 17 17:39:46 2018
New Revision: 344718

URL: http://llvm.org/viewvc/llvm-project?rev=344718&view=rev
Log:
[TI removal] Switch NewGVN to directly use `Instruction`.

Modified:
    llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp?rev=344718&r1=344717&r2=344718&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp Wed Oct 17 17:39:46 2018
@@ -777,7 +777,7 @@ private:
 
   // Reachability handling.
   void updateReachableEdge(BasicBlock *, BasicBlock *);
-  void processOutgoingEdges(TerminatorInst *, BasicBlock *);
+  void processOutgoingEdges(Instruction *, BasicBlock *);
   Value *findConditionEquivalence(Value *) const;
 
   // Elimination.
@@ -2483,7 +2483,7 @@ Value *NewGVN::findConditionEquivalence(
 }
 
 // Process the outgoing edges of a block for reachability.
-void NewGVN::processOutgoingEdges(TerminatorInst *TI, BasicBlock *B) {
+void NewGVN::processOutgoingEdges(Instruction *TI, BasicBlock *B) {
   // Evaluate reachability of terminator instruction.
   BranchInst *BR;
   if ((BR = dyn_cast<BranchInst>(TI)) && BR->isConditional()) {
@@ -3133,7 +3133,7 @@ void NewGVN::valueNumberInstruction(Inst
       auto *Symbolized = createUnknownExpression(I);
       performCongruenceFinding(I, Symbolized);
     }
-    processOutgoingEdges(dyn_cast<TerminatorInst>(I), I->getParent());
+    processOutgoingEdges(I, I->getParent());
   }
 }
 




More information about the llvm-commits mailing list