[llvm] [LLVM] Make use of s_flbit_i32_b64 and s_ff1_i32_b64 (PR #75158)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 13 02:04:34 PST 2023


================
@@ -7834,6 +7843,56 @@ void SIInstrInfo::splitScalar64BitBFE(SIInstrWorklist &Worklist,
   addUsersToMoveToVALUWorklist(ResultReg, MRI, Worklist);
 }
 
+void SIInstrInfo::splitScalar64BitCountOp(SIInstrWorklist &Worklist,
----------------
jayfoad wrote:

Can you add a comment showing what code this generates? I don't understand what the final min3 with 64 is for.

If the input it all zeros then S_FLBIT_I32_B64/S_FF1_I32_B64 would return -1, so this expansion should do the same.

Also are there any tests for this code? If not could you add some? See move-to-valu-* for examples.

https://github.com/llvm/llvm-project/pull/75158


More information about the llvm-commits mailing list