[llvm] [LLVM] Make use of s_flbit_i32_b64 and s_ff1_i32_b64 (PR #75158)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 18 19:30:53 PST 2023
================
@@ -7834,6 +7843,61 @@ void SIInstrInfo::splitScalar64BitBFE(SIInstrWorklist &Worklist,
addUsersToMoveToVALUWorklist(ResultReg, MRI, Worklist);
}
+void SIInstrInfo::splitScalar64BitCountOp(SIInstrWorklist &Worklist,
+ MachineInstr &Inst, unsigned Opcode,
+ MachineDominatorTree *MDT) const {
+ // (S_FLBIT_I32_B64 hi:lo) ->
+ // -> (umin (V_FFBH_U32_e32 hi), (uaddsat (V_FFBH_U32_e32 lo), 32))
----------------
arsenm wrote:
This looks better than the generic expansion for ctlz/cttz, maybe something similar could also be implemented there?
Also, RegBankSelect should get similar treatment for GlobalISel
https://github.com/llvm/llvm-project/pull/75158
More information about the llvm-commits
mailing list