Skip to content

Commit

Permalink
Merged master:05e3ab41e418 into amd-gfx:a06305b415c2
Browse files Browse the repository at this point in the history
Local branch amd-gfx a06305b Merged master:6dbf0cfcf789 into amd-gfx:873eb5d3a8f7
Remote branch master 05e3ab4 [MSAN] Avoid dangling ActualFnStart when replacing instruction
  • Loading branch information
Sw authored and Sw committed Aug 14, 2020
2 parents a06305b + 05e3ab4 commit bd3fdd8
Show file tree
Hide file tree
Showing 112 changed files with 588 additions and 398 deletions.
14 changes: 14 additions & 0 deletions clang/test/CodeGen/O0-no-skipped-passes.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Test that no passes are skipped under -O0/NPM
//
// RUN: %clang_cc1 -triple x86_64-linux-gnu -mllvm -enable-npm-optnone -O0 -fexperimental-new-pass-manager %s -fdebug-pass-manager -emit-llvm -o /dev/null 2>&1 | FileCheck %s
// RUN: %clang_cc1 -triple x86_64-linux-gnu -mllvm -enable-npm-optnone -O0 -fexperimental-new-pass-manager %s -fdebug-pass-manager -emit-llvm -o /dev/null -fcoroutines-ts 2>&1 | FileCheck %s
// RUN: %clang_cc1 -triple x86_64-linux-gnu -mllvm -enable-npm-optnone -O0 -fexperimental-new-pass-manager %s -fdebug-pass-manager -emit-llvm -o /dev/null -fsanitize=address 2>&1 | FileCheck %s
// RUN: %clang_cc1 -triple x86_64-linux-gnu -mllvm -enable-npm-optnone -O0 -fexperimental-new-pass-manager %s -fdebug-pass-manager -emit-llvm -o /dev/null -fsanitize=hwaddress 2>&1 | FileCheck %s
// RUN: %clang_cc1 -triple x86_64-linux-gnu -mllvm -enable-npm-optnone -O0 -fexperimental-new-pass-manager %s -fdebug-pass-manager -emit-llvm -o /dev/null -fsanitize=memory 2>&1 | FileCheck %s
// RUN: %clang_cc1 -triple x86_64-linux-gnu -mllvm -enable-npm-optnone -O0 -fexperimental-new-pass-manager %s -fdebug-pass-manager -emit-llvm -o /dev/null -fsanitize=thread 2>&1 | FileCheck %s
// RUN: %clang_cc1 -triple x86_64-linux-gnu -mllvm -enable-npm-optnone -O0 -fexperimental-new-pass-manager %s -fdebug-pass-manager -emit-llvm -o /dev/null -fsanitize=local-bounds 2>&1 | FileCheck %s
// RUN: %clang_cc1 -triple x86_64-linux-gnu -mllvm -enable-npm-optnone -O0 -fexperimental-new-pass-manager %s -fdebug-pass-manager -emit-llvm -o /dev/null -fsanitize-coverage-trace-pc-guard 2>&1 | FileCheck %s

// CHECK-NOT: Skipping pass

