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

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 6 06:46:09 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
----------------
nikic wrote:

Does this also crash when replaced with something less silly, like `%a, 1`?

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


More information about the llvm-commits mailing list