Skip to content

Commit 4e00763

Browse files
author
Krzysztof Parzyszek
authored
[LLVM] Do not use x86_vcvtph2ps_256 intrinsic with LLVM 11+ (#5267)
This intrinsic was removed in LLVM 11.
1 parent 2942278 commit 4e00763

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/target/llvm/codegen_x86_64.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ llvm::Value* CodeGenX86_64::VisitExpr_(const CastNode* op) {
8282
CHECK_EQ(from.lanes(), to.lanes());
8383
CHECK_NOTNULL(target_machine_);
8484

85-
const auto has_f16c = TargetHasFeature(*target_machine_, "f16c");
8685
const auto has_avx512 = TargetHasFeature(*target_machine_, "avx512f");
8786

8887
if (from.lanes() >= 16 && has_avx512) {
@@ -101,6 +100,10 @@ llvm::Value* CodeGenX86_64::VisitExpr_(const CastNode* op) {
101100
});
102101
}
103102

103+
#if TVM_LLVM_VERSION <= 100
104+
// The intrinsic x86_vcvtph2ps_256 was removed in LLVM 11.
105+
const auto has_f16c = TargetHasFeature(*target_machine_, "f16c");
106+
104107
if (from.lanes() >= 8 && has_f16c) {
105108
return CallVectorIntrin(
106109
::llvm::Intrinsic::x86_vcvtph2ps_256, 8,
@@ -109,6 +112,7 @@ llvm::Value* CodeGenX86_64::VisitExpr_(const CastNode* op) {
109112
DataType::Int(16, from.lanes()), tir::CallNode::reinterpret, {op->value},
110113
tir::CallNode::PureIntrinsic))});
111114
}
115+
#endif
112116
}
113117

114118
return CodeGenCPU::VisitExpr_(op);

0 commit comments

Comments
 (0)