Expansion of SIGN_EXTEND_INREG can create a VSRAI instruction. If there is already a VSRAI after it, we should combine them into a larger VSRAI
Details
Diff Detail
Event Timeline
lib/Target/X86/X86ISelLowering.cpp | ||
---|---|---|
35471 | I don't think we should limit this with hasOneUse (we don't have that restriction in the equivalent generic DAG or IR folds). Add a test for that scenario? | |
test/Analysis/CostModel/X86/testshiftashr.ll | ||
264 | Is it weird that we're (only partially) checking codegen in a cost model test file? |
lib/Target/X86/X86ISelLowering.cpp | ||
---|---|---|
35471 | Without it we generated extra moves on some other test cases in vector-shift-ashr-sub128.ll at least on pre-AVX targets. | |
test/Analysis/CostModel/X86/testshiftashr.ll | ||
264 | Yeah its pretty weird. We didn't even have complete codegen test coverage of the narrow vectors until I added the sub128 tests yesterday. |
LGTM. Might want to leave a 'FIXME' note on that cost model test file. Or move anything of value in there that isn't already tested in the codegen test file.
lib/Target/X86/X86ISelLowering.cpp | ||
---|---|---|
35471 | Thanks - those diffs are what I imagined. It's better to trade a move for a shift (at least on paper) and reduce the dependency chain, and that's consistent with other folds. |
I don't think we should limit this with hasOneUse (we don't have that restriction in the equivalent generic DAG or IR folds). Add a test for that scenario?