From: Chandler Carruth Date: Fri, 13 Feb 2015 04:33:21 +0000 (+0000) Subject: [unroll] Remove pointless dyn_cast<>s to Instruction - the users of an X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=17cc3c80ee57132f362b0e22e26d4c2bcfb2b71e;p=oota-llvm.git [unroll] Remove pointless dyn_cast<>s to Instruction - the users of an instruction must by definition be instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229061 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/LoopUnrollPass.cpp b/lib/Transforms/Scalar/LoopUnrollPass.cpp index 8cf0450dd9e..0d9e2d15652 100644 --- a/lib/Transforms/Scalar/LoopUnrollPass.cpp +++ b/lib/Transforms/Scalar/LoopUnrollPass.cpp @@ -468,12 +468,8 @@ public: if (CountedInstructions.insert(LI).second) NumberOfOptimizedInstructions += TTI.getUserCost(LI); - for (User *U : LI->users()) { - Instruction *UI = dyn_cast(U); - if (!UI) - continue; - Worklist.insert(UI); - } + for (User *U : LI->users()) + Worklist.insert(cast(U)); } // And then we try to simplify every user of every instruction from the @@ -485,12 +481,8 @@ public: continue; if (!visit(I)) continue; - for (User *U : I->users()) { - Instruction *UI = dyn_cast(U); - if (!UI) - continue; - Worklist.insert(UI); - } + for (User *U : I->users()) + Worklist.insert(cast(U)); } return NumberOfOptimizedInstructions; }