[llvm-commits] [llvm] r120042 - /llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp
Duncan Sands
baldrick at free.fr
Tue Nov 23 12:24:22 PST 2010
Author: baldrick
Date: Tue Nov 23 14:24:21 2010
New Revision: 120042
URL: http://llvm.org/viewvc/llvm-project?rev=120042&view=rev
Log:
Constant folding here is pointless, because InstructionSimplify
(which does constant folding and more) is called a few lines
later.
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp?rev=120042&r1=120041&r2=120042&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp Tue Nov 23 14:24:21 2010
@@ -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 @@
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);
More information about the llvm-commits
mailing list