[llvm] r180779 - Fix a bug in foldSelectICmpAndOr.
David Majnemer
david.majnemer at gmail.com
Tue Apr 30 03:36:33 PDT 2013
Author: majnemer
Date: Tue Apr 30 05:36:33 2013
New Revision: 180779
URL: http://llvm.org/viewvc/llvm-project?rev=180779&view=rev
Log:
Fix a bug in foldSelectICmpAndOr.
Differences in bitwidth between X and Y could exist even if C1 and C2 have
the same Log2 representation.
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp?rev=180779&r1=180778&r2=180779&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp Tue Apr 30 05:36:33 2013
@@ -401,7 +401,8 @@ static Value *foldSelectICmpAndOr(const
} else if (C1Log > C2Log) {
V = Builder->CreateLShr(V, C1Log - C2Log);
V = Builder->CreateZExtOrTrunc(V, Y->getType());
- }
+ } else
+ V = Builder->CreateZExtOrTrunc(V, Y->getType());
ICmpInst::Predicate Pred = IC->getPredicate();
if ((Pred == ICmpInst::ICMP_NE && OrOnFalseVal) ||
More information about the llvm-commits
mailing list