Skip to content

Commit cf8fb1b

Browse files
SC llvm teamSC llvm team
SC llvm team
authored and
SC llvm team
committed
Merged main:be6aed90c70b7ef718c6c9217158933c8dd57372 into amd-gfx:a2173ce377e5
Local branch amd-gfx a2173ce Merged main:68ed1728bf45162187a2b54eed226097b8fc0a12 into amd-gfx:f0ff55b15e04 Remote branch main be6aed9 [SLP]Use number of scalars as a vector length for minbw cast
2 parents a2173ce + be6aed9 commit cf8fb1b

File tree

38 files changed

+2186
-1567
lines changed

38 files changed

+2186
-1567
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1975,10 +1975,15 @@ def fno_color_diagnostics : Flag<["-"], "fno-color-diagnostics">, Group<f_Group>
19751975
Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
19761976
HelpText<"Disable colors in diagnostics">;
19771977
def : Flag<["-"], "fdiagnostics-color">, Group<f_Group>,
1978-
Visibility<[ClangOption, CLOption, DXCOption]>, Alias<fcolor_diagnostics>;
1978+
Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
1979+
Alias<fcolor_diagnostics>;
19791980
def : Flag<["-"], "fno-diagnostics-color">, Group<f_Group>,
1980-
Visibility<[ClangOption, CLOption, DXCOption]>, Alias<fno_color_diagnostics>;
1981-
def fdiagnostics_color_EQ : Joined<["-"], "fdiagnostics-color=">, Group<f_Group>;
1981+
Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
1982+
Alias<fno_color_diagnostics>;
1983+
def fdiagnostics_color_EQ : Joined<["-"], "fdiagnostics-color=">, Group<f_Group>,
1984+
Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
1985+
Values<"auto,always,never">,
1986+
HelpText<"When to use colors in diagnostics">;
19821987
def fansi_escape_codes : Flag<["-"], "fansi-escape-codes">, Group<f_Group>,
19831988
Visibility<[ClangOption, CLOption, DXCOption, CC1Option]>,
19841989
HelpText<"Use ANSI escape codes for diagnostics">,

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4424,21 +4424,7 @@ static void RenderDiagnosticsOptions(const Driver &D, const ArgList &Args,
44244424
CmdArgs.push_back("-fno-diagnostics-show-note-include-stack");
44254425
}
44264426

4427-
// Color diagnostics are parsed by the driver directly from argv and later
4428-
// re-parsed to construct this job; claim any possible color diagnostic here
4429-
// to avoid warn_drv_unused_argument and diagnose bad
4430-
// OPT_fdiagnostics_color_EQ values.
4431-
Args.getLastArg(options::OPT_fcolor_diagnostics,
4432-
options::OPT_fno_color_diagnostics);
4433-
if (const Arg *A = Args.getLastArg(options::OPT_fdiagnostics_color_EQ)) {
4434-
StringRef Value(A->getValue());
4435-
if (Value != "always" && Value != "never" && Value != "auto")
4436-
D.Diag(diag::err_drv_invalid_argument_to_option)
4437-
<< Value << A->getOption().getName();
4438-
}
4439-
4440-
if (D.getDiags().getDiagnosticOptions().ShowColors)
4441-
CmdArgs.push_back("-fcolor-diagnostics");
4427+
handleColorDiagnosticsArgs(D, Args, CmdArgs);
44424428

44434429
if (Args.hasArg(options::OPT_fansi_escape_codes))
44444430
CmdArgs.push_back("-fansi-escape-codes");