int func(int a) { return a; }
14 changes: 7 additions & 7 deletions libcxx/include/variant
Original file line number Diff line number Diff line change
Expand Up @@ -544,12 +544,12 @@ struct __base {
constexpr size_t __size = __uncvref_t<_Vp>::__size();
static_assert(__size == __uncvref_t<_Wp>::__size());
constexpr auto __dispatch = [](auto __i) {
return +[](_Vis&& __vis, _Vp&& __v, _Wp&& __w) -> decltype(auto) {
return +[](_Vis&& __vis_, _Vp&& __v_, _Wp&& __w_) -> decltype(auto) {
constexpr size_t _Ip = decltype(__i)::value;
return __invoke_constexpr(
_VSTD::forward<_Vis>(__vis),
__access::__base::__get_alt<_Ip>(_VSTD::forward<_Vp>(__v)),
__access::__base::__get_alt<_Ip>(_VSTD::forward<_Wp>(__w)));
_VSTD::forward<_Vis>(__vis_),
__access::__base::__get_alt<_Ip>(_VSTD::forward<_Vp>(__v_)),
__access::__base::__get_alt<_Ip>(_VSTD::forward<_Wp>(__w_)));
};
};
#define _LIBCPP_VARIANT_CASE(_Ip) \
Expand Down Expand Up @@ -595,11 +595,11 @@ struct __base {
__visit_alt_impl(index_sequence<_Is...>, _Vis&& __vis, _Vs&&... __vs) {
using __multi = __multi<__uncvref_t<_Vs>::__size()...>;
constexpr auto __dispatch = [](auto... __is) {
return +[](_Vis&& __vis, _Vs&&... __vs) {
return +[](_Vis&& __vis_, _Vs&&... __vs_) {
return __invoke_constexpr(
_VSTD::forward<_Vis>(__vis),
_VSTD::forward<_Vis>(__vis_),
__access::__base::__get_alt<decltype(__is)::value>(
_VSTD::forward<_Vs>(__vs))...);
_VSTD::forward<_Vs>(__vs_))...);
};
};
#define _LIBCPP_VARIANT_CASE(_Ip) \
Expand Down
1 change: 1 addition & 0 deletions lld/ELF/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,7 @@ void LinkerDriver::createFiles(opt::InputArgList &args) {
std::vector<std::tuple<bool, bool, bool>> stack;

// Iterate over argv to process input files and positional arguments.
InputFile::isInGroup = false;
for (auto *arg : args) {
switch (arg->getOption().getID()) {
case OPT_library:
Expand Down
2 changes: 1 addition & 1 deletion lldb/test/API/functionalities/ptr_refs/TestPtrRefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ def test_ptr_refs(self):

frame = thread.GetFrameAtIndex(0)

self.runCmd("script import lldb.macosx.heap")
self.runCmd("command script import lldb.macosx.heap")
self.expect("ptr_refs my_ptr", substrs=["malloc", "stack"])
2 changes: 1 addition & 1 deletion lldb/test/API/lang/objc/ptr_refs/TestPtrRefsObjC.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ def test_ptr_refs(self):

frame = thread.GetFrameAtIndex(0)

self.runCmd("script import lldb.macosx.heap")
self.runCmd("command script import lldb.macosx.heap")
self.expect("ptr_refs self", substrs=["malloc", "stack"])

6 changes: 6 additions & 0 deletions llvm/docs/LangRef.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2182,6 +2182,12 @@ site, these bundles may contain any values that are needed by the
generated code. For more details, see :ref:`GC Transitions
<gc_transition_args>`.

The bundle contain an arbitrary list of Values which need to be passed
to GC transition code. They will be lowered and passed as operands to
the appropriate GC_TRANSITION nodes in the selection DAG. It is assumed
that these arguments must be available before and after (but not
necessarily during) the execution of the callee.

.. _assume_opbundles:

Assume Operand Bundles
Expand Down
32 changes: 12 additions & 20 deletions llvm/docs/Statepoints.rst
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,7 @@ Syntax:
func_type <target>,
i64 <#call args>, i64 <flags>,
... (call parameters),
i64 <# transition args>, ... (transition parameters),
i64 <# deopt args>, ... (deopt parameters),
i64 0, i64 0,
... (gc parameters))

Overview:
Expand Down Expand Up @@ -515,17 +514,11 @@ instruction. The number of arguments must exactly match what is
specified in '# call args'. The types must match the signature of
'target'.

The 'transition parameters' arguments contain an arbitrary list of
Values which need to be passed to GC transition code. They will be
lowered and passed as operands to the appropriate GC_TRANSITION nodes
in the selection DAG. It is assumed that these arguments must be
available before and after (but not necessarily during) the execution
of the callee. The '# transition args' field indicates how many operands
are to be interpreted as 'transition parameters'.

The 'deopt parameters' arguments contain an arbitrary list of Values
which is meaningful to the runtime. The '# deopt args' field
indicates how many operands are to be interpreted as 'deopt parameters'.
The 'call parameter' attributes must be followed by two 'i64 0' constants.
These were originally the length prefixes for 'gc transition parameter' and
'deopt parameter' arguments, but the role of these parameter sets have been
entirely replaced with the corresponding operand bundles. In a future
revision, these now redundant arguments will be removed.

The 'gc parameters' arguments contain every pointer to a garbage
collector object which potentially needs to be updated by the garbage
Expand Down Expand Up @@ -676,13 +669,12 @@ Each statepoint generates the following Locations:
these identifiers.
* Constant which describes the flags passed to the statepoint intrinsic
* Constant which describes number of following deopt *Locations* (not
operands)
* Variable number of Locations, one for each deopt parameter listed in
the IR statepoint (same number as described by previous Constant). At
the moment, only deopt parameters with a bitwidth of 64 bits or less
are supported. Values of a type larger than 64 bits can be specified
and reported only if a) the value is constant at the call site, and b)
the constant can be represented with less than 64 bits (assuming zero
operands). Will be 0 if no "deopt" bundle is provided.
* Variable number of Locations, one for each deopt parameter listed in the
"deopt" operand bundle. At the moment, only deopt parameters with a bitwidth
of 64 bits or less are supported. Values of a type larger than 64 bits can be
specified and reported only if a) the value is constant at the call site, and
b) the constant can be represented with less than 64 bits (assuming zero
extension to the original bitwidth).
* Variable number of relocation records, each of which consists of
exactly two Locations. Relocation records are described in detail
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/CodeGen/TargetSubtargetInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class Triple;
///
class TargetSubtargetInfo : public MCSubtargetInfo {
protected: // Can only create subclasses...
TargetSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS,
ArrayRef<SubtargetFeatureKV> PF,
TargetSubtargetInfo(const Triple &TT, StringRef CPU, StringRef TuneCPU,
StringRef FS, ArrayRef<SubtargetFeatureKV> PF,
ArrayRef<SubtargetSubTypeKV> PD,
const MCWriteProcResEntry *WPR,
const MCWriteLatencyEntry *WL,
Expand Down
2 changes: 2 additions & 0 deletions llvm/include/llvm/IR/IRPrintingPasses.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class PrintModulePass : public PassInfoMixin<PrintModulePass> {
bool ShouldPreserveUseListOrder = false);

PreservedAnalyses run(Module &M, AnalysisManager<Module> &);
static bool isRequired() { return true; }
};

/// Pass for printing a Function as LLVM's text IR assembly.
Expand All @@ -91,6 +92,7 @@ class PrintFunctionPass : public PassInfoMixin<PrintFunctionPass> {
PrintFunctionPass(raw_ostream &OS, const std::string &Banner = "");

PreservedAnalyses run(Function &F, AnalysisManager<Function> &);
static bool isRequired() { return true; }
};

} // End llvm namespace
Expand Down
1 change: 1 addition & 0 deletions llvm/include/llvm/IR/PassManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,7 @@ struct RequireAnalysisPass

