Detailed description: This change enables the bit field extract patterns
selection to s_bfe_u32 or v_bfe_u32 dependent on the pattern root node
divergence.
Details
- Reviewers
rampitec - Commits
- rG0a3d755ee9fc: [AMDGPU] Enable divergence-driven BFE selection
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
There are also patterns in SIInstructions.td that generate S_BFE without checking that the node is uniform.
llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp | ||
---|---|---|
43–44 | How about replacing this with a single getBFE32 function, which takes "bool isSigned" and "bool isDivergent" arguments instead of "unsigned Opcode"? |
sign_extend_inreg pattterns added
getS_BFE and getV_BFE replaced with the unified getBFE32 function
llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp | ||
---|---|---|
1968 | No else after return |
llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp | ||
---|---|---|
1968 | I am not sure if this is the right way. The "Val" is N->getOperand(0) here. Formally we should consider the N divergence. On the other hand, operand 0 is the only variable operand in BFE SDNode. Two others (offset and width) are always ConstantSDNode. |
llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp | ||
---|---|---|
1968 | Yes, that's what mean, the rest of arguments are constants, so we can save the argument. |
in getBFE32 IsDivergent argument removed. BFE node divergence evolved from its variable operand.
How about replacing this with a single getBFE32 function, which takes "bool isSigned" and "bool isDivergent" arguments instead of "unsigned Opcode"?