[llvm] [DAG] visitFREEZE - enable SRA/SRL handling (PR #148252)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 24 09:55:45 PDT 2025


================
@@ -204,7 +204,8 @@ define signext i32 @findLastSet_i32(i32 signext %a) nounwind {
 ; RV64I-NEXT:    add a1, a1, a2
 ; RV64I-NEXT:    slli a2, a1, 16
 ; RV64I-NEXT:    add a1, a1, a2
-; RV64I-NEXT:    srliw a1, a1, 24
+; RV64I-NEXT:    slli a1, a1, 34
----------------
topperc wrote:

I spent some time with this yesterday. The issue is that we don't push the freeze up the pairs of slli+add. I was able to trick it a bit by emitting a freeze before the slli+add pairs are emitted in expandCTPOP.

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


More information about the llvm-commits mailing list