Skip to content

Commit 8118e04

Browse files
committed
Rebase
Created using spr 1.3.6-beta.1
2 parents 52c567e + fac9fcd commit 8118e04

File tree

15 files changed

+246
-64
lines changed

15 files changed

+246
-64
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Test that --print-supported-cpus lists supported CPU models, including aliases.
2+
3+
// REQUIRES: aarch64-registered-target
4+
5+
// RUN: %clang --target=arm64-apple-macosx --print-supported-cpus 2>&1 | \
6+
// RUN: FileCheck %s --check-prefix=CHECK --implicit-check-not=apple-latest
7+
8+
// CHECK: Target: arm64-apple-macosx
9+
10+
// CHECK: apple-a11
11+
// CHECK: apple-a12
12+
// CHECK: apple-a13
13+
// CHECK: apple-a14
14+
// CHECK: apple-a15
15+
// CHECK: apple-a16
16+
// CHECK: apple-a17
17+
// CHECK: apple-a7
18+
// CHECK: apple-a8
19+
// CHECK: apple-a9
20+
// CHECK: apple-m1
21+
// CHECK: apple-m2
22+
// CHECK: apple-m3
23+
// CHECK: apple-m4
24+
// CHECK: apple-s4
25+
// CHECK: apple-s5
26+
27+
// CHECK: Use -mcpu or -mtune to specify the target's processor.

compiler-rt/lib/interception/interception_win.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,9 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
634634
case 0xD284: // 84 D2 : test dl,dl
635635
return 2;
636636

637+
case 0xC1F6: // F6 C1 XX : test cl, XX
638+
return 3;
639+
637640
// Cannot overwrite control-instruction. Return 0 to indicate failure.
638641
case 0x25FF: // FF 25 XX YY ZZ WW : jmp dword ptr ds:[WWZZYYXX]
639642
return 0;
@@ -723,8 +726,7 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
723726
return 7;
724727
}
725728

