Skip to content

Commit c964dad

Browse files
committed
Merge remote-tracking branch 'origin/main' into vplan-induction-resume-values
2 parents e96323f + f081ffe commit c964dad

28 files changed

+529
-142
lines changed

lld/MinGW/Driver.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,9 @@ bool link(ArrayRef<const char *> argsArr, llvm::raw_ostream &stdoutOS,
407407
OPT_no_allow_multiple_definition, false))
408408
add("-force:multiple");
409409

410+
if (auto *a = args.getLastArg(OPT_dependent_load_flag))
411+
add("-dependentloadflag:" + StringRef(a->getValue()));
412+
410413
if (auto *a = args.getLastArg(OPT_icf)) {
411414
StringRef s = a->getValue();
412415
if (s == "all")

lld/MinGW/Options.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ def _HASH_HASH_HASH : Flag<["-"], "###">,
202202
HelpText<"Print (but do not run) the commands to run for this compilation">;
203203
def appcontainer: F<"appcontainer">, HelpText<"Set the appcontainer flag in the executable">;
204204
defm delayload: Eq<"delayload", "DLL to load only on demand">;
205+
defm dependent_load_flag: EEq<"dependent-load-flag", "Override default LibraryLoad flags">;
205206
defm mllvm: EqNoHelp<"mllvm">;
206207
defm pdb: Eq<"pdb", "Output PDB debug info file, chosen implicitly if the argument is empty">;
207208
defm Xlink : Eq<"Xlink", "Pass <arg> to the COFF linker">, MetaVarName<"<arg>">;

lld/test/MinGW/driver.test

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,3 +462,6 @@ RUN: ld.lld -### foo.o -m i386pep --rpath foo 2>&1 | FileCheck -check-prefix=WAR
462462
RUN: ld.lld -### foo.o -m i386pep -rpath=foo 2>&1 | FileCheck -check-prefix=WARN_RPATH %s
463463
RUN: ld.lld -### foo.o -m i386pep --rpath=foo 2>&1 | FileCheck -check-prefix=WARN_RPATH %s
464464
WARN_RPATH: warning: parameter -{{-?}}rpath has no effect on PE/COFF targets
465+
466+
RUN: ld.lld -### foo.o -m i386pe --dependent-load-flag=0x800 2>&1 | FileCheck -check-prefix=DEPENDENT_LOAD_FLAG %s
467+
DEPENDENT_LOAD_FLAG: -dependentloadflag:0x800

llvm/cmake/modules/CheckCompilerVersion.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ set(APPLECLANG_MIN 10.0)
1212
set(APPLECLANG_SOFT_ERROR 10.0)
1313

1414
# https://en.wikipedia.org/wiki/Microsoft_Visual_C#Internal_version_numbering
15-
# _MSC_VER == 1927 MSVC++ 14.27 Visual Studio 2019 Version 16.7
16-
set(MSVC_MIN 19.27)
17-
set(MSVC_SOFT_ERROR 19.27)
15+
# _MSC_VER == 1928 MSVC++ 19.27 Visual Studio 2019 Version 16.8 + 16.9
16+
set(MSVC_MIN 19.28)
17+
set(MSVC_SOFT_ERROR 19.28)
1818

1919
set(LIBSTDCXX_MIN 7)
2020
set(LIBSTDCXX_SOFT_ERROR 7)

llvm/docs/GettingStarted.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ popular host toolchains for specific minimum versions in our build systems:
356356
* Clang 5.0
357357
* Apple Clang 10.0
358358
* GCC 7.4
359-
* Visual Studio 2019 16.7
359+
* Visual Studio 2019 16.8
360360

361361
Anything older than these toolchains *may* work, but will require forcing the
362362
build system with a special option and is not really a supported host platform.

llvm/docs/ReleaseNotes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ Changes to LLVM infrastructure
113113
Changes to building LLVM
114114
------------------------
115115

116+
* Raised the minimum MSVC version to Visual Studio 2019 16.8.
117+
116118
Changes to TableGen
117119
-------------------
118120

llvm/include/llvm/Analysis/ScalarEvolution.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,6 +1780,10 @@ class ScalarEvolution {
17801780
/// V.
17811781
const SCEV *getOperandsToCreate(Value *V, SmallVectorImpl<Value *> &Ops);
17821782

1783+
/// Returns SCEV for the first operand of a phi if all phi operands have
1784+
/// identical opcodes and operands.
1785+
const SCEV *createNodeForPHIWithIdenticalOperands(PHINode *PN);
1786+
17831787
/// Provide the special handling we need to analyze PHI SCEVs.
17841788
const SCEV *createNodeForPHI(PHINode *PN);
17851789

llvm/include/llvm/Transforms/Utils/FunctionComparator.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ class FunctionComparator {
317317
int cmpNumbers(uint64_t L, uint64_t R) const;
318318
int cmpAligns(Align L, Align R) const;
319319
int cmpAPInts(const APInt &L, const APInt &R) const;
320+
int cmpConstantRanges(const ConstantRange &L, const ConstantRange &R) const;
320321
int cmpAPFloats(const APFloat &L, const APFloat &R) const;
321322
int cmpMem(StringRef L, StringRef R) const;
322323

llvm/lib/Analysis/ScalarEvolution.cpp

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6019,6 +6019,42 @@ const SCEV *ScalarEvolution::createNodeFromSelectLikePHI(PHINode *PN) {
60196019
return nullptr;
60206020
}
60216021

6022+
/// Returns SCEV for the first operand of a phi if all phi operands have
6023+
/// identical opcodes and operands
6024+
/// eg.
6025+
/// a: %add = %a + %b
6026+
/// br %c
6027+
/// b: %add1 = %a + %b
6028+
/// br %c
6029+
/// c: %phi = phi [%add, a], [%add1, b]
6030+
/// scev(%phi) => scev(%add)
6031+
const SCEV *
6032+
ScalarEvolution::createNodeForPHIWithIdenticalOperands(PHINode *PN) {
6033+
BinaryOperator *CommonInst = nullptr;
6034+
// Check if instructions are identical.
6035+
for (Value *Incoming : PN->incoming_values()) {
6036+
auto *IncomingInst = dyn_cast<BinaryOperator>(Incoming);
6037+
if (!IncomingInst)
6038+
return nullptr;
6039+
if (CommonInst) {
6040+
if (!CommonInst->isIdenticalToWhenDefined(IncomingInst))
6041+
return nullptr; // Not identical, give up
6042+
} else {
6043+
// Remember binary operator
6044+
CommonInst = IncomingInst;
6045+
}
6046+
}
6047+
if (!CommonInst)
6048+
return nullptr;
6049+
6050+
// Check if SCEV exprs for instructions are identical.
6051+
const SCEV *CommonSCEV = getSCEV(CommonInst);
6052+
bool SCEVExprsIdentical =
6053+
all_of(drop_begin(PN->incoming_values()),
6054+
[this, CommonSCEV](Value *V) { return CommonSCEV == getSCEV(V); });
6055+
return SCEVExprsIdentical ? CommonSCEV : nullptr;
6056+
}
6057+
60226058
const SCEV *ScalarEvolution::createNodeForPHI(PHINode *PN) {
60236059
if (const SCEV *S = createAddRecFromPHI(PN))
60246060
return S;
@@ -6030,6 +6066,9 @@ const SCEV *ScalarEvolution::createNodeForPHI(PHINode *PN) {
60306066
/*UseInstrInfo=*/true, /*CanUseUndef=*/false}))
60316067
return getSCEV(V);
60326068

6069+
if (const SCEV *S = createNodeForPHIWithIdenticalOperands(PN))
6070+
return S;
6071+
60336072
if (const SCEV *S = createNodeFromSelectLikePHI(PN))
60346073
return S;
60356074

llvm/lib/CodeGen/GCMetadata.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ GCFunctionAnalysis::run(Function &F, FunctionAnalysisManager &FAM) {
6666
}
6767

6868
INITIALIZE_PASS(GCModuleInfo, "collector-metadata",
69-
"Create Garbage Collector Module Metadata", false, false)
69+
"Create Garbage Collector Module Metadata", false, true)
7070

7171
// -----------------------------------------------------------------------------
7272

0 commit comments

Comments
 (0)