[llvm] [AMDGPU] Widen sub-dword constant loads with dword alignment to match SelectionDAG behavior (PR #184790)

Joe Nash via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 3 11:54:32 PDT 2026


================
@@ -25,9 +23,7 @@ define amdgpu_kernel void @constant_from_offset_cast_generic_null() {
 
 define amdgpu_kernel void @constant_from_offset_cast_global_null() {
 ; GFX9-LABEL: @constant_from_offset_cast_global_null(
-; GFX9-NEXT:    [[TMP1:%.*]] = load i32, ptr addrspace(4) getelementptr (i8, ptr addrspace(4) addrspacecast (ptr addrspace(1) null to ptr addrspace(4)), i64 4), align 4
-; GFX9-NEXT:    [[TMP2:%.*]] = lshr i32 [[TMP1]], 16
-; GFX9-NEXT:    [[TMP3:%.*]] = trunc i32 [[TMP2]] to i8
----------------
Sisyph wrote:

The patch title is confusing to me because in this case and others this match makes the load gets less wide and less aligned.

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


More information about the llvm-commits mailing list