llvm-mirror/lib
Bob Wilson d79e684d1e 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).

llvm-svn: 62790
2009-01-22 22:05:48 +00:00
..
Analysis introduce a useful abstraction to find out if a Use is in the call position of an instruction 2009-01-22 21:35:57 +00:00
Archive Add the private linkage. 2009-01-15 20:18:42 +00:00
AsmParser Add the private linkage. 2009-01-15 20:18:42 +00:00
Bitcode use specialized accessor instead of plain getOperand(0) 2009-01-16 18:40:27 +00:00
CodeGen Fix a minor bug in DAGCombiner's folding of SELECT. Folding "select C, 0, 1" 2009-01-22 22:05:48 +00:00
Debugger Removed trailing whitespace from Makefiles. 2009-01-09 16:44:42 +00:00
ExecutionEngine Revert r62553 and r62616 due to issues with portability. 2009-01-22 20:09:20 +00:00
Linker Add the private linkage. 2009-01-15 20:18:42 +00:00
Support Do not use host floating point types when emitting 2009-01-21 20:32:55 +00:00
System rename methods in System/Host to be more consistent. 2009-01-22 19:53:00 +00:00
Target Add SelectionDAG::getNOT method to construct bitwise NOT operations, 2009-01-22 17:39:32 +00:00
Transforms introduce a useful abstraction to find out if a Use is in the call position of an instruction 2009-01-22 21:35:57 +00:00
VMCore Do not use host floating point types when emitting 2009-01-21 20:32:55 +00:00
Makefile Removed trailing whitespace from Makefiles. 2009-01-09 16:44:42 +00:00