aboutsummaryrefslogtreecommitdiffstats
path: root/win32
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2009-01-22 22:05:48 +0000
committerBob Wilson <bob.wilson@apple.com>2009-01-22 22:05:48 +0000
commitee1fe314072a6c1dcc71a9ed5202c5c4b5da849e (patch)
tree5a0e209e5839e816bee8219f8f2578f463210645 /win32
parent3d01556ac63fa62acf14d1290d6326f1d1db2ee0 (diff)
downloadexternal_llvm-ee1fe314072a6c1dcc71a9ed5202c5c4b5da849e.zip
external_llvm-ee1fe314072a6c1dcc71a9ed5202c5c4b5da849e.tar.gz
external_llvm-ee1fe314072a6c1dcc71a9ed5202c5c4b5da849e.tar.bz2
Fix a minor bug in DAGCombiner's folding of SELECT. Folding "select C, 0, 1"
to "C ^ 1" is only valid when C is known to be either 0 or 1. Most of the similar foldings in this function only handle "i1" types, but this one appears intentionally written to handle larger integer types. If C has an integer type larger than "i1", this needs to check if the high bits of a boolean are known to be zero. I also changed the comment to describe this folding as "C ^ 1" instead of "~C", since that is what the code does and since the latter would only be valid for "i1" types. The good news is that most LLVM targets use TargetLowering::ZeroOrOneBooleanContent so this change will not disable the optimization; the bad news is that I've been unable to come up with a testcase to demonstrate the problem. I have also removed a "FIXME" comment for folding "select C, X, 0" to "C & X", since the code looks correct to me. It could be made more aggressive by not limiting the type to "i1", but that would then require checking for TargetLowering::ZeroOrNegativeOneBooleanContent. Similar changes could be done for the other SELECT foldings, but it was decided to be not worth the trouble and complexity (see e.g., r44663). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62790 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'win32')
0 files changed, 0 insertions, 0 deletions