Skip to content

Commit b7c046f

Browse files
committed
update nxv32[b]f16 to nxv16f32
1 parent 1fe4655 commit b7c046f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "llvm/CodeGen/BasicTTIImpl.h"
1414
#include "llvm/CodeGen/CostTable.h"
1515
#include "llvm/CodeGen/TargetLowering.h"
16+
#include "llvm/CodeGen/ValueTypes.h"
1617
#include "llvm/IR/Instructions.h"
1718
#include "llvm/IR/PatternMatch.h"
1819
#include <cmath>
@@ -1067,6 +1068,8 @@ RISCVTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
10671068
Opcodes = {RISCV::VFWCVTBF16_F_F_V, RISCV::VFWCVTBF16_F_F_V,
10681069
RISCV::VFSQRT_V, RISCV::VFSQRT_V,
10691070
RISCV::VFNCVTBF16_F_F_W, RISCV::VFNCVTBF16_F_F_W};
1071+
NVT = TLI->getTypeToPromoteTo(ISD::FSQRT,
1072+
NVT.getHalfNumVectorElementsVT());
10701073
} else {
10711074
Opcodes = {RISCV::VFWCVTBF16_F_F_V, RISCV::VFSQRT_V,
10721075
RISCV::VFNCVTBF16_F_F_W};
@@ -1078,6 +1081,8 @@ RISCVTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
10781081
Opcodes = {RISCV::VFWCVT_F_F_V, RISCV::VFWCVT_F_F_V,
10791082
RISCV::VFSQRT_V, RISCV::VFSQRT_V,
10801083
RISCV::VFNCVT_F_F_W, RISCV::VFNCVT_F_F_W};
1084+
NVT = TLI->getTypeToPromoteTo(ISD::FSQRT,
1085+
NVT.getHalfNumVectorElementsVT());
10811086
} else {
10821087
Opcodes = {RISCV::VFWCVT_F_F_V, RISCV::VFSQRT_V, RISCV::VFNCVT_F_F_W};
10831088
NVT = TLI->getTypeToPromoteTo(ISD::FSQRT, NVT);

0 commit comments

Comments
 (0)