[PATCH] Fix optimisations of SELECT_CC which assumed result is boolean
Tim Northover
t.p.northover at gmail.com
Thu Nov 13 13:51:51 PST 2014
Hi Oliver,
Oh, nasty. Unfortunately I can't think of a way around the isSetCCEquivalent change. All the uses really do seem to break down. I don't think the !(setcc a, b) change is quite right though:
================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:3833
@@ -3828,4 +3832,3 @@
// fold !(x cc y) -> (x !cc y)
- if (N1C && N1C->getAPIntValue().isAllOnesValue() &&
- isSetCCEquivalent(N0, LHS, RHS, CC)) {
+ if (N1C && N1C->getAPIntValue() == 1 && isSetCCEquivalent(N0, LHS, RHS, CC)) {
bool isInt = LHS.getValueType().isInteger();
----------------
I think this should use isConstTrueVal instead of hard-coding either 1 or AllOnes.
http://reviews.llvm.org/D6249
More information about the llvm-commits
mailing list