[llvm] [DAGCombine] `visitANY_EXTEND` - fold `(aext (freeze (load x)))` -> `(aext (truncate (freeze (extload x))))` (PR #218454)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 25 03:00:03 PDT 2026


================
@@ -37,8 +37,8 @@ define i8 @test_i8(i8 %a) nounwind {
 define i16 @test_i16(i16 %a) nounwind {
 ; X86-NO-CMOV-LABEL: test_i16:
 ; X86-NO-CMOV:       # %bb.0:
-; X86-NO-CMOV-NEXT:    movswl {{[0-9]+}}(%esp), %eax
-; X86-NO-CMOV-NEXT:    movl %eax, %ecx
+; X86-NO-CMOV-NEXT:    movl {{[0-9]+}}(%esp), %eax
+; X86-NO-CMOV-NEXT:    movswl %ax, %ecx
----------------
RKSimon wrote:

regression? the rr mov would have been free - I expect there's another ext(freeze(load)) that is failing to peek through the freeze - any chance you can identify it - it doesn't necessarily have to be fixed in this patch, but if it shold be fixed first then there's a yak to shave :/ 

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


More information about the llvm-commits mailing list