-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
Description
This test crashes with -mattr=+zvfbfmin
define <4 x bfloat> @foo() {
ret <4 x bfloat> <bfloat 1.0, bfloat 2.0, bfloat 3.0, bfloat 4.0>
}
SoftPromoteHalfOperand Op #0: t5: v4bf16 = BUILD_VECTOR ConstantFP:bf16<APFloat(16256)>, ConstantFP:bf16<APFloat(16384)>, ConstantFP:bf16<APFloat(16448)>, ConstantFP:bf16<APFloat(16512)>
LLVM ERROR: Do not know how to soft promote this operator's operand!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: ./bin/llc test.ll -mattr=+zvfbfmin -mtriple=riscv64
1. Running pass 'Function Pass Manager' on module 'test.ll'.
2. Running pass 'RISC-V DAG->DAG Pattern Instruction Selection' on function '@foo'
#0 0x0000558ca69f7dd8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (./bin/llc+0x34b5dd8)
#1 0x0000558ca69f592e llvm::sys::RunSignalHandlers() (./bin/llc+0x34b392e)
#2 0x0000558ca69f84ad SignalHandler(int) Signals.cpp:0:0
#3 0x00007ff113171cf0 __restore_rt (/lib64/libpthread.so.0+0x12cf0)
#4 0x00007ff111bf1acf raise (/lib64/libc.so.6+0x4eacf)
#5 0x00007ff111bc4ea5 abort (/lib64/libc.so.6+0x21ea5)
#6 0x0000558ca696da13 llvm::report_fatal_error(llvm::Twine const&, bool) (./bin/llc+0x342ba13)
#7 0x0000558ca696d846 (./bin/llc+0x342b846)
#8 0x0000558ca68ecf3e (./bin/llc+0x33aaf3e)
#9 0x0000558ca687cc81 llvm::DAGTypeLegalizer::run() (./bin/llc+0x333ac81)
#10 0x0000558ca6881e07 llvm::SelectionDAG::LegalizeTypes() (./bin/llc+0x333fe07)
#11 0x0000558ca67ff676 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (./bin/llc+0x32bd676)
#12 0x0000558ca67fe08a llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (./bin/llc+0x32bc08a)
#13 0x0000558ca67fb661 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (./bin/llc+0x32b9661)
#14 0x0000558ca67f9006 llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (./bin/llc+0x32b7006)
#15 0x0000558ca5bac9ef llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (./bin/llc+0x266a9ef)
#16 0x0000558ca60e6b89 llvm::FPPassManager::runOnFunction(llvm::Function&) (./bin/llc+0x2ba4b89)
#17 0x0000558ca60eebb2 llvm::FPPassManager::runOnModule(llvm::Module&) (./bin/llc+0x2bacbb2)
#18 0x0000558ca60e7416 llvm::legacy::PassManagerImpl::run(llvm::Module&) (./bin/llc+0x2ba5416)
#19 0x0000558ca3f97751 compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#20 0x0000558ca3f94ddd main (./bin/llc+0xa52ddd)
#21 0x00007ff111bddd85 __libc_start_main (/lib64/libc.so.6+0x3ad85)
#22 0x0000558ca3f90f7e _start (./bin/llc+0xa4ef7e)
Aborted
Probably need to patch this code from #97874 in lowerBUILD_VECTOR to handle bf16 too.
// If we don't have scalar f16, we need to bitcast to an i16 vector.
if (VT.getVectorElementType() == MVT::f16 &&
!Subtarget.hasStdExtZfhmin())
return lowerBUILD_VECTORvXf16(Op, DAG)