Addresses the AMDGPU regression identified in D136042 where we were losing signed BFE patterns after sinking shifts behind logic ops.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
9459–9460 | Yeah, its to account for the fact that the inner shift amount types might not match N1 (or might be out of bounds) - its messy I agree but adding all the type/inrange matching was worse :( | |
9467 | This was copied from the (sra (shl x, c1), c1) -> sext_inreg fold immediately above - I'll see if I can improve it. |
LGTM either with or without improving the legality check for SIGN_EXTEND_INREG.
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
9459–9460 | Oh I see. I guess using getZExtValue in both places would have been less surprising. |
Seems like an odd mix of getAPIntValue vs getZExtValue.