[llvm] [RISCV] Early exit if the type legalization cost is not valid for getIntrinsicInstrCost (PR #154256)
Ramkumar Ramachandra via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 19 03:15:34 PDT 2025
https://github.com/artagnon commented:
> The motivation of this change is that a crash was encountered when the code calls TLI->getTypeToPromoteTo(ISD::FSQRT, FsqrtType) with type f16/bf16, but f16/bf16 wasn't promotable if zvfhmin/zvfbfmin are not enabled. This leads to an assertion failure.
Isn't the right fix something like the following?
```cpp
if (!ST->hasVInstructionsF16Minimal())
return InstructionCost::getInvalid();
```
```cpp
if (!ST->hasVInstructionsBF16Minimal())
return InstructionCost::getInvalid();
```
https://github.com/llvm/llvm-project/pull/154256
More information about the llvm-commits
mailing list