OSDN Git Service

[LoopIdiomRecognize] Turn two uncheck dyn_casts into regular casts.
authorCraig Topper <craig.topper@intel.com>
Fri, 4 May 2018 01:04:24 +0000 (01:04 +0000)
committerCraig Topper <craig.topper@intel.com>
Fri, 4 May 2018 01:04:24 +0000 (01:04 +0000)
These are casts on users of a PHINode to Instruction. I think since PHINode is an Instruction any users would also be Instructions. At least a cast will give us an assertion if its wrong.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331498 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LoopIdiomRecognize.cpp

index 5975357..461c7a1 100644 (file)
@@ -1372,13 +1372,13 @@ bool LoopIdiomRecognize::recognizeAndInsertCTLZ() {
 
   bool IsCntPhiUsedOutsideLoop = false;
   for (User *U : CntPhi->users())
-    if (!CurLoop->contains(dyn_cast<Instruction>(U))) {
+    if (!CurLoop->contains(cast<Instruction>(U))) {
       IsCntPhiUsedOutsideLoop = true;
       break;
     }
   bool IsCntInstUsedOutsideLoop = false;
   for (User *U : CntInst->users())
-    if (!CurLoop->contains(dyn_cast<Instruction>(U))) {
+    if (!CurLoop->contains(cast<Instruction>(U))) {
       IsCntInstUsedOutsideLoop = true;
       break;
     }