summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2010-11-23 20:24:21 +0000
committerDuncan Sands <baldrick@free.fr>2010-11-23 20:24:21 +0000
commitbb2cd025a9303bbb069b41c0d5589c80e4edaad2 (patch)
treeb1864974ca840f837a70b29ecea6f86ca1120e87 /llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
parent968df4fdffe073a30276a9a572476402fbcfa147 (diff)
downloadbcm5719-llvm-bb2cd025a9303bbb069b41c0d5589c80e4edaad2.tar.gz
bcm5719-llvm-bb2cd025a9303bbb069b41c0d5589c80e4edaad2.zip
Constant folding here is pointless, because InstructionSimplify
(which does constant folding and more) is called a few lines later. llvm-svn: 120042
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopUnswitch.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopUnswitch.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
index 2eaeb438e06..20d7019c218 100644
--- a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
@@ -32,7 +32,6 @@
#include "llvm/DerivedTypes.h"
#include "llvm/Function.h"
#include "llvm/Instructions.h"
-#include "llvm/Analysis/ConstantFolding.h"
#include "llvm/Analysis/InlineCost.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/Analysis/LoopInfo.h"
@@ -969,13 +968,7 @@ void LoopUnswitch::SimplifyCode(std::vector<Instruction*> &Worklist, Loop *L) {
while (!Worklist.empty()) {
Instruction *I = Worklist.back();
Worklist.pop_back();
-
- // Simple constant folding.
- if (Constant *C = ConstantFoldInstruction(I)) {
- ReplaceUsesOfWith(I, C, Worklist, L, LPM);
- continue;
- }
-
+
// Simple DCE.
if (isInstructionTriviallyDead(I)) {
DEBUG(dbgs() << "Remove dead instruction '" << *I);
OpenPOWER on IntegriCloud