clang/lib/Driver/ToolChains/CommonArgs.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2960,3 +2960,22 @@ void tools::addMCModel(const Driver &D, const llvm::opt::ArgList &Args,
29602960
}
29612961
}
29622962
}
2963+
2964+
void tools::handleColorDiagnosticsArgs(const Driver &D, const ArgList &Args,
2965+
ArgStringList &CmdArgs) {
2966+
// Color diagnostics are parsed by the driver directly from argv and later
2967+
// re-parsed to construct this job; claim any possible color diagnostic here
2968+
// to avoid warn_drv_unused_argument and diagnose bad
2969+
// OPT_fdiagnostics_color_EQ values.
2970+
Args.getLastArg(options::OPT_fcolor_diagnostics,
2971+
options::OPT_fno_color_diagnostics);
2972+
if (const Arg *A = Args.getLastArg(options::OPT_fdiagnostics_color_EQ)) {
2973+
StringRef Value(A->getValue());
2974+
if (Value != "always" && Value != "never" && Value != "auto")
2975+
D.Diag(diag::err_drv_invalid_argument_to_option)
2976+
<< Value << A->getOption().getName();
2977+
}
2978+
2979+
if (D.getDiags().getDiagnosticOptions().ShowColors)
2980+
CmdArgs.push_back("-fcolor-diagnostics");
2981+
}

clang/lib/Driver/ToolChains/CommonArgs.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,10 @@ void addMCModel(const Driver &D, const llvm::opt::ArgList &Args,
233233
const llvm::Reloc::Model &RelocationModel,
234234
llvm::opt::ArgStringList &CmdArgs);
235235

236+
/// Handle the -f{no}-color-diagnostics and -f{no}-diagnostics-colors options.
237+
void handleColorDiagnosticsArgs(const Driver &D, const llvm::opt::ArgList &Args,
238+
llvm::opt::ArgStringList &CmdArgs);
239+
236240
} // end namespace tools
237241
} // end namespace driver
238242
} // end namespace clang

clang/lib/Driver/ToolChains/Flang.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -727,13 +727,7 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA,
727727

728728
addFortranDialectOptions(Args, CmdArgs);
729729

730-
// Color diagnostics are parsed by the driver directly from argv and later
731-
// re-parsed to construct this job; claim any possible color diagnostic here
732-
// to avoid warn_drv_unused_argument.
733-
Args.getLastArg(options::OPT_fcolor_diagnostics,
734-
options::OPT_fno_color_diagnostics);
735-
if (Diags.getDiagnosticOptions().ShowColors)
736-
CmdArgs.push_back("-fcolor-diagnostics");
730+
handleColorDiagnosticsArgs(D, Args, CmdArgs);
737731

738732
// LTO mode is parsed by the Clang driver library.
739733
LTOKind LTOMode = D.getLTOMode();
Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,53 @@
1-
! Test that flang-new forwards -f{no-}color-diagnostics options to
2-
! flang-new -fc1 as expected.
1+
! Test that flang-new forwards -f{no-}color-diagnostics and
2+
! -f{no-}diagnostics-color options to flang-new -fc1 as expected.
33

44
! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 -fcolor-diagnostics \
55
! RUN: | FileCheck %s --check-prefix=CHECK-CD
6+
! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 -fdiagnostics-color \
7+
! RUN: | FileCheck %s --check-prefix=CHECK-CD
8+
! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 -fdiagnostics-color=always \
9+
! RUN: | FileCheck %s --check-prefix=CHECK-CD
610
! CHECK-CD: "-fc1"{{.*}} "-fcolor-diagnostics"
711

812
! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 -fno-color-diagnostics \
913
! RUN: | FileCheck %s --check-prefix=CHECK-NCD
14+
! RUN: %flang -fsyntax-only -### %s -o %t -fno-diagnostics-color 2>&1 \
15+
! RUN: | FileCheck %s --check-prefix=CHECK-NCD
16+
! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 -fdiagnostics-color=never \
17+
! RUN: | FileCheck %s --check-prefix=CHECK-NCD
1018
! CHECK-NCD-NOT: "-fc1"{{.*}} "-fcolor-diagnostics"
1119

1220
! Check that the last flag wins.
1321
! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 \
1422
! RUN: -fno-color-diagnostics -fcolor-diagnostics \
1523
! RUN: | FileCheck %s --check-prefix=CHECK-NCD_CD_S
24+
! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 \
25+
! RUN: -fno-diagnostics-color -fdiagnostics-color \
26+
! RUN: | FileCheck %s --check-prefix=CHECK-NCD_CD_S
27+
! RUN: %flang -fsyntax-only -### %s -o %t \
28+
! RUN: -fno-color-diagnostics -fdiagnostics-color=always 2>&1 \
29+
! RUN: | FileCheck %s --check-prefix=CHECK-NCD_CD_S
30+
! RUN: %flang -fsyntax-only -### %s -o %t \
31+
! RUN: -fdiagnostics-color=never -fdiagnostics-color=always 2>&1 \
32+
! RUN: | FileCheck %s --check-prefix=CHECK-NCD_CD_S
33+
! RUN: %flang -fsyntax-only -### %s -o %t \
34+
! RUN: -fdiagnostics-color=never -fcolor-diagnostics 2>&1 \
35+
! RUN: | FileCheck %s --check-prefix=CHECK-NCD_CD_S
1636
! CHECK-NCD_CD_S: "-fc1"{{.*}} "-fcolor-diagnostics"
1737