726-
switch (0x00FFFFFF & *(u32*)address) {
727-
case 0x07c1f6: // f6 c1 07 : test cl, 0x7
729+
switch (0x00FFFFFF & *(u32 *)address) {
728730
case 0x10b70f: // 0f b7 10 : movzx edx, WORD PTR [rax]
729731
case 0xc00b4d: // 4d 0b c0 : or r8, r8
730732
case 0xc03345: // 45 33 c0 : xor r8d, r8d
@@ -808,7 +810,6 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
808810
case 0x798141: // 41 81 79 XX YY YY YY YY : cmp DWORD PTR [r9+YY], XX XX XX XX
809811
case 0x7a8141: // 41 81 7a XX YY YY YY YY : cmp DWORD PTR [r10+YY], XX XX XX XX
810812
case 0x7b8141: // 41 81 7b XX YY YY YY YY : cmp DWORD PTR [r11+YY], XX XX XX XX
811-
case 0x7c8141: // 41 81 7c XX YY YY YY YY : cmp DWORD PTR [r12+YY], XX XX XX XX
812813
case 0x7d8141: // 41 81 7d XX YY YY YY YY : cmp DWORD PTR [r13+YY], XX XX XX XX
813814
case 0x7e8141: // 41 81 7e XX YY YY YY YY : cmp DWORD PTR [r14+YY], XX XX XX XX
814815
case 0x7f8141: // 41 81 7f YY XX XX XX XX : cmp DWORD PTR [r15+YY], XX XX XX XX
@@ -835,6 +836,10 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
835836
case 0x2444c7: // C7 44 24 XX YY YY YY YY
836837
// mov dword ptr [rsp + XX], YYYYYYYY
837838
return 8;
839+
840+
case 0x7c8141: // 41 81 7c ZZ YY XX XX XX XX
841+
// cmp DWORD PTR [reg+reg*n+YY], XX XX XX XX
842+
return 9;
838843
}
839844

840845
switch (*(u32*)(address)) {

compiler-rt/lib/interception/tests/interception_win_test.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,7 @@ const struct InstructionSizeData {
927927
{ 3, {0x4d, 0x85, 0xed}, 0, "4d 85 ed : test r13, r13"},
928928
{ 3, {0x4d, 0x85, 0xf6}, 0, "4d 85 f6 : test r14, r14"},
929929
{ 3, {0x4d, 0x85, 0xff}, 0, "4d 85 ff : test r15, r15"},
930+
{ 3, {0xf6, 0xc1, 0x72}, 0, "f6 c1 XX : test cl, XX"},
930931
{ 4, {0x44, 0x0f, 0xb6, 0x1a}, 0, "44 0f b6 1a : movzx r11d, BYTE PTR [rdx]"},
931932
{ 4, {0x44, 0x8d, 0x42, 0x73}, 0, "44 8d 42 XX : lea r8d , [rdx + XX]"},
932933
{ 4, {0x48, 0x83, 0xec, 0x73}, 0, "48 83 ec XX : sub rsp, XX"},
@@ -989,6 +990,7 @@ const struct InstructionSizeData {
989990
{ 8, {0x41, 0x81, 0x7f, 0x73, 0x74, 0x75, 0x76, 0x77}, 0, "41 81 7f YY XX XX XX XX : cmp DWORD PTR [r15+YY], XX XX XX XX"},
990991
{ 8, {0x81, 0x7c, 0x24, 0x73, 0x74, 0x75, 0x76, 0x77}, 0, "81 7c 24 YY XX XX XX XX : cmp DWORD PTR [rsp+YY], XX XX XX XX"},
991992
{ 8, {0xc7, 0x44, 0x24, 0x73, 0x74, 0x75, 0x76, 0x77}, 0, "C7 44 24 XX YY YY YY YY : mov dword ptr [rsp + XX], YYYYYYYY"},
993+
{ 9, {0x41, 0x81, 0x7c, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78}, 0, "41 81 7c ZZ YY XX XX XX XX : cmp DWORD PTR [reg+reg*n+YY], XX XX XX XX"},
992994
{ 9, {0xA1, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78}, 0, "A1 XX XX XX XX XX XX XX XX : movabs eax, dword ptr ds:[XXXXXXXX]"},
993995
#else
994996
// sorted list

flang/Maintainers.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Flang maintainers
2+
3+
This file is a list of the
4+
[maintainers](https://llvm.org/docs/DeveloperPolicy.html#maintainers) for
5+
Flang
6+
7+
## Active maintainers
8+
9+
### Lead maintainers
10+
The following people are the active maintainers for the project. Please reach
11+
out to them for code reviews, questions about their area of expertise, or other
12+
assistance.
13+
14+
#### All areas not covered by others
15+
Steve Scalpone \
16+
[email protected] (email), sscalpone (GitHub), sscalpone (Discourse)
17+
18+
#### Backend (Lowering, Fortran dialects, Codegen)
19+
Jean Perier \
20+
[email protected] (email), jeanPerier (GitHub), jeanPerier (Discourse)
21+
22+
### Component maintainers
23+
These maintainers are responsible for particular high-level components within
24+
Flang that are typically contained to one area of the compiler.
25+
26+
#### Driver
27+
Andrzej Warzyński \
28+
[email protected] (email), banach-space (GitHub), banach-space (Discourse)
29+
30+
Tarun Prabhu \
31+
[email protected] (email), tarunprabhu (GitHub), tarunprabhu (Discourse)
32+
33+
#### Alias Analysis
34+
Renaud Kauffmann \
35+
[email protected] (email), Renaud-K (GitHub), Renaud-K (Discourse)
36+
37+
#### PFT, Block, IEEE support
38+
Val Donaldson \
39+
[email protected] (email), vdonaldson (GitHub)
40+
41+
#### Lowering, HLFIR, FIR, Codegen
42+
Jean Perier \
43+
[email protected] (email), jeanPerier (GitHub), jeanPerier (Discourse)
44+
45+
Slava Zakharin \
46+
[email protected] (email), vzakhari (GitHub), szakharin (Discourse)
47+
48+
Tom Eccles \
49+
[email protected] (email), tblah (GitHub), tblah (Discourse)
50+
51+
Valentin Clement \
52+
[email protected] (email), clementval (GitHub), clementval (Discourse)
53+
54+
#### OpenMP
55+
##### CPU support
56+
Tom Eccles \
57+
[email protected] (email), tblah (GitHub), tblah (Discourse)
58+
59+
##### OpenMP 6.0
60+
Krzysztof Parzyszek \
61+
[email protected] (email), kparzysz (GitHub), kparzysz (Discourse)
62+
63+
##### Target Offload
64+
Sergio Afonso \
65+
[email protected] (email), skatrak (GitHub), skatrak (Discourse)
66+
67+
#### OpenACC
68+
Valentin Clement \
69+
[email protected] (email), clementval (GitHub), clementval (Discourse)
70+
71+
Razvan Lupusoru \
72+
[email protected] (email), razvanlupusoru (GitHub), razvan.lupusoru (Discourse)
73+
74+
#### CUDA Fortran
75+
Valentin Clement \
76+
[email protected] (email), clementval (GitHub), clementval (Discourse)
77+
78+
#### Debug
79+
Abid Qadeer \
80+
[email protected] (email), abidh (GitHub), abidh (Discourse)
81+
82+
## Inactive Maintainers
83+
### Lead Maintainers
84+
#### Backend : (Lowering, FIR, Codegen)
85+
Eric Schweitz \
86+
[email protected] (email), schweitzpgi (GitHub), schweitz (Discourse)
87+
88+
### Component Maintainers
89+
#### Semantics
90+
Tim Keith
91+
92+
#### OpenMP
93+
Kiran Chandramohan \
94+
[email protected] (email), kiranchandramohan (GitHub), kiranchandramohan (Discourse)
95+

flang/Maintainers.txt

Lines changed: 0 additions & 18 deletions
This file was deleted.

llvm/include/llvm/CodeGen/TargetSubtargetInfo.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ class Triple;
6363
class TargetSubtargetInfo : public MCSubtargetInfo {
6464
protected: // Can only create subclasses...
6565
TargetSubtargetInfo(const Triple &TT, StringRef CPU, StringRef TuneCPU,
66-
StringRef FS, ArrayRef<SubtargetFeatureKV> PF,
66+
StringRef FS, ArrayRef<StringRef> PN,
67+
ArrayRef<SubtargetFeatureKV> PF,
6768
ArrayRef<SubtargetSubTypeKV> PD,
6869
const MCWriteProcResEntry *WPR,
6970
const MCWriteLatencyEntry *WL,

llvm/include/llvm/MC/MCSubtargetInfo.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ class MCSubtargetInfo {
7777
Triple TargetTriple;
7878
std::string CPU; // CPU being targeted.
7979
std::string TuneCPU; // CPU being tuned for.
80+
ArrayRef<StringRef> ProcNames; // Processor list, including aliases
8081
ArrayRef<SubtargetFeatureKV> ProcFeatures; // Processor feature list
8182
ArrayRef<SubtargetSubTypeKV> ProcDesc; // Processor descriptions
8283

@@ -95,7 +96,8 @@ class MCSubtargetInfo {
9596
public:
9697
MCSubtargetInfo(const MCSubtargetInfo &) = default;
9798
MCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef TuneCPU,
98-
StringRef FS, ArrayRef<SubtargetFeatureKV> PF,
99+
StringRef FS, ArrayRef<StringRef> PN,
100+
ArrayRef<SubtargetFeatureKV> PF,
99101
ArrayRef<SubtargetSubTypeKV> PD,
100102
const MCWriteProcResEntry *WPR, const MCWriteLatencyEntry *WL,
101103
const MCReadAdvanceEntry *RA, const InstrStage *IS,

llvm/lib/CodeGen/TargetSubtargetInfo.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ using namespace llvm;
1616

1717
TargetSubtargetInfo::TargetSubtargetInfo(
1818
const Triple &TT, StringRef CPU, StringRef TuneCPU, StringRef FS,
19-
ArrayRef<SubtargetFeatureKV> PF, ArrayRef<SubtargetSubTypeKV> PD,
20-
const MCWriteProcResEntry *WPR, const MCWriteLatencyEntry *WL,
21-
const MCReadAdvanceEntry *RA, const InstrStage *IS, const unsigned *OC,
22-
const unsigned *FP)
23-
: MCSubtargetInfo(TT, CPU, TuneCPU, FS, PF, PD, WPR, WL, RA, IS, OC, FP) {}
19+
ArrayRef<StringRef> PN, ArrayRef<SubtargetFeatureKV> PF,
20+
ArrayRef<SubtargetSubTypeKV> PD, const MCWriteProcResEntry *WPR,
21+
const MCWriteLatencyEntry *WL, const MCReadAdvanceEntry *RA,
22+
const InstrStage *IS, const unsigned *OC, const unsigned *FP)
23+
: MCSubtargetInfo(TT, CPU, TuneCPU, FS, PN, PF, PD, WPR, WL, RA, IS, OC,
24+
FP) {}
2425

2526
TargetSubtargetInfo::~TargetSubtargetInfo() = default;
2627

llvm/lib/MC/MCSubtargetInfo.cpp

Lines changed: 45 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,22 @@ static void ApplyFeatureFlag(FeatureBitset &Bits, StringRef Feature,
8585
}
8686

8787
/// Return the length of the longest entry in the table.
88-
template <typename T>
89-
static size_t getLongestEntryLength(ArrayRef<T> Table) {
88+
static size_t getLongestEntryLength(ArrayRef<SubtargetFeatureKV> Table) {
9089
size_t MaxLen = 0;
9190
for (auto &I : Table)
9291
MaxLen = std::max(MaxLen, std::strlen(I.Key));
9392
return MaxLen;
9493
}
9594

95+
static size_t getLongestEntryLength(ArrayRef<StringRef> Table) {
96+
size_t MaxLen = 0;
97+
for (StringRef I : Table)
98+
MaxLen = std::max(MaxLen, I.size());
99+
return MaxLen;
100+
}
101+
96102
/// Display help for feature and mcpu choices.
97-
static void Help(ArrayRef<SubtargetSubTypeKV> CPUTable,
103+
static void Help(ArrayRef<StringRef> CPUNames,
98104
ArrayRef<SubtargetFeatureKV> FeatTable) {
99105
// the static variable ensures that the help information only gets
100106
// printed once even though a target machine creates multiple subtargets
@@ -104,14 +110,20 @@ static void Help(ArrayRef<SubtargetSubTypeKV> CPUTable,
104110
}
105111

106112
// Determine the length of the longest CPU and Feature entries.
107-
unsigned MaxCPULen = getLongestEntryLength(CPUTable);
113+
unsigned MaxCPULen = getLongestEntryLength(CPUNames);
108114
unsigned MaxFeatLen = getLongestEntryLength(FeatTable);
109115

110116
// Print the CPU table.
111117
errs() << "Available CPUs for this target:\n\n";
112-
for (auto &CPU : CPUTable)
113-
errs() << format(" %-*s - Select the %s processor.\n", MaxCPULen, CPU.Key,
114-
CPU.Key);
118+
for (auto &CPUName : CPUNames) {
119+
// Skip apple-latest, as that's only meant to be used in
120+
// disassemblers/debuggers, and we don't want normal code to be built with
121+
// it as an -mcpu=
122+
if (CPUName == "apple-latest")
123+
continue;
124+
errs() << format(" %-*s - Select the %s processor.\n", MaxCPULen,
125+
CPUName.str().c_str(), CPUName.str().c_str());
126+
}
115127
errs() << '\n';
116128

117129
// Print the Feature table.
@@ -127,7 +139,7 @@ static void Help(ArrayRef<SubtargetSubTypeKV> CPUTable,
127139
}
128140

129141
/// Display help for mcpu choices only
130-
static void cpuHelp(ArrayRef<SubtargetSubTypeKV> CPUTable) {
142+
static void cpuHelp(ArrayRef<StringRef> CPUNames) {
131143
// the static variable ensures that the help information only gets
132144
// printed once even though a target machine creates multiple subtargets
133145
static bool PrintOnce = false;
@@ -137,8 +149,14 @@ static void cpuHelp(ArrayRef<SubtargetSubTypeKV> CPUTable) {
137149

138150
// Print the CPU table.
139151
errs() << "Available CPUs for this target:\n\n";
140-
for (auto &CPU : CPUTable)
141-
errs() << "\t" << CPU.Key << "\n";
152+
for (auto &CPU : CPUNames) {
153+
// Skip apple-latest, as that's only meant to be used in
154+
// disassemblers/debuggers, and we don't want normal code to be built with
155+
// it as an -mcpu=
156+
if (CPU == "apple-latest")
157+
continue;
158+
errs() << "\t" << CPU << "\n";
159+
}
142160
errs() << '\n';
143161

144162
errs() << "Use -mcpu or -mtune to specify the target's processor.\n"
@@ -148,7 +166,9 @@ static void cpuHelp(ArrayRef<SubtargetSubTypeKV> CPUTable) {
148166
PrintOnce = true;
149167
}
150168

151-
static FeatureBitset getFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS,
169+
static FeatureBitset getFeatures(MCSubtargetInfo &STI, StringRef CPU,
170+
StringRef TuneCPU, StringRef FS,
171+
ArrayRef<StringRef> ProcNames,
152172
ArrayRef<SubtargetSubTypeKV> ProcDesc,
153173
ArrayRef<SubtargetFeatureKV> ProcFeatures) {
154174
SubtargetFeatures Features(FS);
@@ -163,7 +183,7 @@ static FeatureBitset getFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS,
163183

164184
// Check if help is needed
165185
if (CPU == "help")
166-
Help(ProcDesc, ProcFeatures);
186+
Help(ProcNames, ProcFeatures);
167187

168188
// Find CPU entry if CPU name is specified.
169189
else if (!CPU.empty()) {
@@ -196,9 +216,9 @@ static FeatureBitset getFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS,
196216
for (const std::string &Feature : Features.getFeatures()) {
197217
// Check for help
198218
if (Feature == "+help")
199-
Help(ProcDesc, ProcFeatures);
219+
Help(ProcNames, ProcFeatures);
200220
else if (Feature == "+cpuhelp")
201-
cpuHelp(ProcDesc);
221+
cpuHelp(ProcNames);
202222
else
203223
ApplyFeatureFlag(Bits, Feature, ProcFeatures);
204224
}
@@ -208,7 +228,8 @@ static FeatureBitset getFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS,
208228

209229
void MCSubtargetInfo::InitMCProcessorInfo(StringRef CPU, StringRef TuneCPU,
210230
StringRef FS) {
211-
FeatureBits = getFeatures(CPU, TuneCPU, FS, ProcDesc, ProcFeatures);
231+
FeatureBits =
232+
getFeatures(*this, CPU, TuneCPU, FS, ProcNames, ProcDesc, ProcFeatures);
212233
FeatureString = std::string(FS);
213234

214235
if (!TuneCPU.empty())
@@ -219,20 +240,19 @@ void MCSubtargetInfo::InitMCProcessorInfo(StringRef CPU, StringRef TuneCPU,
219240

220241
void MCSubtargetInfo::setDefaultFeatures(StringRef CPU, StringRef TuneCPU,
221242
StringRef FS) {
222-
FeatureBits = getFeatures(CPU, TuneCPU, FS, ProcDesc, ProcFeatures);
243+
FeatureBits =
244+
getFeatures(*this, CPU, TuneCPU, FS, ProcNames, ProcDesc, ProcFeatures);
223245
FeatureString = std::string(FS);
224246
}
225247

226-
MCSubtargetInfo::MCSubtargetInfo(const Triple &TT, StringRef C, StringRef TC,
227-
StringRef FS, ArrayRef<SubtargetFeatureKV> PF,
228-
ArrayRef<SubtargetSubTypeKV> PD,
229-
const MCWriteProcResEntry *WPR,
230-
const MCWriteLatencyEntry *WL,
231-
const MCReadAdvanceEntry *RA,
232-
const InstrStage *IS, const unsigned *OC,
233-
const unsigned *FP)
248+
MCSubtargetInfo::MCSubtargetInfo(
249+
const Triple &TT, StringRef C, StringRef TC, StringRef FS,
250+
ArrayRef<StringRef> PN, ArrayRef<SubtargetFeatureKV> PF,
251+
ArrayRef<SubtargetSubTypeKV> PD, const MCWriteProcResEntry *WPR,
252+
const MCWriteLatencyEntry *WL, const MCReadAdvanceEntry *RA,
253+
const InstrStage *IS, const unsigned *OC, const unsigned *FP)
234254
: TargetTriple(TT), CPU(std::string(C)), TuneCPU(std::string(TC)),
235-
ProcFeatures(PF), ProcDesc(PD), WriteProcResTable(WPR),
255+
ProcNames(PN), ProcFeatures(PF), ProcDesc(PD), WriteProcResTable(WPR),
236256
WriteLatencyTable(WL), ReadAdvanceTable(RA), Stages(IS),
237257
OperandCycles(OC), ForwardingPaths(FP) {
238258
InitMCProcessorInfo(CPU, TuneCPU, FS);

0 commit comments

Comments
 (0)