SamTebbs33 wrote:
New PR at https://github.com/llvm/llvm-project/pull/75487
https://github.com/llvm/llvm-project/pull/74064
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
SamTebbs33 wrote:
Thanks for reporting that Nico. I've reverted the patch and will work on
improving compile time. I like your idea Sander.
https://github.com/llvm/llvm-project/pull/74064
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
sdesmalen-arm wrote:
> On my system, this increases the compilation time of SemaChecking.cpp from 7
> seconds to 2 minutes 46 seconds (using clang as a host compiler). That seems
> excessive. Let's please find a way to not make compilation so slow, and let's
> consider reverting this until a
nico wrote:
On my system, this increases the compilation time of SemaChecking.cpp from 7
seconds to 2 minutes 46 seconds (using clang as a host compiler). That seems
excessive. Let's please find a way to not make compilation so slow, and let's
consider reverting this until a faster approach
https://github.com/SamTebbs33 closed
https://github.com/llvm/llvm-project/pull/74064
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/sdesmalen-arm approved this pull request.
https://github.com/llvm/llvm-project/pull/74064
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3168,9 +3167,60 @@ static void checkArmStreamingBuiltin(Sema , CallExpr
*TheCall,
<< TheCall->getSourceRange() << "streaming compatible";
return;
}
+
+ if (FnType == ArmNonStreaming && BuiltinType == ArmStreaming) {
+S.Diag(TheCall->getBeginLoc(),
@@ -1694,6 +1697,61 @@ void SVEEmitter::createSMERangeChecks(raw_ostream ) {
OS << "#endif\n\n";
}
+void SVEEmitter::createStreamingAttrs(raw_ostream , ACLEKind Kind) {
+ std::vector RV = Records.getAllDerivedDefinitions("Inst");
+ SmallVector, 128> Defs;
+ for (auto *R
@@ -3168,9 +3167,60 @@ static void checkArmStreamingBuiltin(Sema , CallExpr
*TheCall,
<< TheCall->getSourceRange() << "streaming compatible";
return;
}
+
+ if (FnType == ArmNonStreaming && BuiltinType == ArmStreaming) {
+S.Diag(TheCall->getBeginLoc(),
@@ -3168,9 +3167,60 @@ static void checkArmStreamingBuiltin(Sema , CallExpr
*TheCall,
<< TheCall->getSourceRange() << "streaming compatible";
return;
}
+
+ if (FnType == ArmNonStreaming && BuiltinType == ArmStreaming) {
+S.Diag(TheCall->getBeginLoc(),
@@ -1694,6 +1697,61 @@ void SVEEmitter::createSMERangeChecks(raw_ostream ) {
OS << "#endif\n\n";
}
+void SVEEmitter::createStreamingAttrs(raw_ostream , ACLEKind Kind) {
+ std::vector RV = Records.getAllDerivedDefinitions("Inst");
+ SmallVector, 128> Defs;
+ for (auto *R
@@ -500,6 +506,12 @@ bool ClangTableGenMain(raw_ostream , RecordKeeper
) {
case GenArmSmeRangeChecks:
EmitSmeRangeChecks(Records, OS);
break;
+ case GenArmSmeStreamingAttrs:
SamTebbs33 wrote:
Done
https://github.com/llvm/llvm-project/pull/74064
@@ -20,3 +21,23 @@ int16x8_t incompat_neon_smc(int16x8_t splat)
__arm_streaming_compatible {
// expected-warning@+1 {{builtin call has undefined behaviour when called
from a streaming compatible function}}
return (int16x8_t)__builtin_neon_vqaddq_v((int8x16_t)splat,
@@ -3168,11 +3168,70 @@ static void checkArmStreamingBuiltin(Sema , CallExpr
*TheCall,
<< TheCall->getSourceRange() << "streaming compatible";
return;
}
+
+ if (FnType == ArmNonStreaming && BuiltinType == ArmStreaming) {
+S.Diag(TheCall->getBeginLoc(),
@@ -500,6 +506,12 @@ bool ClangTableGenMain(raw_ostream , RecordKeeper
) {
case GenArmSmeRangeChecks:
EmitSmeRangeChecks(Records, OS);
break;
+ case GenArmSmeStreamingAttrs:
SamTebbs33 wrote:
I remember you suggesting that we have the SME and SVE
@@ -1375,6 +1381,12 @@ void SVEEmitter::createHeader(raw_ostream ) {
OS << "#define __aio static __inline__ __attribute__((__always_inline__, "
"__nodebug__, __overloadable__))\n\n";
+ OS << "#ifdef __ARM_FEATURE_SME\n";
+ OS << "#define __asc
@@ -3168,11 +3168,70 @@ static void checkArmStreamingBuiltin(Sema , CallExpr
*TheCall,
<< TheCall->getSourceRange() << "streaming compatible";
return;
}
+
+ if (FnType == ArmNonStreaming && BuiltinType == ArmStreaming) {
+S.Diag(TheCall->getBeginLoc(),
@@ -18,7 +18,7 @@
// CHECK-CXX-NEXT:tail call void @llvm.aarch64.sme.zero(i32 0)
// CHECK-CXX-NEXT:ret void
//
-void test_svzero_mask_za() {
+__arm_new_za void test_svzero_mask_za() {
SamTebbs33 wrote:
I did try `__arm_shared_za` but got
>
@@ -6,20 +6,21 @@
#include
__attribute__((target("sme")))
-void test_sme(svbool_t pg, void *ptr) {
+void test_sme(svbool_t pg, void *ptr) __arm_streaming __arm_shared_za {
svld1_hor_za8(0, 0, pg, ptr);
}
__attribute__((target("arch=armv8-a+sme")))
-void
@@ -20,3 +21,23 @@ int16x8_t incompat_neon_smc(int16x8_t splat)
__arm_streaming_compatible {
// expected-warning@+1 {{builtin call has undefined behaviour when called
from a streaming compatible function}}
return (int16x8_t)__builtin_neon_vqaddq_v((int8x16_t)splat,
@@ -3058,6 +3058,11 @@ bool Sema::ParseSVEImmChecks(
if (SemaBuiltinConstantArgRange(TheCall, ArgNum, 1, 7))
HasError = true;
break;
+case SVETypeFlags::ImmCheck2_4_Mul2:
SamTebbs33 wrote:
I think you were looking at an old commit as I
@@ -3168,11 +3168,70 @@ static void checkArmStreamingBuiltin(Sema , CallExpr
*TheCall,
<< TheCall->getSourceRange() << "streaming compatible";
return;
}
+
+ if (FnType == ArmNonStreaming && BuiltinType == ArmStreaming) {
+S.Diag(TheCall->getBeginLoc(),
@@ -18,7 +18,7 @@
// CHECK-CXX-NEXT:tail call void @llvm.aarch64.sme.zero(i32 0)
// CHECK-CXX-NEXT:ret void
//
-void test_svzero_mask_za() {
+__arm_new_za void test_svzero_mask_za() {
sdesmalen-arm wrote:
Why are these `__arm_new_za` rather than
@@ -6,20 +6,21 @@
#include
__attribute__((target("sme")))
-void test_sme(svbool_t pg, void *ptr) {
+void test_sme(svbool_t pg, void *ptr) __arm_streaming __arm_shared_za {
svld1_hor_za8(0, 0, pg, ptr);
}
__attribute__((target("arch=armv8-a+sme")))
-void
@@ -3058,6 +3058,11 @@ bool Sema::ParseSVEImmChecks(
if (SemaBuiltinConstantArgRange(TheCall, ArgNum, 1, 7))
HasError = true;
break;
+case SVETypeFlags::ImmCheck2_4_Mul2:
sdesmalen-arm wrote:
This shouldn't have moved.
@@ -500,6 +506,12 @@ bool ClangTableGenMain(raw_ostream , RecordKeeper
) {
case GenArmSmeRangeChecks:
EmitSmeRangeChecks(Records, OS);
break;
+ case GenArmSmeStreamingAttrs:
sdesmalen-arm wrote:
We also need to do this for SVE (you seem to have
@@ -20,3 +21,23 @@ int16x8_t incompat_neon_smc(int16x8_t splat)
__arm_streaming_compatible {
// expected-warning@+1 {{builtin call has undefined behaviour when called
from a streaming compatible function}}
return (int16x8_t)__builtin_neon_vqaddq_v((int8x16_t)splat,
@@ -1375,6 +1381,12 @@ void SVEEmitter::createHeader(raw_ostream ) {
OS << "#define __aio static __inline__ __attribute__((__always_inline__, "
"__nodebug__, __overloadable__))\n\n";
+ OS << "#ifdef __ARM_FEATURE_SME\n";
+ OS << "#define __asc
@@ -3168,11 +3168,70 @@ static void checkArmStreamingBuiltin(Sema , CallExpr
*TheCall,
<< TheCall->getSourceRange() << "streaming compatible";
return;
}
+
+ if (FnType == ArmNonStreaming && BuiltinType == ArmStreaming) {
+S.Diag(TheCall->getBeginLoc(),
@@ -3183,6 +3140,114 @@ bool Sema::CheckSVEBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
return HasError;
}
+static ArmStreamingType getArmStreamingFnType(const FunctionDecl *FD) {
+ if (FD->hasAttr())
+return ArmStreaming;
+ if (const auto *T =
@@ -3172,6 +3117,18 @@ bool Sema::CheckSVEBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
if (SemaBuiltinConstantArgRange(TheCall, ArgNum, 0, 255))
HasError = true;
break;
+case SVETypeFlags::ImmCheck1_1:
SamTebbs33 wrote:
@@ -3183,6 +3140,114 @@ bool Sema::CheckSVEBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
return HasError;
}
+static ArmStreamingType getArmStreamingFnType(const FunctionDecl *FD) {
+ if (FD->hasAttr())
+return ArmStreaming;
+ if (const auto *T =
@@ -3172,6 +3117,18 @@ bool Sema::CheckSVEBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
if (SemaBuiltinConstantArgRange(TheCall, ArgNum, 0, 255))
HasError = true;
break;
+case SVETypeFlags::ImmCheck1_1:
sdesmalen-arm
@@ -3183,6 +3140,114 @@ bool Sema::CheckSVEBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
return HasError;
}
+static ArmStreamingType getArmStreamingFnType(const FunctionDecl *FD) {
+ if (FD->hasAttr())
+return ArmStreaming;
+ if (const auto *T =
@@ -3023,6 +3151,66 @@ static void checkArmStreamingBuiltin(Sema , CallExpr
*TheCall,
<< TheCall->getSourceRange() << "streaming compatible";
return;
}
+
+ if (FnType == ArmNonStreaming && BuiltinType == ArmStreaming) {
+S.Diag(TheCall->getBeginLoc(),
@@ -289,7 +283,7 @@ ARM_STREAMING_ATTR void test_svst1_ver_vnum_za64(uint32_t
slice_base, svbool_t p
// CHECK-CXX-NEXT:tail call void @llvm.aarch64.sme.st1q.vert( [[TMP0]], ptr [[TMP2]], i32 15, i32 [[SLICE_BASE]])
// CHECK-CXX-NEXT:ret void
//
-ARM_STREAMING_ATTR
@@ -6,20 +6,20 @@
#include
__attribute__((target("sme")))
-void test_sme(svbool_t pg, void *ptr) {
+void test_sme(svbool_t pg, void *ptr) __arm_streaming {
svld1_hor_za8(0, 0, pg, ptr);
}
__attribute__((target("arch=armv8-a+sme")))
-void test_arch_sme(svbool_t pg,
@@ -2995,6 +2995,134 @@ static QualType getNeonEltType(NeonTypeFlags Flags,
ASTContext ,
enum ArmStreamingType { ArmNonStreaming, ArmStreaming, ArmStreamingCompatible
};
+bool Sema::ParseSVEImmChecks(
+CallExpr *TheCall, SmallVector, 3> ) {
+ // Perform all the
@@ -6,20 +6,20 @@
#include
__attribute__((target("sme")))
-void test_sme(svbool_t pg, void *ptr) {
+void test_sme(svbool_t pg, void *ptr) __arm_streaming {
svld1_hor_za8(0, 0, pg, ptr);
}
__attribute__((target("arch=armv8-a+sme")))
-void test_arch_sme(svbool_t pg,
@@ -289,7 +283,7 @@ ARM_STREAMING_ATTR void test_svst1_ver_vnum_za64(uint32_t
slice_base, svbool_t p
// CHECK-CXX-NEXT:tail call void @llvm.aarch64.sme.st1q.vert( [[TMP0]], ptr [[TMP2]], i32 15, i32 [[SLICE_BASE]])
// CHECK-CXX-NEXT:ret void
//
-ARM_STREAMING_ATTR
https://github.com/sdesmalen-arm edited
https://github.com/llvm/llvm-project/pull/74064
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -289,7 +283,7 @@ ARM_STREAMING_ATTR void test_svst1_ver_vnum_za64(uint32_t
slice_base, svbool_t p
// CHECK-CXX-NEXT:tail call void @llvm.aarch64.sme.st1q.vert( [[TMP0]], ptr [[TMP2]], i32 15, i32 [[SLICE_BASE]])
// CHECK-CXX-NEXT:ret void
//
-ARM_STREAMING_ATTR
@@ -3023,6 +3151,66 @@ static void checkArmStreamingBuiltin(Sema , CallExpr
*TheCall,
<< TheCall->getSourceRange() << "streaming compatible";
return;
}
+
+ if (FnType == ArmNonStreaming && BuiltinType == ArmStreaming) {
+S.Diag(TheCall->getBeginLoc(),
@@ -6,20 +6,20 @@
#include
__attribute__((target("sme")))
-void test_sme(svbool_t pg, void *ptr) {
+void test_sme(svbool_t pg, void *ptr) __arm_streaming {
svld1_hor_za8(0, 0, pg, ptr);
}
__attribute__((target("arch=armv8-a+sme")))
-void test_arch_sme(svbool_t pg,
@@ -2995,6 +2995,134 @@ static QualType getNeonEltType(NeonTypeFlags Flags,
ASTContext ,
enum ArmStreamingType { ArmNonStreaming, ArmStreaming, ArmStreamingCompatible
};
+bool Sema::ParseSVEImmChecks(
+CallExpr *TheCall, SmallVector, 3> ) {
+ // Perform all the
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff 9468de48fcd413aa0895a78bd6f1aeb161b39294
f6a990a000b555d7f8ef0b2a99e3fea98420e899 --
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Sam Tebbs (SamTebbs33)
Changes
This PR adds a warning that's emitted when a non-streaming or
non-streaming-compatible builtin is called in an unsuitable function.
Uses work by Kerry McLaughlin.
---
Full diff:
https://github.com/SamTebbs33 created
https://github.com/llvm/llvm-project/pull/74064
This PR adds a warning that's emitted when a non-streaming or
non-streaming-compatible builtin is called in an unsuitable function.
Uses work by Kerry McLaughlin.
>From
48 matches
Mail list logo