1838
! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 \
1939
! RUN: -fcolor-diagnostics -fno-color-diagnostics \
2040
! RUN: | FileCheck %s --check-prefix=CHECK-CD_NCD_S
41+
! RUN: %flang -fsyntax-only -### %s -o %t \
42+
! RUN: -fdiagnostics-color -fno-diagnostics-color 2>&1 \
43+
! RUN: | FileCheck %s --check-prefix=CHECK-CD_NCD_S
44+
! RUN: %flang -fsyntax-only -### %s -o %t \
45+
! RUN: -fdiagnostics-color=always -fno-color-diagnostics 2>&1 \
46+
! RUN: | FileCheck %s --check-prefix=CHECK-CD_NCD_S
47+
! RUN: %flang -fsyntax-only -### %s -o %t \
48+
! RUN: -fdiagnostics-color=always -fdiagnostics-color=never 2>&1 \
49+
! RUN: | FileCheck %s --check-prefix=CHECK-CD_NCD_S
50+
! RUN: %flang -fsyntax-only -### %s -o %t \
51+
! RUN: -fcolor-diagnostics -fdiagnostics-color=never 2>&1 \
52+
! RUN: | FileCheck %s --check-prefix=CHECK-CD_NCD_S
2153
! CHECK-CD_NCD_S-NOT: "-fc1"{{.*}} "-fcolor-diagnostics"

flang/test/Driver/color-diagnostics-parse.f90

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
1-
! Test the behaviors of -f{no-}color-diagnostics when emitting parsing
2-
! diagnostics.
1+
! Test the behaviors of -f{no-}color-diagnostics and -f{no-}diagnostics-color
2+
! when emitting parsing diagnostics.
33
! Windows command prompt doesn't support ANSI escape sequences.
44
! REQUIRES: shell
55

66
! RUN: not %flang %s -fcolor-diagnostics 2>&1 \
77
! RUN: | FileCheck %s --check-prefix=CHECK_CD
8+
! RUN: not %flang %s -fdiagnostics-color 2>&1 \
9+
! RUN: | FileCheck %s --check-prefix=CHECK_CD
10+
! RUN: not %flang %s -fdiagnostics-color=always 2>&1 \
11+
! RUN: | FileCheck %s --check-prefix=CHECK_CD
12+
813
! RUN: not %flang %s -fno-color-diagnostics 2>&1 \
914
! RUN: | FileCheck %s --check-prefix=CHECK_NCD
15+
! RUN: not %flang %s -fno-diagnostics-color 2>&1 \
16+
! RUN: | FileCheck %s --check-prefix=CHECK_NCD
17+
! RUN: not %flang %s -fdiagnostics-color=never 2>&1 \
18+
! RUN: | FileCheck %s --check-prefix=CHECK_NCD
19+
1020
! RUN: not %flang_fc1 %s -fcolor-diagnostics 2>&1 \
1121
! RUN: | FileCheck %s --check-prefix=CHECK_CD
1222
! RUN: not %flang_fc1 %s 2>&1 | FileCheck %s --check-prefix=CHECK_NCD

