<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - LAA crashes with -globals-aa -loop-load-elim"
   href="https://bugs.llvm.org/show_bug.cgi?id=46854">46854</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LAA crashes with -globals-aa -loop-load-elim
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Loop Optimizer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>florian_hahn@apple.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The IR below is reduced from the reproducer shared on llvm-dev
<a href="http://lists.llvm.org/pipermail/llvm-dev/2020-July/143761.html">http://lists.llvm.org/pipermail/llvm-dev/2020-July/143761.html</a>

It crashes with `opt -globals-aa -loop-load-elim`

target datalayout =
"e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-ni:7"
target triple = "amdgcn-amd-amdhsa"

%struct.foo = type { %struct.pluto, i8, i8*, i32 }
%struct.pluto = type { i32, i32, i32, %struct.wombat*, i32, i32, i32 }
%struct.wombat = type { %struct.barney }
%struct.barney = type { <2 x float> }

@global = external protected local_unnamed_addr addrspace(4)
externally_initialized global %struct.foo, align 8
@global.1 = internal unnamed_addr addrspace(3) constant [4000 x float] undef,
align 16

; Function Attrs: nounwind
define protected amdgpu_kernel void @widget(i32 %arg, i32 %arg1) #0 {
bb:
  %tmp = getelementptr inbounds [4000 x float], [4000 x float] addrspace(3)*
@global.1, i32 0, i32 %arg
  %tmp2 = load %struct.wombat*, %struct.wombat* addrspace(4)* getelementptr
inbounds (%struct.foo, %struct.foo addrspace(4)* @global, i64 0, i32 0, i32 3),
align 8
  %tmp3 = getelementptr inbounds %struct.wombat, %struct.wombat* %tmp2, i64
undef, i32 0
  %tmp4 = bitcast %struct.barney* %tmp3 to i64*
  br label %bb5

bb5:                                              ; preds = %bb6, %bb
  br label %bb6

bb6:                                              ; preds = %bb6, %bb5
  %tmp7 = phi i32 [ undef, %bb5 ], [ %tmp19, %bb6 ]
  %tmp8 = mul nsw i32 %tmp7, undef
  %tmp9 = add i32 %tmp8, undef
  %tmp10 = sext i32 %tmp9 to i64
  %tmp11 = getelementptr inbounds %struct.wombat, %struct.wombat* %tmp2, i64
%tmp10
  %tmp12 = bitcast %struct.wombat* %tmp11 to i64*
  %tmp13 = load i64, i64* %tmp12, align 8
  %tmp14 = srem i32 1, %arg1
  %tmp15 = add nuw nsw i32 %tmp14, 1
  %tmp16 = getelementptr inbounds [4000 x float], [4000 x float] addrspace(3)*
@global.1, i32 0, i32 %tmp15
  %tmp17 = load float, float addrspace(3)* %tmp16, align 4
  %tmp18 = load float, float addrspace(3)* %tmp, align 4
  store i64 %tmp13, i64* %tmp4, align 8
  %tmp19 = add nsw i32 %tmp7, 1
  %tmp20 = icmp slt i32 %tmp7, 3
  br i1 %tmp20, label %bb6, label %bb5
}

attributes #0 = { nounwind }</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>