aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Transforms/Scalar/CodeGenPrepare.cpp3
-rw-r--r--test/Transforms/CodeGenPrepare/basic.ll4
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp
index 3496aa20ab..72c8bf3047 100644
--- a/lib/Transforms/Scalar/CodeGenPrepare.cpp
+++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp
@@ -1071,9 +1071,6 @@ bool CodeGenPrepare::OptimizeInst(Instruction *I) {
if (CallInst *CI = dyn_cast<CallInst>(I))
return OptimizeCallInst(CI);
- if (isa<TerminatorInst>(I))
- return ConstantFoldTerminator(I->getParent());
-
return false;
}
diff --git a/test/Transforms/CodeGenPrepare/basic.ll b/test/Transforms/CodeGenPrepare/basic.ll
index a1cdf45553..3b1fca328c 100644
--- a/test/Transforms/CodeGenPrepare/basic.ll
+++ b/test/Transforms/CodeGenPrepare/basic.ll
@@ -13,7 +13,9 @@ entry:
%1 = icmp ugt i64 %0, 3
br i1 %1, label %T, label %trap
-; CHECK: br label %T
+; CHECK: entry:
+; HECK-NEXT: ret i32 4
+
trap: ; preds = %0, %entry
tail call void @llvm.trap() noreturn nounwind
unreachable