aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar/TailDuplication.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2010-11-23 20:26:33 +0000
committerDuncan Sands <baldrick@free.fr>2010-11-23 20:26:33 +0000
commitb6133d148312a3ec15beb67c2f49a21e5082b666 (patch)
tree5dac6c9d4d5f8cb4ceb036daed6cb54670d11657 /lib/Transforms/Scalar/TailDuplication.cpp
parent0f827639df520ac85eca6cc8f826e3fc36c4d171 (diff)
downloadexternal_llvm-b6133d148312a3ec15beb67c2f49a21e5082b666.tar.gz
external_llvm-b6133d148312a3ec15beb67c2f49a21e5082b666.tar.bz2
external_llvm-b6133d148312a3ec15beb67c2f49a21e5082b666.zip
Replace calls to ConstantFoldInstruction with calls to SimplifyInstruction
in two places that are really interested in simplified instructions, not constants. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120044 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/TailDuplication.cpp')
-rw-r--r--lib/Transforms/Scalar/TailDuplication.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Transforms/Scalar/TailDuplication.cpp b/lib/Transforms/Scalar/TailDuplication.cpp
index e954c15cb7..9dd83c04fa 100644
--- a/lib/Transforms/Scalar/TailDuplication.cpp
+++ b/lib/Transforms/Scalar/TailDuplication.cpp
@@ -26,14 +26,14 @@
#include "llvm/IntrinsicInst.h"
#include "llvm/Pass.h"
#include "llvm/Type.h"
+#include "llvm/ADT/Statistic.h"
+#include "llvm/ADT/SmallPtrSet.h"
+#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/Support/CFG.h"
-#include "llvm/Analysis/ConstantFolding.h"
-#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/SmallPtrSet.h"
+#include "llvm/Transforms/Utils/Local.h"
#include <map>
using namespace llvm;
@@ -362,8 +362,8 @@ void TailDup::eliminateUnconditionalBranch(BranchInst *Branch) {
Instruction *Inst = BI++;
if (isInstructionTriviallyDead(Inst))
Inst->eraseFromParent();
- else if (Constant *C = ConstantFoldInstruction(Inst)) {
- Inst->replaceAllUsesWith(C);
+ else if (Value *V = SimplifyInstruction(Inst)) {
+ Inst->replaceAllUsesWith(V);
Inst->eraseFromParent();
}
}