[clang] [llvm] [AVR] Fix Avr indvar detection and strength reduction (missed optimization) (PR #152028)

Ben Shi via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 6 02:08:16 PDT 2025


================
@@ -121,8 +146,11 @@ while.end:                                        ; preds = %while.body, %entry
 
 define i16 @load16predec(ptr %x, i16 %y) {
 ; CHECK-LABEL: load16predec:
-; CHECK: ld {{.*}}, -{{[XYZ]}}
-; CHECK: ld {{.*}}, -{{[XYZ]}}
+; TODO: ld {{.*}}, -{{[XYZ]}}
+; TODO: ld {{.*}}, -{{[XYZ]}}
+; CHECK: sbiw {{.*}}, 2
----------------
benshi001 wrote:

Or just as [Patryk27](https://github.com/Patryk27) indicated, just using the exact register for `sbiw` and `ld`, instead of regexp pattern. My key concern is it should show the relationship between sbiw and ld/st.

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


More information about the llvm-commits mailing list