Issue 97457
Summary [AMDGPU] Crash on addrspace cast to and from generic in codegenprepare
Labels new issue
Assignees
Reporter jhuber6
    This code crashes when trying to cast to and from addrspace(5) https://godbolt.org/z/Pa4Kc6Pxo.
```llvm
target triple = "amdgcn-amd-amdhsa"

define amdgpu_kernel void @__omp_offloading_16_1f2c5d17_main_l23(ptr addrspace(5) %0) {
__kmpc_target_init.exit:
  unreachable

ompx_gep.exit:
  %1 = addrspacecast ptr addrspace(5) %0 to ptr
  %2 = addrspacecast ptr %1 to ptr addrspace(5)
  unreachable
}
```
This hits the following assertion:
```
opt: /root/llvm-project/llvm/lib/Support/APInt.cpp:907: llvm::APInt llvm::APInt::trunc(unsigned int) const: Assertion `width <= BitWidth && "Invalid APInt Truncate request"' failed.
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to