[llvm-branch-commits] [llvm-branch] r95910 - in /llvm/branches/Apple/Hermes: lib/Transforms/Scalar/JumpThreading.cpp test/Transforms/JumpThreading/or-undef.ll
Bill Wendling
isanbard at gmail.com
Thu Feb 11 11:43:54 PST 2010
Author: void
Date: Thu Feb 11 13:43:53 2010
New Revision: 95910
URL: http://llvm.org/viewvc/llvm-project?rev=95910&view=rev
Log:
$ svn merge -c 95850 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r95850 into '.':
A test/Transforms/JumpThreading/or-undef.ll
U lib/Transforms/Scalar/JumpThreading.cpp
Added:
llvm/branches/Apple/Hermes/test/Transforms/JumpThreading/or-undef.ll
- copied unchanged from r95850, llvm/trunk/test/Transforms/JumpThreading/or-undef.ll
Modified:
llvm/branches/Apple/Hermes/lib/Transforms/Scalar/JumpThreading.cpp
Modified: llvm/branches/Apple/Hermes/lib/Transforms/Scalar/JumpThreading.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Hermes/lib/Transforms/Scalar/JumpThreading.cpp?rev=95910&r1=95909&r2=95910&view=diff
==============================================================================
--- llvm/branches/Apple/Hermes/lib/Transforms/Scalar/JumpThreading.cpp (original)
+++ llvm/branches/Apple/Hermes/lib/Transforms/Scalar/JumpThreading.cpp Thu Feb 11 13:43:53 2010
@@ -336,13 +336,18 @@
else
InterestingVal = ConstantInt::getFalse(I->getContext());
- // Scan for the sentinel.
+ // Scan for the sentinel. If we find an undef, force it to the
+ // interesting value: x|undef -> true and x&undef -> false.
for (unsigned i = 0, e = LHSVals.size(); i != e; ++i)
- if (LHSVals[i].first == InterestingVal || LHSVals[i].first == 0)
+ if (LHSVals[i].first == InterestingVal || LHSVals[i].first == 0) {
Result.push_back(LHSVals[i]);
+ Result.back().first = InterestingVal;
+ }
for (unsigned i = 0, e = RHSVals.size(); i != e; ++i)
- if (RHSVals[i].first == InterestingVal || RHSVals[i].first == 0)
+ if (RHSVals[i].first == InterestingVal || RHSVals[i].first == 0) {
Result.push_back(RHSVals[i]);
+ Result.back().first = InterestingVal;
+ }
return !Result.empty();
}
More information about the llvm-branch-commits
mailing list