Check(verifyAttributeCount(Attrs, Call.arg_size()),
"Attribute after last parameter!", Call);
+ Function *Callee =
+ dyn_cast<Function>(Call.getCalledOperand()->stripPointerCasts());
+ bool IsIntrinsic = Callee && Callee->isIntrinsic();
+ if (IsIntrinsic)
+ Check(Callee->getValueType() == FTy,
+ "Intrinsic called with incompatible signature", Call);
+
auto VerifyTypeAlign = [&](Type *Ty, const Twine &Message) {
if (!Ty->isSized())
return;
"Incorrect alignment of " + Message + " to called function!", Call);
};
- VerifyTypeAlign(FTy->getReturnType(), "return type");
- for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i) {
- Type *Ty = FTy->getParamType(i);
- VerifyTypeAlign(Ty, "argument passed");
+ if (!IsIntrinsic) {
+ VerifyTypeAlign(FTy->getReturnType(), "return type");
+ for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i) {
+ Type *Ty = FTy->getParamType(i);
+ VerifyTypeAlign(Ty, "argument passed");
+ }
}
- Function *Callee =
- dyn_cast<Function>(Call.getCalledOperand()->stripPointerCasts());
- bool IsIntrinsic = Callee && Callee->isIntrinsic();
- if (IsIntrinsic)
- Check(Callee->getValueType() == FTy,
- "Intrinsic called with incompatible signature", Call);
-
if (Attrs.hasFnAttr(Attribute::Speculatable)) {
// Don't allow speculatable on call sites, unless the underlying function
// declaration is also speculatable.
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
+; Large vector for intrinsics is valid
+; CHECK-NOT: llvm.fshr
+define dso_local <8192 x i32> @test_intrin(<8192 x i32> %l, <8192 x i32> %r, <8192 x i32> %amt) {
+entry:
+ %b = call <8192 x i32> @llvm.fshr.v8192i32(<8192 x i32> %l, <8192 x i32> %r, <8192 x i32> %amt)
+ ret <8192 x i32> %b
+}
+declare <8192 x i32> @llvm.fshr.v8192i32 (<8192 x i32> %l, <8192 x i32> %r, <8192 x i32> %amt)
+
; CHECK: Incorrect alignment of argument passed to called function!
+; CHECK: bar
define dso_local void @foo(<8192 x float> noundef %vec) {
entry:
call void @bar(<8192 x float> %vec)
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
+; Large vector for intrinsics is valid
+; CHECK-NOT: llvm.fshr
+define dso_local <8192 x i32> @test_intrin(<8192 x i32> %l, <8192 x i32> %r, <8192 x i32> %amt) {
+entry:
+ %b = call <8192 x i32> @llvm.fshr.v8192i32(<8192 x i32> %l, <8192 x i32> %r, <8192 x i32> %amt)
+ ret <8192 x i32> %b
+}
+declare <8192 x i32> @llvm.fshr.v8192i32 (<8192 x i32> %l, <8192 x i32> %r, <8192 x i32> %amt)
+
; CHECK: Incorrect alignment of return type to called function!
+; CHECK: bar
define dso_local void @foo() {
entry:
call <8192 x float> @bar()