llvm-project
77c4b9a3 - [AMDGPU]Refactor `lowerWaveReduce` for maintainability

Commit
8 days ago
[AMDGPU]Refactor `lowerWaveReduce` for maintainability The function to lower wave reduce pseudos is already quite large ,and there are yet a few more operations to support. Refactoring some of the code to make it more manageable. Summary of changes: 1. Moved the expansion for `V_CNDMASK_B64_PSEUDO` to a separate function. It's needed for 64 bit dpp operations. 2. Collapsed `getIdentityValueFor32BitWaveReduction` and `getIdentityValueFor64BitWaveReduction` into a single function which returns a 64 bit unsigned value. 3. Merged `isFloatingPointWaveReduceOperation` and `is32bitWaveReduceOperation` into a single function, `ClassifyWaveReductionOp`, to return both values. 4. Modified `getDPPOpcForWaveReduction` to also return the `Clamp` opcode. 5. Added two lambdas: `ExtractSubRegs` and `BuildRegSequence`, as those code blocks are repeated with little variation. 6. Moved logic for setting identity value in inactive lanes to `BuildSetInactiveInstr`.
Author
Committer
Parents
Loading