File tree Expand file tree Collapse file tree 6 files changed +22
-2
lines changed
include/llvm/TargetParser
Transforms/LoopVectorize/AArch64 Expand file tree Collapse file tree 6 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -194,7 +194,8 @@ class Triple {
194
194
SUSE,
195
195
OpenEmbedded,
196
196
Intel,
197
- LastVendorType = Intel
197
+ Amazon,
198
+ LastVendorType = Amazon
198
199
};
199
200
enum OSType {
200
201
UnknownOS,
@@ -900,6 +901,11 @@ class Triple {
900
901
return getArch () == Triple::arm || getArch () == Triple::armeb;
901
902
}
902
903
904
+ // / Tests whether the target is Amazon Linux.
905
+ bool isAmazonLinux () const {
906
+ return getOS () == Triple::Linux && getVendor () == Triple::Amazon;
907
+ }
908
+
903
909
// / Tests whether the target supports the EHABI exception
904
910
// / handling standard.
905
911
bool isTargetEHABICompatible () const {
Original file line number Diff line number Diff line change @@ -173,7 +173,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
173
173
setLibcallName (RTLIB::EXP10_F64, " __exp10" );
174
174
}
175
175
176
- if (TT.isGNUEnvironment () || TT.isOSFuchsia () ||
176
+ if (TT.isGNUEnvironment () || TT.isOSFuchsia () || TT. isAmazonLinux () ||
177
177
(TT.isAndroid () && !TT.isAndroidVersionLT (9 ))) {
178
178
setLibcallName (RTLIB::SINCOS_F32, " sincosf" );
179
179
setLibcallName (RTLIB::SINCOS_F64, " sincos" );
Original file line number Diff line number Diff line change @@ -270,6 +270,8 @@ StringRef Triple::getVendorTypeName(VendorType Kind) {
270
270
case PC: return " pc" ;
271
271
case SCEI: return " scei" ;
272
272
case SUSE: return " suse" ;
273
+ case Amazon:
274
+ return " amazon" ;
273
275
}
274
276
275
277
llvm_unreachable (" Invalid VendorType!" );
@@ -664,6 +666,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) {
664
666
.Case (" suse" , Triple::SUSE)
665
667
.Case (" oe" , Triple::OpenEmbedded)
666
668
.Case (" intel" , Triple::Intel)
669
+ .Case (" amazon" , Triple::Amazon)
667
670
.Default (Triple::UnknownVendor);
668
671
}
669
672
Original file line number Diff line number Diff line change 1
1
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --filter "(bl|ptrue)" --version 5
2
2
; RUN: llc -mtriple=aarch64-gnu-linux -mattr=+neon,+sve -vector-library=sleefgnuabi < %s | FileCheck %s -check-prefix=SLEEF
3
3
; RUN: llc -mtriple=aarch64-gnu-linux -mattr=+neon,+sve -vector-library=ArmPL < %s | FileCheck %s -check-prefix=ARMPL
4
+ ; Check we expand to a vector library call on aarch64-amazon-linux:
5
+ ; RUN: llc -mtriple=aarch64-amazon-linux -mattr=+neon,+sve -vector-library=sleefgnuabi < %s | FileCheck %s -check-prefix=SLEEF
6
+ ; RUN: llc -mtriple=aarch64-amazon-linux -mattr=+neon,+sve -vector-library=ArmPL < %s | FileCheck %s -check-prefix=ARMPL
4
7
5
8
define void @test_sincos_v4f32 (<4 x float > %x , ptr noalias %out_sin , ptr noalias %out_cos ) {
6
9
; SLEEF-LABEL: test_sincos_v4f32:
Original file line number Diff line number Diff line change 1
1
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --filter "(:|sincos|modf|extractvalue|store)" --version 5
2
2
; RUN: opt -passes=loop-vectorize -mtriple=aarch64-gnu-linux -mcpu=neoverse-v1 -mattr=+sve < %s -S -o - -debug-only=loop-vectorize 2>%t.1 | FileCheck %s --check-prefix=CHECK
3
3
; RUN: opt -passes=loop-vectorize -mtriple=aarch64-gnu-linux -mcpu=neoverse-v1 -mattr=+sve -vector-library=ArmPL < %s -S -o - -debug-only=loop-vectorize 2>%t.2 | FileCheck %s --check-prefix=CHECK-ARMPL
4
+ ; RUN: opt -passes=loop-vectorize -mtriple=aarch64-amazon-linux -mcpu=neoverse-v1 -mattr=+sve -vector-library=ArmPL < %s -S -o - -debug-only=loop-vectorize 2>%t.3 | FileCheck %s --check-prefix=CHECK-ARMPL
4
5
; RUN: FileCheck --input-file=%t.1 --check-prefix=CHECK-COST %s
5
6
; RUN: FileCheck --input-file=%t.2 --check-prefix=CHECK-COST-ARMPL %s
7
+ ; Check we vectorize the functions with the vector-library on aarch64-amazon-linux:
8
+ ; RUN: FileCheck --input-file=%t.3 --check-prefix=CHECK-COST-ARMPL %s
6
9
; REQUIRES: asserts
7
10
8
11
; CHECK-COST-LABEL: sincos_f32
Original file line number Diff line number Diff line change @@ -125,6 +125,11 @@ TEST(TripleTest, ParsedIDs) {
125
125
EXPECT_EQ (Triple::Hurd, T.getOS ());
126
126
EXPECT_EQ (Triple::GNU, T.getEnvironment ());
127
127
128
+ T = Triple (" aarch64-amazon-linux" );
129
+ EXPECT_EQ (Triple::aarch64, T.getArch ());
130
+ EXPECT_EQ (Triple::Amazon, T.getVendor ());
131
+ EXPECT_EQ (Triple::Linux, T.getOS ());
132
+
128
133
T = Triple (" arm-unknown-linux-android16" );
129
134
EXPECT_EQ (Triple::arm, T.getArch ());
130
135
EXPECT_EQ (Triple::UnknownVendor, T.getVendor ());
You can’t perform that action at this time.
0 commit comments