Issue |
130646
|
Summary |
[AMDGPU] "Not a virtual register" assertion in libc math tests
|
Labels |
libc
|
Assignees |
|
Reporter |
jhuber6
|
The following IR has begun to hit this assertion at `-O2`. I reduced the test case to the following code .https://godbolt.org/z/TYsf3j1dv.
```llvm
target datalayout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128-p9:192:256:256: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-G1-ni:7:8:9"
target triple = "amdgcn-amd-amdhsa"
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p5(i64 immarg, ptr addrspace(5) captures(none)) #0
define double @_ZN22__llvm_libc_21_0_0_git6fputil4sqrtIddEENS_3cpp9enable_ifIXaaaasr3cppE19is_floating_point_vIT_Esr3cppE19is_floating_point_vIT0_ElestS4_stS5_ES4_E4typeES5_(i64 %0) {
entry:
br label %for.body
for.cond.cleanup: ; preds = %for.body
%cmp3.not.i.i.i = icmp eq i64 %r.0108, 0
br i1 %cmp3.not.i.i.i, label %cleanup, label %if.end26.i.i
if.end26.i.i: ; preds = %for.cond.cleanup
call void @llvm.lifetime.end.p5(i64 0, ptr addrspace(5) null)
br label %cleanup
for.body: ; preds = %for.body, %entry
%current_bit.01093 = phi i64 [ 2251799813685248, %entry ], [ %shr.3, %for.body ]
%r.0108 = phi i64 [ 0, %entry ], [ %shl28.3, %for.body ]
%1 = or i64 %current_bit.01093, %0
%shl28.3 = or i64 %1, %r.0108
%shr.3 = lshr i64 %current_bit.01093, 1
%tobool27.not.3 = icmp eq i64 %current_bit.01093, 0
br i1 %tobool27.not.3, label %for.cond.cleanup, label %for.body
cleanup: ; preds = %if.end26.i.i, %for.cond.cleanup
ret double 0.000000e+00
}
attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs