Issue 178954
Summary Attributor asserts when compiling rocm device libs
Labels crash-on-valid, llvm::Attributor
Assignees
Reporter arsenm
    https://godbolt.org/z/7ddYcExh5

```
; RUN: opt -passes=attributor %s
target datalayout = "e-m: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:128:48-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"

define double @__ocml_acosh_f64() {
entry:
  %0 = tail call double @llvm.fma.f64(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
  %cond.i = select i1 false, double 0.000000e+00, double %0
  %add.i46.i = fadd double %cond.i, 0.000000e+00
 %add.i.i33 = fadd double 0.000000e+00, %add.i46.i
  %add.i.i.i39 = fadd double %add.i.i33, 0.000000e+00
  %vecinit1.i.i.i.i43 = insertelement <2 x double> zeroinitializer, double %add.i.i.i39, i64 0
  %call7 = call double @__ocmlpriv_lnep_f64(<2 x double> %vecinit1.i.i.i.i43)
  ret double %call7
}

define double @__ocmlpriv_lnep_f64(<2 x double> %a) {
entry:
 ret double 0.000000e+00
}

declare double @llvm.fma.f64(double, double, double) #0

attributes #0 = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) }

```

```
Assertion failed: ((!BB || Parent == NodeTrait::getParent(const_cast<NodeT *>(BB))) && "cannot get DomTreeNode of block with different parent"), function getNode, file GenericDomTree.h, line 425.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0.	Program arguments: opt -S -p=attributor -o - reduced-attrib.ll
1.	Running pass "attributor" on module "reduced-attrib.ll"
 #0 0x00000001071c4f9c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/local/bin/opt+0x102774f9c)
 #1 0x00000001071c2f00 llvm::sys::RunSignalHandlers() (/usr/local/bin/opt+0x102772f00)
 #2 0x00000001071c5a44 SignalHandler(int, __siginfo*, void*) (/usr/local/bin/opt+0x102775a44)
 #3 0x000000018f84d6a4 (/usr/lib/system/libsystem_platform.dylib+0x1804ad6a4)
 #4 0x000000018f813848 (/usr/lib/system/libsystem_pthread.dylib+0x180473848)
 #5 0x000000018f71c9e4 (/usr/lib/system/libsystem_c.dylib+0x18037c9e4)
 #6 0x000000018f71bc18 (/usr/lib/system/libsystem_c.dylib+0x18037bc18)
 #7 0x0000000107da615c loadMBUFScalarOperandsFromVGPR(llvm::SIInstrInfo const&, llvm::MachineInstr&, llvm::ArrayRef<llvm::MachineOperand*>, llvm::MachineDominatorTree*, llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>, llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>) (.cold.20) (/usr/local/bin/opt+0x10335615c)
 #8 0x000000010695be6c llvm::DominatorTreeBase<llvm::BasicBlock, false>::getNodeIndex(llvm::BasicBlock const*) const (/usr/local/bin/opt+0x101f0be6c)
 #9 0x0000000106374ccc isGuaranteedNotToBeUndefOrPoison(llvm::Value const*, llvm::AssumptionCache*, llvm::Instruction const*, llvm::DominatorTree const*, unsigned int, UndefPoisonKind) (/usr/local/bin/opt+0x101924ccc)
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to