Skip to content

Commit 810f4f7

Browse files
authored
merge main into amd-staging (llvm#1964)
2 parents 0a00ecf + cba13ec commit 810f4f7

File tree

6 files changed

+129
-19
lines changed

6 files changed

+129
-19
lines changed

llvm/include/llvm/DebugInfo/GSYM/InlineInfo.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ class GsymReader;
5858
///
5959
struct InlineInfo {
6060

61-
uint32_t Name; ///< String table offset in the string table.
62-
uint32_t CallFile; ///< 1 based file index in the file table.
63-
uint32_t CallLine; ///< Source line number.
61+
uint32_t Name = 0; ///< String table offset in the string table.
62+
uint32_t CallFile = 0; ///< 1 based file index in the file table.
63+
uint32_t CallLine = 0; ///< Source line number.
6464
AddressRanges Ranges;
6565
std::vector<InlineInfo> Children;
66-
InlineInfo() : Name(0), CallFile(0), CallLine(0) {}
66+
InlineInfo() = default;
6767
void clear() {
6868
Name = 0;
6969
CallFile = 0;

llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,17 +224,15 @@ class BasicLayout {
224224
friend class BasicLayout;
225225

226226
public:
227-
Segment()
228-
: ContentSize(0), ZeroFillSize(0), Addr(0), WorkingMem(nullptr),
229-
NextWorkingMemOffset(0) {}
227+
Segment() = default;
230228
Align Alignment;
231-
size_t ContentSize;
232-
uint64_t ZeroFillSize;
229+
size_t ContentSize = 0;
230+
uint64_t ZeroFillSize = 0;
233231
orc::ExecutorAddr Addr;
234232
char *WorkingMem = nullptr;
235233

236234
private:
237-
size_t NextWorkingMemOffset;
235+
size_t NextWorkingMemOffset = 0;
238236
std::vector<Block *> ContentBlocks, ZeroFillBlocks;
239237
};
240238

llvm/lib/FileCheck/FileCheckImpl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ struct ExpressionFormat {
5151
};
5252

5353
private:
54-
Kind Value;
54+
Kind Value = Kind::NoFormat;
5555
unsigned Precision = 0;
5656
/// printf-like "alternate form" selected.
5757
bool AlternateForm = false;
@@ -78,7 +78,7 @@ struct ExpressionFormat {
7878
/// \returns the format specifier corresponding to this format as a string.
7979
StringRef toString() const;
8080

81-
ExpressionFormat() : Value(Kind::NoFormat){};
81+
ExpressionFormat() = default;
8282
explicit ExpressionFormat(Kind Value) : Value(Value), Precision(0){};
8383
explicit ExpressionFormat(Kind Value, unsigned Precision)
8484
: Value(Value), Precision(Precision){};

llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,11 @@ namespace SPIRV {
184184
/// Parses the name part of the demangled builtin call.
185185
std::string lookupBuiltinNameHelper(StringRef DemangledCall,
186186
FPDecorationId *DecorationId) {
187-
const static std::string PassPrefix = "(anonymous namespace)::";
187+
StringRef PassPrefix = "(anonymous namespace)::";
188188
std::string BuiltinName;
189189
// Itanium Demangler result may have "(anonymous namespace)::" prefix
190-
if (DemangledCall.starts_with(PassPrefix.c_str()))
191-
BuiltinName = DemangledCall.substr(PassPrefix.length());
190+
if (DemangledCall.starts_with(PassPrefix))
191+
BuiltinName = DemangledCall.substr(PassPrefix.size());
192192
else
193193
BuiltinName = DemangledCall;
194194
// Extract the builtin function name and types of arguments from the call
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2+
; RUN: opt -mtriple=aarch64 -passes=vector-combine -S %s | FileCheck %s
3+
4+
define <8 x i32> @test1(<4 x i32> %0, <4 x i32> %1) {
5+
; CHECK-LABEL: @test1(
6+
; CHECK-NEXT: entry:
7+
; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <4 x i32> [[TMP0:%.*]], <4 x i32> [[TMP1:%.*]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
8+
; CHECK-NEXT: [[TMP3:%.*]] = call <8 x i32> @llvm.abs.v8i32(<8 x i32> [[TMP2]], i1 false)
9+
; CHECK-NEXT: ret <8 x i32> [[TMP3]]
10+
;
11+
entry:
12+
%2 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %0, i1 false)
13+
%3 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %1, i1 false)
14+
%4 = shufflevector <4 x i32> %2, <4 x i32> %3, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
15+
ret <8 x i32> %4
16+
}
17+
18+
define <8 x i32> @test2(<4 x i32> %0, <4 x i32> %1) {
19+
; CHECK-LABEL: @test2(
20+
; CHECK-NEXT: entry:
21+
; CHECK-NEXT: [[TMP2:%.*]] = call <4 x i32> @llvm.abs.v4i32(<4 x i32> [[TMP0:%.*]], i1 true)
22+
; CHECK-NEXT: [[TMP3:%.*]] = call <4 x i32> @llvm.abs.v4i32(<4 x i32> [[TMP1:%.*]], i1 false)
23+
; CHECK-NEXT: [[TMP4:%.*]] = shufflevector <4 x i32> [[TMP2]], <4 x i32> [[TMP3]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
24+
; CHECK-NEXT: ret <8 x i32> [[TMP4]]
25+
;
26+
entry:
27+
%2 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %0, i1 true)
28+
%3 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %1, i1 false)
29+
%4 = shufflevector <4 x i32> %2, <4 x i32> %3, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
30+
ret <8 x i32> %4
31+
}
32+
33+
define <8 x i32> @test3(<4 x i32> %0, <4 x i32> %1, <4 x i32> %2, <4 x i32> %3) {
34+
; CHECK-LABEL: @test3(
35+
; CHECK-NEXT: entry:
36+
; CHECK-NEXT: [[TMP4:%.*]] = shufflevector <4 x i32> [[TMP0:%.*]], <4 x i32> [[TMP2:%.*]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
37+
; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <4 x i32> [[TMP1:%.*]], <4 x i32> [[TMP3:%.*]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
38+
; CHECK-NEXT: [[TMP6:%.*]] = call <8 x i32> @llvm.smax.v8i32(<8 x i32> [[TMP4]], <8 x i32> [[TMP5]])
39+
; CHECK-NEXT: ret <8 x i32> [[TMP6]]
40+
;
41+
entry:
42+
%4 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %0, <4 x i32> %1)
43+
%5 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %2, <4 x i32> %3)
44+
%6 = shufflevector <4 x i32> %4, <4 x i32> %5, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
45+
ret <8 x i32> %6
46+
}
47+
48+
define <8 x i1> @test4(<4 x float> %0, <4 x float> %1) {
49+
; CHECK-LABEL: @test4(
50+
; CHECK-NEXT: entry:
51+
; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <4 x float> [[TMP0:%.*]], <4 x float> [[TMP1:%.*]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
52+
; CHECK-NEXT: [[TMP3:%.*]] = call <8 x i1> @llvm.is.fpclass.v8f32(<8 x float> [[TMP2]], i32 0)
53+
; CHECK-NEXT: ret <8 x i1> [[TMP3]]
54+
;
55+
entry:
56+
%2 = call <4 x i1> @llvm.is.fpclass.v4f32(<4 x float> %0, i32 0)
57+
%3 = call <4 x i1> @llvm.is.fpclass.v4f32(<4 x float> %1, i32 0)
58+
%4 = shufflevector <4 x i1> %2, <4 x i1> %3, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
59+
ret <8 x i1> %4
60+
}
61+
62+
define <2 x i1> @test4b(<4 x float> %0, <4 x float> %1) {
63+
; CHECK-LABEL: @test4b(
64+
; CHECK-NEXT: entry:
65+
; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <4 x float> [[TMP0:%.*]], <4 x float> [[TMP1:%.*]], <2 x i32> <i32 0, i32 4>
66+
; CHECK-NEXT: [[TMP3:%.*]] = call <2 x i1> @llvm.is.fpclass.v2f32(<2 x float> [[TMP2]], i32 0)
67+
; CHECK-NEXT: ret <2 x i1> [[TMP3]]
68+
;
69+
entry:
70+
%2 = call <4 x i1> @llvm.is.fpclass.v4f32(<4 x float> %0, i32 0)
71+
%3 = call <4 x i1> @llvm.is.fpclass.v4f32(<4 x float> %1, i32 0)
72+
%4 = shufflevector <4 x i1> %2, <4 x i1> %3, <2 x i32> <i32 0, i32 4>
73+
ret <2 x i1> %4
74+
}
75+
76+
define <8 x float> @test5(<4 x float> %0, i32 %1, <4 x float> %2, <4 x i32> %3) {
77+
; CHECK-LABEL: @test5(
78+
; CHECK-NEXT: entry:
79+
; CHECK-NEXT: [[TMP4:%.*]] = call <4 x float> @llvm.powi.v4f32.i32(<4 x float> [[TMP0:%.*]], i32 [[TMP1:%.*]])
80+
; CHECK-NEXT: [[TMP5:%.*]] = call <4 x float> @llvm.powi.v4f32.v4i32(<4 x float> [[TMP2:%.*]], <4 x i32> [[TMP3:%.*]])
81+
; CHECK-NEXT: [[TMP6:%.*]] = shufflevector <4 x float> [[TMP4]], <4 x float> [[TMP5]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
82+
; CHECK-NEXT: ret <8 x float> [[TMP6]]
83+
;
84+
entry:
85+
%4 = call <4 x float> @llvm.powi.v4f32.i32(<4 x float> %0, i32 %1)
86+
%5 = call <4 x float> @llvm.powi.v4f32.v4i32(<4 x float> %2, <4 x i32> %3)
87+
%6 = shufflevector <4 x float> %4, <4 x float> %5, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
88+
ret <8 x float> %6
89+
}
90+
91+
define <2 x float> @test6(<4 x float> %a1, <4 x float> %b1, <4 x float> %c1, <4 x float> %a2, <4 x float> %b2, <4 x float> %c2) {
92+
; CHECK-LABEL: @test6(
93+
; CHECK-NEXT: [[F1:%.*]] = call <4 x float> @llvm.fma.v4f32(<4 x float> [[A1:%.*]], <4 x float> [[B1:%.*]], <4 x float> [[C1:%.*]])
94+
; CHECK-NEXT: [[F2:%.*]] = call <4 x float> @llvm.fma.v4f32(<4 x float> [[A2:%.*]], <4 x float> [[B2:%.*]], <4 x float> [[C2:%.*]])
95+
; CHECK-NEXT: [[S:%.*]] = shufflevector <4 x float> [[F1]], <4 x float> [[F2]], <2 x i32> <i32 0, i32 4>
96+
; CHECK-NEXT: ret <2 x float> [[S]]
97+
;
98+
%f1 = call <4 x float> @llvm.fma.v4f32(<4 x float> %a1, <4 x float> %b1, <4 x float> %c1)
99+
%f2 = call <4 x float> @llvm.fma.v4f32(<4 x float> %a2, <4 x float> %b2, <4 x float> %c2)
100+
%s = shufflevector <4 x float> %f1, <4 x float> %f2, <2 x i32> <i32 0, i32 4>
101+
ret <2 x float> %s
102+
}
103+
104+
105+
declare <4 x i32> @llvm.abs.v4i32(<4 x i32>, i1)
106+
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>)
107+
declare <4 x i1> @llvm.is.fpclass.v4f32(<4 x float>, i32)
108+
declare <4 x float> @llvm.powi.v4f32.i32(<4 x float>, i32)
109+
declare <4 x float> @llvm.powi.v4f32.v4i32(<4 x float>, <4 x i32>)

offload/CMakeLists.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,12 @@ add_subdirectory(libomptarget)
462462
add_subdirectory(test)
463463

464464
# Add unit tests if GMock/GTest is present
465-
if (EXISTS ${LLVM_THIRD_PARTY_DIR}/unittest)
466-
if (NOT TARGET llvm_gtest)
467-
add_subdirectory(${LLVM_THIRD_PARTY_DIR}/unittest ${CMAKE_CURRENT_BINARY_DIR}/third-party/unittest)
468-
endif()
465+
if(NOT LLVM_THIRD_PARTY_DIR)
466+
set(LLVM_THIRD_PARTY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../third-party")
467+
endif()
468+
if(EXISTS ${LLVM_THIRD_PARTY_DIR}/unittest AND NOT TARGET llvm_gtest)
469+
add_subdirectory(${LLVM_THIRD_PARTY_DIR}/unittest ${CMAKE_CURRENT_BINARY_DIR}/third-party/unittest)
470+
endif()
471+
if(TARGET llvm_gtest)
469472
add_subdirectory(unittests)
470473
endif()

0 commit comments

Comments
 (0)