[llvm] [NaryReassociate] Fix crash from pointer width / index width confusion (PR #125923)

Krzysztof Drewniak via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 6 09:35:15 PST 2025


================
@@ -21,6 +21,17 @@ define void @no_sext_fat_pointer(ptr addrspace(2) %a, i32 %i, i32 %j) {
   ret void
 }
 
+define ptr addrspace(2) @zext_fat_pointer_crash() {
+; CHECK-LABEL: @zext_fat_pointer_crash(
+; CHECK-NEXT:    [[C:%.*]] = add i32 0, 0
+; CHECK-NEXT:    [[Q:%.*]] = getelementptr double, ptr addrspace(2) null, i32 [[C]]
+; CHECK-NEXT:    ret ptr addrspace(2) [[Q]]
+;
+  %c = add i32 0, 0
----------------
krzysz00 wrote:

Ok, cool, made the test less trivial

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


More information about the llvm-commits mailing list