summaryrefslogtreecommitdiff
path: root/lib/VMCore/ConstantFold.cpp
diff options
context:
space:
mode:
authorNadav Rotem <nadav.rotem@intel.com>2012-04-24 20:18:49 +0000
committerNadav Rotem <nadav.rotem@intel.com>2012-04-24 20:18:49 +0000
commit80c1ea6f9baedf7e957e1c26f960792f016b5329 (patch)
tree99dbe84c696770f3ea0b813e4b3a23deb8517e07 /lib/VMCore/ConstantFold.cpp
parent2003e03045b6b89de455afda677198bb8b8b36b7 (diff)
downloadllvm-80c1ea6f9baedf7e957e1c26f960792f016b5329.tar.gz
llvm-80c1ea6f9baedf7e957e1c26f960792f016b5329.tar.bz2
llvm-80c1ea6f9baedf7e957e1c26f960792f016b5329.tar.xz
ConstantFoldSelectInstruction swapped the operands of the select.
Fix 12592. Patch by Matt Pharr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155480 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/ConstantFold.cpp')
-rw-r--r--lib/VMCore/ConstantFold.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp
index b743287adf..9b1c756b7d 100644
--- a/lib/VMCore/ConstantFold.cpp
+++ b/lib/VMCore/ConstantFold.cpp
@@ -700,7 +700,7 @@ Constant *llvm::ConstantFoldSelectInstruction(Constant *Cond,
ConstantInt *Cond = dyn_cast<ConstantInt>(CondV->getOperand(i));
if (Cond == 0) break;
- Constant *Res = (Cond->getZExtValue() ? V2 : V1)->getAggregateElement(i);
+ Constant *Res = (Cond->getZExtValue() ? V1 : V2)->getAggregateElement(i);
if (Res == 0) break;
Result.push_back(Res);
}