aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/InstructionSimplify.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-11-09 23:06:58 +0000
committerChris Lattner <sabre@nondot.org>2009-11-09 23:06:58 +0000
commit8f73deaa8732a556046bf4ac6207be55972e3b74 (patch)
tree7f356907bd336592d93b84daccec136f758799e2 /lib/Analysis/InstructionSimplify.cpp
parent38424c9b5d464d262aa05adfc899285f86b43275 (diff)
fix ConstantFoldCompareInstOperands to take the LHS/RHS as
individual operands instead of taking a temporary array git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86619 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/InstructionSimplify.cpp')
-rw-r--r--lib/Analysis/InstructionSimplify.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Analysis/InstructionSimplify.cpp b/lib/Analysis/InstructionSimplify.cpp
index 692236a0f2..03bc9a01ce 100644
--- a/lib/Analysis/InstructionSimplify.cpp
+++ b/lib/Analysis/InstructionSimplify.cpp
@@ -39,10 +39,8 @@ Value *llvm::SimplifyCompare(unsigned Predicate, Value *LHS, Value *RHS,
CmpInst::Predicate Pred = (CmpInst::Predicate)Predicate;
if (Constant *CLHS = dyn_cast<Constant>(LHS))
- if (Constant *CRHS = dyn_cast<Constant>(RHS)) {
- Constant *COps[] = {CLHS, CRHS};
- return ConstantFoldCompareInstOperands(Pred, COps, 2, TD);
- }
+ if (Constant *CRHS = dyn_cast<Constant>(RHS))
+ return ConstantFoldCompareInstOperands(Pred, CLHS, CRHS, TD);
// If this is an integer compare and the LHS and RHS are the same, fold it.
if (LHS == RHS)