return PreservedAnalyses::all();
}
static bool isRequired() { return true; }
};

/// A no-op pass template which simply forces a specific analysis result
Expand Down
2 changes: 2 additions & 0 deletions llvm/include/llvm/IR/Verifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class VerifierAnalysis : public AnalysisInfoMixin<VerifierAnalysis> {

Result run(Module &M, ModuleAnalysisManager &);
Result run(Function &F, FunctionAnalysisManager &);
static bool isRequired() { return true; }
};

/// Check a module for errors, but report debug info errors separately.
Expand All @@ -141,6 +142,7 @@ class VerifierPass : public PassInfoMixin<VerifierPass> {

PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
static bool isRequired() { return true; }
};

} // end namespace llvm
Expand Down
15 changes: 9 additions & 6 deletions llvm/include/llvm/MC/MCSubtargetInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ struct SubtargetFeatureKV {
struct SubtargetSubTypeKV {
const char *Key; ///< K-V key string
FeatureBitArray Implies; ///< K-V bit mask
FeatureBitArray TuneImplies; ///< K-V bit mask
const MCSchedModel *SchedModel;

/// Compare routine for std::lower_bound
Expand All @@ -74,6 +75,7 @@ struct SubtargetSubTypeKV {
class MCSubtargetInfo {
Triple TargetTriple;
std::string CPU; // CPU being targeted.
std::string TuneCPU; // CPU being tuned for.
ArrayRef<SubtargetFeatureKV> ProcFeatures; // Processor feature list
ArrayRef<SubtargetSubTypeKV> ProcDesc; // Processor descriptions

Expand All @@ -90,8 +92,8 @@ class MCSubtargetInfo {

public:
MCSubtargetInfo(const MCSubtargetInfo &) = default;
MCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS,
ArrayRef<SubtargetFeatureKV> PF,
MCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef TuneCPU,
StringRef FS, ArrayRef<SubtargetFeatureKV> PF,
ArrayRef<SubtargetSubTypeKV> PD,
const MCWriteProcResEntry *WPR, const MCWriteLatencyEntry *WL,
const MCReadAdvanceEntry *RA, const InstrStage *IS,
Expand All @@ -103,6 +105,7 @@ class MCSubtargetInfo {

const Triple &getTargetTriple() const { return TargetTriple; }
StringRef getCPU() const { return CPU; }
StringRef getTuneCPU() const { return TuneCPU; }

const FeatureBitset& getFeatureBits() const { return FeatureBits; }
void setFeatureBits(const FeatureBitset &FeatureBits_) {
Expand All @@ -118,12 +121,12 @@ class MCSubtargetInfo {
///
/// FIXME: Find a way to stick this in the constructor, since it should only
/// be called during initialization.
void InitMCProcessorInfo(StringRef CPU, StringRef FS);
void InitMCProcessorInfo(StringRef CPU, StringRef TuneCPU, StringRef FS);

public:
/// Set the features to the default for the given CPU with an appended feature
/// string.
void setDefaultFeatures(StringRef CPU, StringRef FS);
/// Set the features to the default for the given CPU and TuneCPU, with ano
/// appended feature string.
void setDefaultFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS);

/// Toggle a feature and return the re-computed feature bits.
/// This version does not change the implied bits.
Expand Down
14 changes: 11 additions & 3 deletions llvm/include/llvm/Target/Target.td
Original file line number Diff line number Diff line change
Expand Up @@ -1558,7 +1558,8 @@ class ComplexDeprecationPredicate<string dep> {
// by the scheduler. Each Processor definition requires corresponding
// instruction itineraries.
//
class Processor<string n, ProcessorItineraries pi, list<SubtargetFeature> f> {
class Processor<string n, ProcessorItineraries pi, list<SubtargetFeature> f,
list<SubtargetFeature> tunef = []> {
// Name - Chip set name. Used by command line (-mcpu=) to determine the
// appropriate target chip.
//
Expand All @@ -1574,6 +1575,12 @@ class Processor<string n, ProcessorItineraries pi, list<SubtargetFeature> f> {

// Features - list of
list<SubtargetFeature> Features = f;

// TuneFeatures - list of features for tuning for this CPU. If the target
// supports -mtune, this should contain the list of features used to make
// microarchitectural optimization decisions for a given processor. While
// Features should contain the architectural features for the processor.
list<SubtargetFeature> TuneFeatures = tunef;
}

// ProcessorModel allows subtargets to specify the more general
Expand All @@ -1582,8 +1589,9 @@ class Processor<string n, ProcessorItineraries pi, list<SubtargetFeature> f> {
//
// Although this class always passes NoItineraries to the Processor
// class, the SchedMachineModel may still define valid Itineraries.
class ProcessorModel<string n, SchedMachineModel m, list<SubtargetFeature> f>
: Processor<n, NoItineraries, f> {
class ProcessorModel<string n, SchedMachineModel m, list<SubtargetFeature> f,
list<SubtargetFeature> tunef = []>
: Processor<n, NoItineraries, f, tunef> {
let SchedModel = m;
}

Expand Down
1 change: 1 addition & 0 deletions llvm/include/llvm/Transforms/Coroutines/CoroCleanup.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Function;

struct CoroCleanupPass : PassInfoMixin<CoroCleanupPass> {
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
static bool isRequired() { return true; }
};
} // end namespace llvm

Expand Down
1 change: 1 addition & 0 deletions llvm/include/llvm/Transforms/Coroutines/CoroEarly.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Function;

struct CoroEarlyPass : PassInfoMixin<CoroEarlyPass> {
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
static bool isRequired() { return true; }
};
} // end namespace llvm

Expand Down
1 change: 1 addition & 0 deletions llvm/include/llvm/Transforms/Coroutines/CoroElide.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class Function;

struct CoroElidePass : PassInfoMixin<CoroElidePass> {
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
static bool isRequired() { return true; }
};
} // end namespace llvm

Expand Down
1 change: 1 addition & 0 deletions llvm/include/llvm/Transforms/Coroutines/CoroSplit.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ namespace llvm {
struct CoroSplitPass : PassInfoMixin<CoroSplitPass> {
PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM,
LazyCallGraph &CG, CGSCCUpdateResult &UR);
static bool isRequired() { return true; }
};
} // end namespace llvm

Expand Down
1 change: 1 addition & 0 deletions llvm/include/llvm/Transforms/IPO/AlwaysInliner.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class AlwaysInlinerPass : public PassInfoMixin<AlwaysInlinerPass> {
: InsertLifetime(InsertLifetime) {}

PreservedAnalyses run(Module &M, ModuleAnalysisManager &);
static bool isRequired() { return true; }
};

/// Create a legacy pass manager instance of a pass to inline and remove
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ class AddressSanitizerPass : public PassInfoMixin<AddressSanitizerPass> {
bool Recover = false,
bool UseAfterScope = false);
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
static bool isRequired() { return true; }

private:
bool CompileKernel;
Expand All @@ -122,6 +123,7 @@ class ModuleAddressSanitizerPass
bool UseGlobalGC = true,
bool UseOdrIndicator = false);
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
static bool isRequired() { return true; }

private:
bool CompileKernel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace llvm {
/// stores, and other memory intrinsics.
struct BoundsCheckingPass : PassInfoMixin<BoundsCheckingPass> {
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
static bool isRequired() { return true; }
};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class HWAddressSanitizerPass : public PassInfoMixin<HWAddressSanitizerPass> {
explicit HWAddressSanitizerPass(bool CompileKernel = false,
bool Recover = false);
PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM);
static bool isRequired() { return true; }

private:
bool CompileKernel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ struct MemorySanitizerPass : public PassInfoMixin<MemorySanitizerPass> {

PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM);
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
static bool isRequired() { return true; }

private:
MemorySanitizerOptions Options;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class ModuleSanitizerCoveragePass
*vfs::getRealFileSystem());
}
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
static bool isRequired() { return true; }

private:
SanitizerCoverageOptions Options;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ FunctionPass *createThreadSanitizerLegacyPassPass();
struct ThreadSanitizerPass : public PassInfoMixin<ThreadSanitizerPass> {
PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM);
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
static bool isRequired() { return true; }
};

} // namespace llvm
Expand Down
1 change: 1 addition & 0 deletions llvm/include/llvm/Transforms/Scalar/LowerAtomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace llvm {
class LowerAtomicPass : public PassInfoMixin<LowerAtomicPass> {
public:
PreservedAnalyses run(Function &F, FunctionAnalysisManager &);
static bool isRequired() { return true; }
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
namespace llvm {
struct LowerMatrixIntrinsicsPass : PassInfoMixin<LowerMatrixIntrinsicsPass> {
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
static bool isRequired() { return true; }
};
} // namespace llvm

Expand Down
Loading

0 comments on commit bd3fdd8

Please sign in to comment.