Ultimately I want to use this to remove the intrinsics for these instructions.
Details
Diff Detail
- Repository
- rL LLVM
- Build Status
Buildable 17084 Build 17084: arc lint + arc unit
Event Timeline
This doesn't seem x86 specific - any reason not to include it in dagcombine?
test/CodeGen/X86/pmulh.ll | ||
---|---|---|
7 | Commit this with current codegen to show diff. |
I thought about that. But it needs to be done pre-type legalization so that the extends haven’t been legalized yet. And it needs to be done on wider than legal vectors so the MULHU/MULHS get split during type legalization.
I think this means a generic DAG combine couldnt check isOperationLegal. Which sounds fine at first, but if the VT ends up needing to be promoted we’ll crash because type promotion doesn’t know how to promote MULHS/MULHU. So I wasn’t sure how to cleanly protect that from DAG combine.
LGTM, but please do check in the tests with baseline output first (just in case the code change is reverted, we don't want to lose the tests).
lib/Target/X86/X86ISelLowering.cpp | ||
---|---|---|
35997–35998 | A top-level 'TODO' comment copying the reasoning for this being x86-specific would be good...in case someone fixes the common DAG problems and puts this in DAGCombiner, we'll know this can go. | |
36001 | typo - 'instruction' |
A top-level 'TODO' comment copying the reasoning for this being x86-specific would be good...in case someone fixes the common DAG problems and puts this in DAGCombiner, we'll know this can go.