flang/test/Driver/color-diagnostics-scan.f

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
! Test the behaviors of -f{no-}color-diagnostics when emitting scanning
2-
! diagnostics.
1+
! Test the behaviors of -f{no-}color-diagnostics and -f{no}-diagnostic-colors
2+
! when emitting scanning diagnostics.
33
! Windows command prompt doesn't support ANSI escape sequences.
44
! REQUIRES: shell
55
@@ -9,6 +9,17 @@
99
! RUN: | FileCheck %s --check-prefix=CHECK_NCD
1010
! RUN: not %flang_fc1 -E -Werror %s -fcolor-diagnostics 2>&1 \
1111
! RUN: | FileCheck %s --check-prefix=CHECK_CD
12+
13+
! RUN: not %flang %s -E -Werror -fdiagnostics-color 2>&1 \
14+
! RUN: | FileCheck %s --check-prefix=CHECK_CD
15+
! RUN: not %flang %s -E -Werror -fno-diagnostics-color 2>&1 \
16+
! RUN: | FileCheck %s --check-prefix=CHECK_NCD
17+
18+
! RUN: not %flang %s -E -Werror -fdiagnostics-color=always 2>&1 \
19+
! RUN: | FileCheck %s --check-prefix=CHECK_CD
20+
! RUN: not %flang %s -E -Werror -fdiagnostics-color=never 2>&1 \
21+
! RUN: | FileCheck %s --check-prefix=CHECK_NCD
22+
1223
! RUN: not %flang_fc1 -E -Werror %s 2>&1 | FileCheck %s --check-prefix=CHECK_NCD
1324
1425
! CHECK_CD: {{.*}}[0;1;35mwarning: {{.*}}[0mCharacter in fixed-form label field must be a digit

flang/test/Driver/color-diagnostics-sema.f90

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
! Test the behaviors of -f{no-}color-diagnostics when emitting semantic
2-
! diagnostics.
1+
! Test the behaviors of -f{no-}color-diagnostics and -f{no}diagnostics-color
2+
! when emitting semantic diagnostics.
33
! Windows command prompt doesn't support ANSI escape sequences.
44
! REQUIRES: shell
55

@@ -9,6 +9,17 @@
99
! RUN: | FileCheck %s --check-prefix=CHECK_NCD
1010
! RUN: not %flang_fc1 %s -fcolor-diagnostics 2>&1 \
1111
! RUN: | FileCheck %s --check-prefix=CHECK_CD
12+
13+
! RUN: not %flang %s -fdiagnostics-color 2>&1 \
14+
! RUN: | FileCheck %s --check-prefix=CHECK_CD
15+
! RUN: not %flang %s -fno-diagnostics-color 2>&1 \
16+
! RUN: | FileCheck %s --check-prefix=CHECK_NCD
17+
18+
! RUN: not %flang %s -fdiagnostics-color=always 2>&1 \
19+
! RUN: | FileCheck %s --check-prefix=CHECK_CD
20+
! RUN: not %flang %s -fdiagnostics-color=never 2>&1 \
21+
! RUN: | FileCheck %s --check-prefix=CHECK_NCD
22+
1223
! RUN: not %flang_fc1 %s 2>&1 | FileCheck %s --check-prefix=CHECK_NCD
1324

1425
! CHECK_CD: {{.*}}[0;1;31merror: {{.*}}[0mMust be a constant value

flang/test/Driver/color-diagnostics.f90

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
! Test the behaviors of -f{no-}color-diagnostics.
1+
! Test the behaviors of -f{no-}color-diagnostics and -f{no}-diagnostics-color.
22
! Windows command prompt doesn't support ANSI escape sequences.
33
! REQUIRES: shell
44

@@ -9,14 +9,36 @@
99
! RUN: not %flang_fc1 %s -fcolor-diagnostics 2>&1 \
1010
! RUN: | FileCheck %s --check-prefix=CHECK_CD
1111
! RUN: not %flang_fc1 %s -fno-color-diagnostics 2>&1 \
12-
! RUN: | FileCheck %s --check-prefix=UNSUPPORTED_OPTION
12+
! RUN: | FileCheck %s --check-prefix=UNSUPPORTED_COLOR_DIAGS
13+
14+
! RUN: not %flang %s -fdiagnostics-color 2>&1 \
15+
! RUN: | FileCheck %s --check-prefix=CHECK_CD
16+
! RUN: not %flang %s -fno-diagnostics-color 2>&1 \
17+
! RUN: | FileCheck %s --check-prefix=CHECK_NCD
18+
! RUN: not %flang_fc1 %s -fdiagnostics-color 2>&1 \
19+
! RUN: | FileCheck %s --check-prefix=UNSUPPORTED_DIAGS_COLOR
20+
! RUN: not %flang_fc1 %s -fno-diagnostics-color 2>&1 \
21+
! RUN: | FileCheck %s --check-prefix=UNSUPPORTED_NO_DIAGS_COLOR
22+
23+
! RUN: not %flang %s -fdiagnostics-color=always 2>&1 \
24+
! RUN: | FileCheck %s --check-prefix=CHECK_CD
25+
! RUN: not %flang %s -fdiagnostics-color=never 2>&1 \
26+
! RUN: | FileCheck %s --check-prefix=CHECK_NCD
27+
1328
! RUN: not %flang_fc1 %s 2>&1 | FileCheck %s --check-prefix=CHECK_NCD
1429

1530
! CHECK_CD: {{.*}}[0;1;31merror: {{.*}}[0m{{.*}}[1mSemantic errors in {{.*}}color-diagnostics.f90{{.*}}[0m
1631

1732
! CHECK_NCD: Semantic errors in {{.*}}color-diagnostics.f90
1833

19-
! UNSUPPORTED_OPTION: error: unknown argument: '-fno-color-diagnostics'
34+
! UNSUPPORTED_COLOR_DIAGS: error: unknown argument: '-fno-color-diagnostics'
35+
! UNSUPPORTED_DIAGS_COLOR: error: unknown argument: '-fdiagnostics-color'
36+
! UNSUPPORTED_NO_DIAGS_COLOR: error: unknown argument: '-fno-diagnostics-color'
37+
38+
! Check that invalid values of -fdiagnostics-color= are disallowed.
39+
! RUN: not %flang %s -fdiagnostics-color=sometimes 2>&1 \
40+
! RUN: | FileCheck %s --check-prefix=DCEQ_BAD
41+
! DCEQ_BAD: error: invalid argument 'sometimes' to -fdiagnostics-color=
2042

2143
program m
2244
integer :: i = k

llvm/include/llvm/Config/llvm-config.h.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
/* Indicate that this is LLVM compiled from the amd-gfx branch. */
1818
#define LLVM_HAVE_BRANCH_AMD_GFX
19-
#define LLVM_MAIN_REVISION 513183
19+
#define LLVM_MAIN_REVISION 513194
2020

2121
/* Define if LLVM_ENABLE_DUMP is enabled */
2222
#cmakedefine LLVM_ENABLE_DUMP

llvm/include/llvm/MC/MCRegisterInfo.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ class MCRegisterInfo {
268268
friend class MCRegUnitRootIterator;
269269
friend class MCRegAliasIterator;
270270

271+
virtual ~MCRegisterInfo() {}
272+
271273
/// Initialize MCRegisterInfo, called by TableGen
272274
/// auto-generated routines. *DO NOT USE*.
273275
void InitMCRegisterInfo(const MCRegisterDesc *D, unsigned NR, unsigned RA,
@@ -418,15 +420,15 @@ class MCRegisterInfo {
418420
/// number. Returns -1 if there is no equivalent value. The second
419421
/// parameter allows targets to use different numberings for EH info and
420422
/// debugging info.
421-
int getDwarfRegNum(MCRegister RegNum, bool isEH) const;
423+
virtual int64_t getDwarfRegNum(MCRegister RegNum, bool isEH) const;
422424

423425
/// Map a dwarf register back to a target register. Returns std::nullopt if
424426
/// there is no mapping.
425-
std::optional<MCRegister> getLLVMRegNum(unsigned RegNum, bool isEH) const;
427+
std::optional<MCRegister> getLLVMRegNum(uint64_t RegNum, bool isEH) const;
426428

427429
/// Map a target EH register number to an equivalent DWARF register
428430
/// number.
429-
int getDwarfRegNumFromDwarfEHRegNum(unsigned RegNum) const;
431+
int64_t getDwarfRegNumFromDwarfEHRegNum(uint64_t RegNum) const;
430432

431433
/// Map a target register to an equivalent SEH register
432434
/// number. Returns LLVM register number if there is no equivalent value.

0 commit comments

Comments
 (0)