[llvm] [AMDGPU] Make rotr illegal (PR #166558)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 5 06:49:06 PST 2025


================
@@ -353,16 +353,17 @@ define hidden void @shuffle5341ud2(ptr addrspace(1) %in0, ptr addrspace(1) %out0
 ; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
 ; GFX10-NEXT:    global_load_dword v0, v[0:1], off
 ; GFX10-NEXT:    s_waitcnt vmcnt(0)
-; GFX10-NEXT:    v_alignbit_b32 v0, v0, v0, 16
+; GFX10-NEXT:    v_perm_b32 v0, v0, v0, 0x5040706
----------------
jayfoad wrote:

> Do you have a plan for these?

My plan is to hope @jrbyrnes picks it up :) At the moment I don't understand why his #70240 removed this check of yours: https://github.com/llvm/llvm-project/blob/142efd6d612965897cf0b9d560348bf40c15ebaa/llvm/lib/Target/AMDGPU/SIISelLowering.cpp#L11081

> It feels like you're going to end up adding fshr peepholes to replace the rotr ones?

I don't think there are any peepholes. It is just that `PerformDAGCombine`'s `FSHR` case calls `matchPERM` but the `ROTR` case does not.

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


More information about the llvm-commits mailing list