Skip to content

Commit 0c4fe60

Browse files
committed
merge main into amd-staging
Change-Id: I1d78f8a2605aa4774a39e5be9743c58350d61c43
2 parents d168d7f + 66424b1 commit 0c4fe60

File tree

115 files changed

+11414
-11808
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+11414
-11808
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,6 @@ Bug Fixes to C++ Support
828828
- Fixed an assertion failure caused by mangled names with invalid identifiers. (#GH112205)
829829
- Fixed an incorrect lambda scope of generic lambdas that caused Clang to crash when computing potential lambda
830830
captures at the end of a full expression. (#GH115931)
831-
- Clang no longer rejects deleting a pointer of incomplete enumeration type. (#GH99278)
832831

833832
Bug Fixes to AST Handling
834833
^^^^^^^^^^^^^^^^^^^^^^^^^

clang/docs/UsersManual.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,6 +1059,16 @@ In this way, the user may only need to specify a root configuration file with
10591059
-L <CFGDIR>/lib
10601060
-T <CFGDIR>/ldscripts/link.ld
10611061

1062+
Usually, config file options are placed before command-line options, regardless
1063+
of the actual operation to be performed. The exception is being made for the
1064+
options prefixed with the ``$`` character. These will be used only when linker
1065+
is being invoked, and added after all of the command-line specified linker
1066+
inputs. Here is some example of ``$``-prefixed options:
1067+
1068+
::
1069+
$-Wl,-Bstatic $-lm
1070+
$-Wl,-Bshared
1071+
10621072
Language and Target-Independent Features
10631073
========================================
10641074

clang/include/clang/Driver/Driver.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,11 @@ class Driver {
300300
/// Object that stores strings read from configuration file.
301301
llvm::StringSaver Saver;
302302

303-
/// Arguments originated from configuration file.
304-
std::unique_ptr<llvm::opt::InputArgList> CfgOptions;
303+
/// Arguments originated from configuration file (head part).
304+
std::unique_ptr<llvm::opt::InputArgList> CfgOptionsHead;
305+
306+
/// Arguments originated from configuration file (tail part).
307+
std::unique_ptr<llvm::opt::InputArgList> CfgOptionsTail;
305308

306309
/// Arguments originated from command line.
307310
std::unique_ptr<llvm::opt::InputArgList> CLOptions;

clang/lib/Driver/Driver.cpp

Lines changed: 49 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,34 +1042,59 @@ bool Driver::readConfigFile(StringRef FileName,
10421042
}
10431043

10441044
// Try reading the given file.
1045-
SmallVector<const char *, 32> NewCfgArgs;
1046-
if (llvm::Error Err = ExpCtx.readConfigFile(FileName, NewCfgArgs)) {
1045+
SmallVector<const char *, 32> NewCfgFileArgs;
1046+
if (llvm::Error Err = ExpCtx.readConfigFile(FileName, NewCfgFileArgs)) {
10471047
Diag(diag::err_drv_cannot_read_config_file)
10481048
<< FileName << toString(std::move(Err));
10491049
return true;
10501050
}
10511051

1052+
// Populate head and tail lists. The tail list is used only when linking.
1053+
SmallVector<const char *, 32> NewCfgHeadArgs, NewCfgTailArgs;
1054+
for (const char *Opt : NewCfgFileArgs) {
1055+
// An $-prefixed option should go to the tail list.
1056+
if (Opt[0] == '$' && Opt[1])
1057+
NewCfgTailArgs.push_back(Opt + 1);
1058+
else
1059+
NewCfgHeadArgs.push_back(Opt);
1060+
}
1061+
10521062
// Read options from config file.
10531063
llvm::SmallString<128> CfgFileName(FileName);
10541064
llvm::sys::path::native(CfgFileName);
1055-
bool ContainErrors;
1056-
auto NewOptions = std::make_unique<InputArgList>(
1057-
ParseArgStrings(NewCfgArgs, /*UseDriverMode=*/true, ContainErrors));
1065+
bool ContainErrors = false;
1066+
auto NewHeadOptions = std::make_unique<InputArgList>(
1067+
ParseArgStrings(NewCfgHeadArgs, /*UseDriverMode=*/true, ContainErrors));
1068+
if (ContainErrors)
1069+
return true;
1070+
auto NewTailOptions = std::make_unique<InputArgList>(
1071+
ParseArgStrings(NewCfgTailArgs, /*UseDriverMode=*/true, ContainErrors));
10581072
if (ContainErrors)
10591073
return true;
10601074

10611075
// Claim all arguments that come from a configuration file so that the driver
10621076
// does not warn on any that is unused.
1063-
for (Arg *A : *NewOptions)
1077+
for (Arg *A : *NewHeadOptions)
10641078
A->claim();
1079+
for (Arg *A : *NewTailOptions)
1080+
A->claim();
1081+
1082+
if (!CfgOptionsHead)
1083+
CfgOptionsHead = std::move(NewHeadOptions);
1084+
else {
1085+
// If this is a subsequent config file, append options to the previous one.
1086+
for (auto *Opt : *NewHeadOptions)
1087+
appendOneArg(*CfgOptionsHead, Opt);
1088+
}
10651089

1066-
if (!CfgOptions)
1067-
CfgOptions = std::move(NewOptions);
1090+
if (!CfgOptionsTail)
1091+
CfgOptionsTail = std::move(NewTailOptions);
10681092
else {
10691093
// If this is a subsequent config file, append options to the previous one.
1070-
for (auto *Opt : *NewOptions)
1071-
appendOneArg(*CfgOptions, Opt);
1094+
for (auto *Opt : *NewTailOptions)
1095+
appendOneArg(*CfgOptionsTail, Opt);
10721096
}
1097+
10731098
ConfigFiles.push_back(std::string(CfgFileName));
10741099
return false;
10751100
}
@@ -1100,20 +1125,6 @@ bool Driver::loadConfigFiles() {
11001125
UserConfigDir = static_cast<std::string>(CfgDir);
11011126
}
11021127
}
1103-
1104-
// First try to find config file specified in command line.
1105-
if (CLOptions) {
1106-
std::vector<std::string> ConfigFiles =
1107-
CLOptions->getAllArgValues(options::OPT_config);
1108-
if (ConfigFiles.size() > 1) {
1109-
if (!llvm::all_of(ConfigFiles, [ConfigFiles](const std::string &s) {
1110-
return s == ConfigFiles[0];
1111-
})) {
1112-
Diag(diag::err_drv_duplicate_config);
1113-
return true;
1114-
}
1115-
}
1116-
}
11171128
// Prepare list of directories where config file is searched for.
11181129
StringRef CfgFileSearchDirs[] = {UserConfigDir, SystemConfigDir, Dir};
11191130
ExpCtx.setSearchDirs(CfgFileSearchDirs);
@@ -1259,13 +1270,14 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
12591270
// Try parsing configuration file.
12601271
if (!ContainsError)
12611272
ContainsError = loadConfigFiles();
1262-
bool HasConfigFile = !ContainsError && (CfgOptions.get() != nullptr);
1273+
bool HasConfigFileHead = !ContainsError && CfgOptionsHead;
1274+
bool HasConfigFileTail = !ContainsError && CfgOptionsTail;
12631275

12641276
// All arguments, from both config file and command line.
1265-
InputArgList Args = std::move(HasConfigFile ? std::move(*CfgOptions)
1266-
: std::move(*CLOptions));
1277+
InputArgList Args =
1278+
HasConfigFileHead ? std::move(*CfgOptionsHead) : std::move(*CLOptions);
12671279

1268-
if (HasConfigFile)
1280+
if (HasConfigFileHead)
12691281
for (auto *Opt : *CLOptions)
12701282
if (!Opt->getOption().matches(options::OPT_config))
12711283
appendOneArg(Args, Opt);
@@ -1563,6 +1575,15 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
15631575
// Construct the list of inputs.
15641576
InputList Inputs;
15651577
BuildInputs(C->getDefaultToolChain(), *TranslatedArgs, Inputs);
1578+
if (HasConfigFileTail && Inputs.size()) {
1579+
Arg *FinalPhaseArg;
1580+
if (getFinalPhase(*TranslatedArgs, &FinalPhaseArg) == phases::Link) {
1581+
DerivedArgList TranslatedLinkerIns(*CfgOptionsTail);
1582+
for (Arg *A : *CfgOptionsTail)
1583+
TranslatedLinkerIns.append(A);
1584+
BuildInputs(C->getDefaultToolChain(), TranslatedLinkerIns, Inputs);
1585+
}
1586+
}
15661587

15671588
// Populate the tool chains for the offloading devices, if any.
15681589
CreateOffloadingDeviceToolChains(*C, Inputs);

clang/lib/Format/CMakeLists.txt

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,31 +41,33 @@ file(GLOB_RECURSE files
4141

4242
set(check_format_depends)
4343
set(i 0)
44-
foreach (file IN LISTS files)
45-
add_custom_command(OUTPUT clang-format-check-format${i}
44+
foreach(file IN LISTS files)
45+
add_custom_command(OUTPUT check_format_depend_${i}
4646
COMMAND clang-format ${file} | diff -u ${file} -
4747
VERBATIM
48-
COMMENT "Checking format of ${file}..."
48+
COMMENT "Checking format of ${file}"
4949
)
50-
list(APPEND check_format_depends clang-format-check-format${i})
50+
list(APPEND check_format_depends check_format_depend_${i})
5151

5252
math(EXPR i ${i}+1)
53-
endforeach ()
53+
endforeach()
5454

5555
add_custom_target(clang-format-check-format DEPENDS ${check_format_depends})
5656

57-
if(CLANG_INCLUDE_DOCS)
58-
set(style_options_depends ${CMAKE_CURRENT_BINARY_DIR}/dummy_output)
59-
set(docs_tools_dir ${CLANG_SOURCE_DIR}/docs/tools)
60-
add_custom_command(OUTPUT ${style_options_depends}
61-
COMMAND ${Python3_EXECUTABLE} dump_format_style.py &&
62-
touch ${style_options_depends}
63-
WORKING_DIRECTORY ${docs_tools_dir}
64-
DEPENDS ${CLANG_SOURCE_DIR}/include/clang/Format/Format.h
65-
${CLANG_SOURCE_DIR}/include/clang/Tooling/Inclusions/IncludeStyle.h
66-
${CLANG_SOURCE_DIR}/docs/ClangFormatStyleOptions.rst
67-
${docs_tools_dir}/plurals.txt
68-
${docs_tools_dir}/dump_format_style.py
69-
)
70-
add_custom_target(clang-format-style-options DEPENDS ${style_options_depends})
71-
endif()
57+
set(style_options_depends ${CMAKE_CURRENT_BINARY_DIR}/dummy_output)
58+
set(docs_tools_dir ${CLANG_SOURCE_DIR}/docs/tools)
59+
set(style_options_rst ${CLANG_SOURCE_DIR}/docs/ClangFormatStyleOptions.rst)
60+
add_custom_command(OUTPUT ${style_options_depends}
61+
COMMAND ${Python3_EXECUTABLE} dump_format_style.py &&
62+
touch ${style_options_depends}
63+
WORKING_DIRECTORY ${docs_tools_dir}
64+
VERBATIM
65+
COMMENT "Updating ${style_options_rst}"
66+
DEPENDS ${CLANG_SOURCE_DIR}/include/clang/Format/Format.h
67+
${CLANG_SOURCE_DIR}/include/clang/Tooling/Inclusions/IncludeStyle.h
68+
${style_options_rst}
69+
${docs_tools_dir}/plurals.txt
70+
${docs_tools_dir}/dump_format_style.py
71+
)
72+
73+
add_custom_target(clang-format-style-options DEPENDS ${style_options_depends})

clang/lib/Sema/SemaExprCXX.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3747,8 +3747,7 @@ Sema::ActOnCXXDelete(SourceLocation StartLoc, bool UseGlobal,
37473747
} else if (!Pointee->isDependentType()) {
37483748
// FIXME: This can result in errors if the definition was imported from a
37493749
// module but is hidden.
3750-
if (!Pointee->isStructureOrClassType() ||
3751-
!RequireCompleteType(StartLoc, Pointee,
3750+
if (!RequireCompleteType(StartLoc, Pointee,
37523751
LangOpts.CPlusPlus26
37533752
? diag::err_delete_incomplete
37543753
: diag::warn_delete_incomplete,

clang/test/Driver/Inputs/config-l.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-Wall $-lm
2+
-Wl,--as-needed $-Wl,-Bstatic
3+
$-lhappy $-Wl,-Bdynamic

clang/test/Driver/config-file-errs.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
//--- No more than one '--config' may be specified.
2-
//
3-
// RUN: not %clang --config 1.cfg --config 2.cfg 2>&1 | FileCheck %s -check-prefix CHECK-DUPLICATE
4-
// CHECK-DUPLICATE: no more than one option '--config' is allowed
5-
6-
71
//--- '--config' must be followed by config file name.
82
//
93
// RUN: not %clang --config 2>&1 | FileCheck %s -check-prefix CHECK-MISSING-FILE
@@ -12,8 +6,13 @@
126

137
//--- Argument of '--config' must be existing file, if it is specified by path.
148
//
15-
// RUN: not %clang --config somewhere/nonexistent-config-file 2>&1 | FileCheck %s -check-prefix CHECK-NONEXISTENT
16-
// CHECK-NONEXISTENT: configuration file '{{.*}}somewhere{{.}}nonexistent-config-file' cannot be opened: {{[Nn]}}o such file or directory
9+
// RUN: not %clang --config somewhere/nonexistent-config-file 2>&1 | FileCheck -DMSG=%errc_ENOENT %s -check-prefix CHECK-NONEXISTENT
10+
// CHECK-NONEXISTENT: configuration file '{{.*}}somewhere{{.}}nonexistent-config-file' cannot be opened: [[MSG]]
11+
12+
13+
//--- All '--config' arguments must be existing files.
14+
//
15+
// RUN: not %clang --config %S/Inputs/config-4.cfg --config somewhere/nonexistent-config-file 2>&1 | FileCheck -DMSG=%errc_ENOENT %s -check-prefix CHECK-NONEXISTENT
1716

1817

1918
//--- Argument of '--config' must exist somewhere in well-known directories, if it is specified by bare name.

clang/test/Driver/config-file.c

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,36 @@
7575
// CHECK-PRECEDENCE: -Wall
7676

7777

78-
//--- Duplicate --config options are allowed if the value is the same
79-
// RUN: %clang --config-system-dir=%S/Inputs/config --config-user-dir=%S/Inputs/config2 --config config-4.cfg --config config-4.cfg -S %s -o /dev/null -v 2>&1 | FileCheck %s -check-prefix CHECK-SAME-CONFIG
80-
// CHECK-SAME-CONFIG: Configuration file: {{.*}}Inputs{{.}}config2{{.}}config-4.cfg
78+
//--- Multiple configuration files can be specified.
79+
// RUN: %clang --config-system-dir=%S/Inputs/config --config-user-dir= --config config-4.cfg --config %S/Inputs/config2/config-4.cfg -S %s -o /dev/null -v 2>&1 | FileCheck %s -check-prefix CHECK-TWO-CONFIGS
80+
// CHECK-TWO-CONFIGS: Configuration file: {{.*}}Inputs{{.}}config{{.}}config-4.cfg
81+
// CHECK-TWO-CONFIGS-NEXT: Configuration file: {{.*}}Inputs{{.}}config2{{.}}config-4.cfg
82+
// CHECK-TWO-CONFIGS: -isysroot
83+
// CHECK-TWO-CONFIGS-SAME: /opt/data
84+
// CHECK-TWO-CONFIGS-SAME: -Wall
85+
86+
//--- The linker input flags should be moved to the end of input list and appear only when linking.
87+
// RUN: %clang --target=aarch64-unknown-linux-gnu --config %S/Inputs/config-l.cfg %s -lmylib -Wl,foo.a -### 2>&1 | FileCheck %s -check-prefix CHECK-LINKING
88+
// RUN: %clang --target=aarch64-unknown-linux-gnu --config %S/Inputs/config-l.cfg -fopenmp %s -lmylib -Wl,foo.a -### 2>&1 | FileCheck %s -check-prefix CHECK-LINKING-LIBOMP-GOES-AFTER
89+
// RUN: %clang --target=aarch64-unknown-linux-gnu --config %S/Inputs/config-l.cfg -S %s -### 2>&1 | FileCheck %s -check-prefix CHECK-NOLINKING
90+
// RUN: %clang --target=aarch64-unknown-linux-gnu --config %S/Inputs/config-l.cfg -fopenmp -S %s -### 2>&1 | FileCheck %s -check-prefix CHECK-NOLINKING-OPENMP
91+
// RUN: %clang --target=x86_64-pc-windows-msvc --config %S/Inputs/config-l.cfg %s -lmylib -Wl,foo.lib -### 2>&1 | FileCheck %s -check-prefix CHECK-LINKING-MSVC
92+
// RUN: %clang --target=x86_64-pc-windows-msvc --config %S/Inputs/config-l.cfg -S %s -### 2>&1 | FileCheck %s -check-prefix CHECK-NOLINKING-MSVC
93+
// CHECK-LINKING: Configuration file: {{.*}}Inputs{{.}}config-l.cfg
94+
// CHECK-LINKING: "-Wall"
95+
// CHECK-LINKING: "--as-needed" "{{.*}}-{{.*}}.o" "-lmylib" "foo.a" "-lm" "-Bstatic" "-lhappy" "-Bdynamic"
96+
// CHECK-LINKING-LIBOMP-GOES-AFTER: Configuration file: {{.*}}Inputs{{.}}config-l.cfg
97+
// CHECK-LINKING-LIBOMP-GOES-AFTER: "-Wall" {{.*}}"-fopenmp"
98+
// CHECK-LINKING-LIBOMP-GOES-AFTER: "--as-needed" "{{.*}}-{{.*}}.o" "-lmylib" "foo.a" "-lm" "-Bstatic" "-lhappy" "-Bdynamic" {{.*}}"-lomp"
99+
// CHECK-NOLINKING: Configuration file: {{.*}}Inputs{{.}}config-l.cfg
100+
// CHECK-NOLINKING: "-Wall"
101+
// CHECK-NOLINKING-NO: "-lm" "-Bstatic" "-lhappy" "-Bdynamic"
102+
// CHECK-NOLINKING-OPENMP: Configuration file: {{.*}}Inputs{{.}}config-l.cfg
103+
// CHECK-NOLINKING-OPENMP: "-Wall" {{.*}}"-fopenmp"
104+
// CHECK-NOLINKING-OPENMP-NO: "-lm" "-Bstatic" "-lhappy" "-Bdynamic" {{.*}}"-lomp"
105+
// CHECK-LINKING-MSVC: Configuration file: {{.*}}Inputs{{.}}config-l.cfg
106+
// CHECK-LINKING-MSVC: "-Wall"
107+
// CHECK-LINKING-MSVC: "--as-needed" "{{.*}}-{{.*}}.o" "mylib.lib" "foo.lib" "m.lib" "-Bstatic" "happy.lib" "-Bdynamic"
108+
// CHECK-NOLINKING-MSVC: Configuration file: {{.*}}Inputs{{.}}config-l.cfg
109+
// CHECK-NOLINKING-MSVC: "-Wall"
110+
// CHECK-NOLINKING-MSVC-NO: "m.lib" "-Bstatic" "happy.lib" "-Bdynamic"

clang/test/SemaCXX/new-delete.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -540,13 +540,6 @@ namespace PR10504 {
540540
void f(A *x) { delete x; } // expected-warning {{delete called on 'PR10504::A' that is abstract but has non-virtual destructor}}
541541
}
542542

543-
#if __cplusplus >= 201103L
544-
enum GH99278_1 {
545-
zero = decltype(delete static_cast<GH99278_1*>(nullptr), 0){}
546-
// expected-warning@-1 {{expression with side effects has no effect in an unevaluated context}}
547-
};
548-
#endif
549-
550543
struct PlacementArg {};
551544
inline void *operator new[](size_t, const PlacementArg &) throw () {
552545
return 0;

flang/test/Driver/Inputs/config-l.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-ffast-math $-lm
2+
-Wl,--as-needed $-Wl,-Bstatic
3+
$-lhappy $-Wl,-Bdynamic

flang/test/Driver/config-file.f90

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,29 @@
6161
! CHECK-TWO-CONFIGS-NEXT: Configuration file: {{.*}}Inputs{{.}}config2{{.}}config-4.cfg
6262
! CHECK-TWO-CONFIGS: -ffp-contract=fast
6363
! CHECK-TWO-CONFIGS: -O3
64+
65+
!--- The linker input flags should be moved to the end of input list and appear only when linking.
66+
! RUN: %flang --target=aarch64-unknown-linux-gnu --config %S/Inputs/config-l.cfg %s -lmylib -Wl,foo.a -### 2>&1 | FileCheck %s -check-prefix CHECK-LINKING
67+
! RUN: %flang --target=aarch64-unknown-linux-gnu --config %S/Inputs/config-l.cfg -fopenmp %s -lmylib -Wl,foo.a -### 2>&1 | FileCheck %s -check-prefix CHECK-LINKING-LIBOMP-GOES-AFTER
68+
! RUN: %flang --target=aarch64-unknown-linux-gnu --config %S/Inputs/config-l.cfg -S %s -### 2>&1 | FileCheck %s -check-prefix CHECK-NOLINKING
69+
! RUN: %flang --target=aarch64-unknown-linux-gnu --config %S/Inputs/config-l.cfg -fopenmp -S %s -### 2>&1 | FileCheck %s -check-prefix CHECK-NOLINKING-OPENMP
70+
! RUN: %flang --target=x86_64-pc-windows-msvc --config %S/Inputs/config-l.cfg %s -lmylib -Wl,foo.lib -### 2>&1 | FileCheck %s -check-prefix CHECK-LINKING-MSVC
71+
! RUN: %flang --target=x86_64-pc-windows-msvc --config %S/Inputs/config-l.cfg -S %s -### 2>&1 | FileCheck %s -check-prefix CHECK-NOLINKING-MSVC
72+
! CHECK-LINKING: Configuration file: {{.*}}Inputs{{.}}config-l.cfg
73+
! CHECK-LINKING: "-ffast-math"
74+
! CHECK-LINKING: "--as-needed" "{{.*}}-{{.*}}.o" "-lmylib" "foo.a" "-lm" "-Bstatic" "-lhappy" "-Bdynamic"
75+
! CHECK-LINKING-LIBOMP-GOES-AFTER: Configuration file: {{.*}}Inputs{{.}}config-l.cfg
76+
! CHECK-LINKING-LIBOMP-GOES-AFTER: "-ffast-math" {{.*}}"-fopenmp"
77+
! CHECK-LINKING-LIBOMP-GOES-AFTER: "--as-needed" "{{.*}}-{{.*}}.o" "-lmylib" "foo.a" "-lm" "-Bstatic" "-lhappy" "-Bdynamic" {{.*}}"-lomp"
78+
! CHECK-NOLINKING: Configuration file: {{.*}}Inputs{{.}}config-l.cfg
79+
! CHECK-NOLINKING: "-ffast-math"
80+
! CHECK-NOLINKING-NO: "-lm" "-Bstatic" "-lhappy" "-Bdynamic"
81+
! CHECK-NOLINKING-OPENMP: Configuration file: {{.*}}Inputs{{.}}config-l.cfg
82+
! CHECK-NOLINKING-OPENMP: "-ffast-math" {{.*}}"-fopenmp"
83+
! CHECK-NOLINKING-OPENMP-NO: "-lm" "-Bstatic" "-lhappy" "-Bdynamic" {{.}}"-lomp"
84+
! CHECK-LINKING-MSVC: Configuration file: {{.*}}Inputs{{.}}config-l.cfg
85+
! CHECK-LINKING-MSVC: "-ffast-math"
86+
! CHECK-LINKING-MSVC: "--as-needed" "{{.*}}-{{.*}}.o" "mylib.lib" "foo.lib" "m.lib" "-Bstatic" "happy.lib" "-Bdynamic"
87+
! CHECK-NOLINKING-MSVC: Configuration file: {{.*}}Inputs{{.}}config-l.cfg
88+
! CHECK-NOLINKING-MSVC: "-ffast-math"
89+
! CHECK-NOLINKING-MSVC-NO: "m.lib" "-Bstatic" "happy.lib" "-Bdynamic"

llvm/include/llvm/IR/RuntimeLibcalls.def

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,22 +307,22 @@ HANDLE_LIBCALL(FMAX_PPCF128, "fmaxl")
307307
HANDLE_LIBCALL(FMINIMUM_F32, "fminimumf")
308308
HANDLE_LIBCALL(FMINIMUM_F64, "fminimum")
309309
HANDLE_LIBCALL(FMINIMUM_F80, "fminimuml")
310-
HANDLE_LIBCALL(FMINIMUM_F128, "fminmuml")
310+
HANDLE_LIBCALL(FMINIMUM_F128, "fminimuml")
311311
HANDLE_LIBCALL(FMINIMUM_PPCF128, "fminimuml")
312312
HANDLE_LIBCALL(FMAXIMUM_F32, "fmaximumf")
313313
HANDLE_LIBCALL(FMAXIMUM_F64, "fmaximum")
314314
HANDLE_LIBCALL(FMAXIMUM_F80, "fmaximuml")
315-
HANDLE_LIBCALL(FMAXIMUM_F128, "fmaxmuml")
315+
HANDLE_LIBCALL(FMAXIMUM_F128, "fmaximuml")
316316
HANDLE_LIBCALL(FMAXIMUM_PPCF128, "fmaximum_numl")
317317
HANDLE_LIBCALL(FMINIMUMNUM_F32, "fminimum_numf")
318318
HANDLE_LIBCALL(FMINIMUMNUM_F64, "fminimum_num")
319319
HANDLE_LIBCALL(FMINIMUMNUM_F80, "fminimum_numl")
320-
HANDLE_LIBCALL(FMINIMUMNUM_F128, "fminmum_numl")
320+
HANDLE_LIBCALL(FMINIMUMNUM_F128, "fminimum_numl")
321321
HANDLE_LIBCALL(FMINIMUMNUM_PPCF128, "fminimum_numl")
322322
HANDLE_LIBCALL(FMAXIMUMNUM_F32, "fmaximum_numf")
323323
HANDLE_LIBCALL(FMAXIMUMNUM_F64, "fmaximum_num")
324324
HANDLE_LIBCALL(FMAXIMUMNUM_F80, "fmaximum_numl")
325-
HANDLE_LIBCALL(FMAXIMUMNUM_F128, "fmaxmum_numl")
325+
HANDLE_LIBCALL(FMAXIMUMNUM_F128, "fmaximum_numl")
326326
HANDLE_LIBCALL(FMAXIMUMNUM_PPCF128, "fmaximum_numl")
327327
HANDLE_LIBCALL(LROUND_F32, "lroundf")
328328
HANDLE_LIBCALL(LROUND_F64, "lround")

llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,8 @@ void GISelKnownBits::computeKnownBitsImpl(Register R, KnownBits &Known,
252252
MRI.getType(SrcReg).isValid()) {
253253
// For COPYs we don't do anything, don't increase the depth.
254254
computeKnownBitsImpl(SrcReg, Known2, DemandedElts,
255-
Depth + (Opcode != TargetOpcode::COPY));
255+
Depth + (Opcode != TargetOpcode::COPY));
256+
Known2 = Known2.anyextOrTrunc(BitWidth);
256257
Known = Known.intersectWith(Known2);
257258
// If we reach a point where we don't know anything
258259
// just stop looking through the operands.

0 commit comments

Comments
 (0)