[clang] e23d6f3 - NeonEmitter: remove special case on casting polymorphic builtins.
Tim Northover via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 20 05:20:11 PST 2019
Author: Tim Northover
Date: 2019-11-20T13:20:02Z
New Revision: e23d6f3184d365a9e72a67dddd870d98e80f998d
URL: https://github.com/llvm/llvm-project/commit/e23d6f3184d365a9e72a67dddd870d98e80f998d
DIFF: https://github.com/llvm/llvm-project/commit/e23d6f3184d365a9e72a67dddd870d98e80f998d.diff
LOG: NeonEmitter: remove special case on casting polymorphic builtins.
For some reason we were not casting a fairly obscure class of builtin calls we
expected to be polymorphic to vectors of char. It worked because the only
affected intrinsics weren't actually polymorphic after all, but is
unnecessarily complicated.
Added:
Modified:
clang/lib/CodeGen/CGBuiltin.cpp
clang/utils/TableGen/NeonEmitter.cpp
Removed:
################################################################################
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index d9d0538b9138..ecac9aee5c7c 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -5456,6 +5456,11 @@ Value *CodeGenFunction::EmitCommonNeonBuiltinExpr(
llvm::Type *Tys[2] = { Ty, GetFloatNeonType(this, Type) };
return EmitNeonCall(CGM.getIntrinsic(LLVMIntrinsic, Tys), Ops, NameHint);
}
+ case NEON::BI__builtin_neon_vcvtx_f32_v: {
+ llvm::Type *Tys[2] = { VTy->getTruncatedElementVectorType(VTy), Ty};
+ return EmitNeonCall(CGM.getIntrinsic(LLVMIntrinsic, Tys), Ops, NameHint);
+
+ }
case NEON::BI__builtin_neon_vext_v:
case NEON::BI__builtin_neon_vextq_v: {
int CV = cast<ConstantInt>(Ops[2])->getSExtValue();
diff --git a/clang/utils/TableGen/NeonEmitter.cpp b/clang/utils/TableGen/NeonEmitter.cpp
index bb893bc49f63..cdf761b00c61 100644
--- a/clang/utils/TableGen/NeonEmitter.cpp
+++ b/clang/utils/TableGen/NeonEmitter.cpp
@@ -1078,9 +1078,7 @@ std::string Intrinsic::getBuiltinTypeStr() {
if (!RetT.isScalar() && RetT.isInteger() && !RetT.isSigned())
RetT.makeSigned();
- bool ForcedVectorFloatingType = isFloatingPointProtoModifier(Proto[0]);
- if (LocalCK == ClassB && !RetT.isVoid() && !RetT.isScalar() &&
- !ForcedVectorFloatingType)
+ if (LocalCK == ClassB && !RetT.isVoid() && !RetT.isScalar())
// Cast to vector of 8-bit elements.
RetT.makeInteger(8, true);
@@ -1092,8 +1090,7 @@ std::string Intrinsic::getBuiltinTypeStr() {
if (T.isPoly())
T.makeInteger(T.getElementSizeInBits(), false);
- bool ForcedFloatingType = isFloatingPointProtoModifier(Proto[I + 1]);
- if (LocalCK == ClassB && !T.isScalar() && !ForcedFloatingType)
+ if (LocalCK == ClassB && !T.isScalar())
T.makeInteger(8, true);
// Halves always get converted to 8-bit elements.
if (T.isHalf() && T.isVector() && !T.isScalarForMangling())
More information about the cfe-commits
mailing list