(Not so) boringly identical to pattern a (D62786)
Not yet sure how do deal with the last pattern c.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Rebased, extra test exposed an alternative way to still end up
with unrecognized pattern with truncation, so handle it too.
This resulted in inlining isBitwiseNot(), not sure if it would be better to extend it with all that instead?
lib/CodeGen/SelectionDAG/SelectionDAG.cpp | ||
---|---|---|
8630 | Could you not create an AllOnes equivalent MaskedValueIsZero instead? MaskedValueIsAllOnes? |
lib/CodeGen/SelectionDAG/SelectionDAG.cpp | ||
---|---|---|
8630 | Err, s/not//? |
lib/CodeGen/SelectionDAG/SelectionDAG.cpp | ||
---|---|---|
8630 | I don't think we need a DemandedElts variant so this should work. /// MaskedValueIsAllOnes - Return true if 'V & Mask' is known to be all ones. bool MaskedValueIsAllOnes(SDValue Op, const APInt &Mask, unsigned Depth = 0) const; bool SelectionDAG::MaskedValueIsAllOnes(SDValue V, const APInt &Mask, unsigned Depth) const { return Mask.isSubsetOf(computeKnownBits(V, Depth).One); } |
LGTM with one minor
lib/CodeGen/SelectionDAG/SelectionDAG.cpp | ||
---|---|---|
2248 | Remove this line - its MaskedValueIsZero specific |
Remove this line - its MaskedValueIsZero specific