[llvm] Allow shifting instead of masks if the types are legal. (PR #162732)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 9 19:26:10 PDT 2025


================
@@ -103,16 +103,16 @@ define i32 @bzhi32_c0(i32 %val, i32 %numlowbits) nounwind {
 ; SI:       ; %bb.0:
 ; SI-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
 ; SI-NEXT:    v_sub_i32_e32 v1, vcc, 32, v1
-; SI-NEXT:    v_lshr_b32_e32 v1, -1, v1
-; SI-NEXT:    v_and_b32_e32 v0, v1, v0
+; SI-NEXT:    v_lshlrev_b32_e32 v0, v1, v0
+; SI-NEXT:    v_lshrrev_b32_e32 v0, v1, v0
----------------
arsenm wrote:

This is a neutral change at best 

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


More information about the llvm-commits mailing list