Skip to content

Commit e23d6f3

Browse files
committed
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.
1 parent db73bcd commit e23d6f3

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5456,6 +5456,11 @@ Value *CodeGenFunction::EmitCommonNeonBuiltinExpr(
54565456
llvm::Type *Tys[2] = { Ty, GetFloatNeonType(this, Type) };
54575457
return EmitNeonCall(CGM.getIntrinsic(LLVMIntrinsic, Tys), Ops, NameHint);
54585458
}
5459+
case NEON::BI__builtin_neon_vcvtx_f32_v: {
5460+
llvm::Type *Tys[2] = { VTy->getTruncatedElementVectorType(VTy), Ty};
5461+
return EmitNeonCall(CGM.getIntrinsic(LLVMIntrinsic, Tys), Ops, NameHint);
5462+
5463+
}
54595464
case NEON::BI__builtin_neon_vext_v:
54605465
case NEON::BI__builtin_neon_vextq_v: {
54615466
int CV = cast<ConstantInt>(Ops[2])->getSExtValue();

clang/utils/TableGen/NeonEmitter.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,9 +1078,7 @@ std::string Intrinsic::getBuiltinTypeStr() {
10781078
if (!RetT.isScalar() && RetT.isInteger() && !RetT.isSigned())
10791079
RetT.makeSigned();
10801080

1081-
bool ForcedVectorFloatingType = isFloatingPointProtoModifier(Proto[0]);
1082-
if (LocalCK == ClassB && !RetT.isVoid() && !RetT.isScalar() &&
1083-
!ForcedVectorFloatingType)
1081+
if (LocalCK == ClassB && !RetT.isVoid() && !RetT.isScalar())
10841082
// Cast to vector of 8-bit elements.
10851083
RetT.makeInteger(8, true);
10861084

@@ -1092,8 +1090,7 @@ std::string Intrinsic::getBuiltinTypeStr() {
10921090
if (T.isPoly())
10931091
T.makeInteger(T.getElementSizeInBits(), false);
10941092

1095-
bool ForcedFloatingType = isFloatingPointProtoModifier(Proto[I + 1]);
1096-
if (LocalCK == ClassB && !T.isScalar() && !ForcedFloatingType)
1093+
if (LocalCK == ClassB && !T.isScalar())
10971094
T.makeInteger(8, true);
10981095
// Halves always get converted to 8-bit elements.
10991096
if (T.isHalf() && T.isVector() && !T.isScalarForMangling())

0 commit comments

Comments
 (0)