[llvm] [NVPTX] Legalize aext-load to zext-load to expose more DAG combines (PR #154251)

Joseph Huber via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 22 13:48:36 PDT 2025


jhuber6 wrote:

Here https://godbolt.org/z/Eqqjoon7b, it's a ton of LLVM-IR but the difference I see in the assembly is only a small change the one on the left with three local stores works, the other one causes the error.

```
+ +--506 lines: // Generated by LLVM NVPTX Back-End··································································│+ +--506 lines: // Generated by LLVM NVPTX Back-End·································································
  // %bb.0:                               // %entry                                                                  │  // %bb.0:                               // %entry      
    mov.b64   %SPL, __local_depot9;                                                                                  │    mov.b64   %SPL, __local_depot9;      
    ld.param.b64  %rd158, [_ZN33LlvmLibcIntegerToStringTest_INT323RunEv_param_0];                                    │    ld.param.b64  %rd158, [_ZN33LlvmLibcIntegerToStringTest_INT323RunEv_param_0];      
    add.u64   %rd1, %SPL, 0;                                                                                         │    add.u64   %rd1, %SPL, 0;      
    add.u64   %rd159, %SPL, 24;                                                                                      │    add.u64   %rd159, %SPL, 24;      
    add.s64   %rd2, %rd159, 9;                                                                                       │    add.s64   %rd2, %rd159, 9;      
    st.local.b8   [%rd159+10], 49;                                                                                   │    st.local.b8   [%rd159+12], 0;      
  -------------------------------------------------------------------------------------------------------------------│    st.local.b8   [%rd159+11], 49;      
  -------------------------------------------------------------------------------------------------------------------│    st.local.b8   [%rd159+10], 0;      
    st.local.b8   [%rd159+9], 45;                                                                                    │    st.local.b8   [%rd159+9], 45;      
    st.local.b64  [%rd159+16], 2;                                                                                    │    st.local.b64  [%rd159+16], 2;      
    ld.b64  %rd3, [%rd158+16];                                                                                       │    ld.b64  %rd3, [%rd158+16];      
    mov.b64   %rd978, 0;                                                                                             │    mov.b64   %rd978, 0;      
    mov.b64   %rd161, _$_str;                                                                                        │    mov.b64   %rd161, _$_str;      
  $L__BB9_1:                              // %for.body.i.i.i.i                                                       │  $L__BB9_1:                              // %for.body.i.i.i.i      
+ +--17287 lines: =>This Inner Loop Header: Depth=1··································································│+ +--17287 lines: =>This Inner Loop Header: Depth=1·································································
```

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


More information about the llvm-commits mailing list