aboutsummaryrefslogtreecommitdiff
path: root/llvm/include
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/ADT/CombinationGenerator.h3
-rw-r--r--llvm/include/llvm/ADT/STLForwardCompat.h22
-rw-r--r--llvm/include/llvm/BinaryFormat/ELF.h1
-rw-r--r--llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h4
-rw-r--r--llvm/include/llvm/CodeGen/MachineFunctionAnalysis.h5
-rw-r--r--llvm/include/llvm/IR/DebugInfo.h5
-rw-r--r--llvm/include/llvm/IR/DebugInfoMetadata.h3
-rw-r--r--llvm/include/llvm/IR/IntrinsicsAMDGPU.td6
-rw-r--r--llvm/include/llvm/IR/PassManager.h16
-rw-r--r--llvm/include/llvm/MC/MCDisassembler/MCDisassembler.h12
-rw-r--r--llvm/include/llvm/MC/MCObjectStreamer.h13
-rw-r--r--llvm/include/llvm/MC/MCSection.h1
-rw-r--r--llvm/include/llvm/MC/MCStreamer.h4
-rw-r--r--llvm/include/llvm/Passes/CodeGenPassBuilder.h2
-rw-r--r--llvm/include/llvm/Transforms/Utils/SSAUpdater.h4
15 files changed, 57 insertions, 44 deletions
diff --git a/llvm/include/llvm/ADT/CombinationGenerator.h b/llvm/include/llvm/ADT/CombinationGenerator.h
index 6100aa9..bbdbd9b 100644
--- a/llvm/include/llvm/ADT/CombinationGenerator.h
+++ b/llvm/include/llvm/ADT/CombinationGenerator.h
@@ -118,10 +118,9 @@ public:
: VariablesChoices(VariablesChoices_) {
#ifndef NDEBUG
assert(!VariablesChoices.empty() && "There should be some variables.");
- llvm::for_each(VariablesChoices, [](ArrayRef<choice_type> VariableChoices) {
+ for (ArrayRef<choice_type> VariableChoices : VariablesChoices)
assert(!VariableChoices.empty() &&
"There must always be some choice, at least a placeholder one.");
- });
#endif
}
diff --git a/llvm/include/llvm/ADT/STLForwardCompat.h b/llvm/include/llvm/ADT/STLForwardCompat.h
index 7bd2c87..81b9a68 100644
--- a/llvm/include/llvm/ADT/STLForwardCompat.h
+++ b/llvm/include/llvm/ADT/STLForwardCompat.h
@@ -55,21 +55,13 @@ using type_identity_t // NOLINT(readability-identifier-naming)
// TODO: Remove this in favor of std::optional<T>::transform once we switch to
// C++23.
-template <typename T, typename Function>
-auto transformOptional(const std::optional<T> &O, const Function &F)
- -> std::optional<decltype(F(*O))> {
- if (O)
- return F(*O);
- return std::nullopt;
-}
-
-// TODO: Remove this in favor of std::optional<T>::transform once we switch to
-// C++23.
-template <typename T, typename Function>
-auto transformOptional(std::optional<T> &&O, const Function &F)
- -> std::optional<decltype(F(*std::move(O)))> {
- if (O)
- return F(*std::move(O));
+template <typename Optional, typename Function,
+ typename Value = typename llvm::remove_cvref_t<Optional>::value_type>
+std::optional<std::invoke_result_t<Function, Value>>
+transformOptional(Optional &&O, Function &&F) {
+ if (O) {
+ return F(*std::forward<Optional>(O));
+ }
return std::nullopt;
}
diff --git a/llvm/include/llvm/BinaryFormat/ELF.h b/llvm/include/llvm/BinaryFormat/ELF.h
index 6bf2e17..e4f82ad 100644
--- a/llvm/include/llvm/BinaryFormat/ELF.h
+++ b/llvm/include/llvm/BinaryFormat/ELF.h
@@ -1159,6 +1159,7 @@ enum : unsigned {
SHT_LLVM_OFFLOADING = 0x6fff4c0b, // LLVM device offloading data.
SHT_LLVM_LTO = 0x6fff4c0c, // .llvm.lto for fat LTO.
SHT_LLVM_JT_SIZES = 0x6fff4c0d, // LLVM jump tables sizes.
+ SHT_LLVM_CFI_JUMP_TABLE = 0x6fff4c0e, // LLVM CFI jump table.
// Android's experimental support for SHT_RELR sections.
// https://android.googlesource.com/platform/bionic/+/b7feec74547f84559a1467aca02708ff61346d2a/libc/include/elf.h#512
SHT_ANDROID_RELR = 0x6fffff00, // Relocation entries; only offsets.
diff --git a/llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h b/llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h
index aef9190..7940752 100644
--- a/llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h
+++ b/llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h
@@ -39,8 +39,8 @@ class MachineBlockFrequencyInfo {
public:
LLVM_ABI MachineBlockFrequencyInfo(); // Legacy pass manager only.
LLVM_ABI explicit MachineBlockFrequencyInfo(
- MachineFunction &F, MachineBranchProbabilityInfo &MBPI,
- MachineLoopInfo &MLI);
+ const MachineFunction &F, const MachineBranchProbabilityInfo &MBPI,
+ const MachineLoopInfo &MLI);
LLVM_ABI MachineBlockFrequencyInfo(MachineBlockFrequencyInfo &&);
LLVM_ABI ~MachineBlockFrequencyInfo();
diff --git a/llvm/include/llvm/CodeGen/MachineFunctionAnalysis.h b/llvm/include/llvm/CodeGen/MachineFunctionAnalysis.h
index 98a60c9..1d954cf 100644
--- a/llvm/include/llvm/CodeGen/MachineFunctionAnalysis.h
+++ b/llvm/include/llvm/CodeGen/MachineFunctionAnalysis.h
@@ -46,6 +46,11 @@ public:
LLVM_ABI Result run(Function &F, FunctionAnalysisManager &FAM);
};
+class FreeMachineFunctionPass : public PassInfoMixin<FreeMachineFunctionPass> {
+public:
+ PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM);
+};
+
} // namespace llvm
#endif // LLVM_CODEGEN_MachineFunctionAnalysis
diff --git a/llvm/include/llvm/IR/DebugInfo.h b/llvm/include/llvm/IR/DebugInfo.h
index 77cee87..f8241a3 100644
--- a/llvm/include/llvm/IR/DebugInfo.h
+++ b/llvm/include/llvm/IR/DebugInfo.h
@@ -115,8 +115,7 @@ public:
LLVM_ABI void processVariable(DILocalVariable *DVI);
/// Process debug info location.
LLVM_ABI void processLocation(const Module &M, const DILocation *Loc);
- /// Process a DbgRecord (e.g, treat a DbgVariableRecord like a
- /// DbgVariableIntrinsic).
+ /// Process a DbgRecord.
LLVM_ABI void processDbgRecord(const Module &M, const DbgRecord &DR);
/// Process subprogram.
@@ -290,8 +289,6 @@ struct VarRecord {
DILocalVariable *Var;
DILocation *DL;
- VarRecord(DbgVariableIntrinsic *DVI)
- : Var(DVI->getVariable()), DL(getDebugValueLoc(DVI)) {}
VarRecord(DbgVariableRecord *DVR)
: Var(DVR->getVariable()), DL(getDebugValueLoc(DVR)) {}
VarRecord(DILocalVariable *Var, DILocation *DL) : Var(Var), DL(DL) {}
diff --git a/llvm/include/llvm/IR/DebugInfoMetadata.h b/llvm/include/llvm/IR/DebugInfoMetadata.h
index 9345f95..f1f0c189 100644
--- a/llvm/include/llvm/IR/DebugInfoMetadata.h
+++ b/llvm/include/llvm/IR/DebugInfoMetadata.h
@@ -66,7 +66,6 @@ namespace dwarf {
enum Tag : uint16_t;
}
-class DbgVariableIntrinsic;
class DbgVariableRecord;
LLVM_ABI extern cl::opt<bool> EnableFSDiscriminator;
@@ -4613,7 +4612,6 @@ class DebugVariable {
LLVM_ABI static const FragmentInfo DefaultFragment;
public:
- LLVM_ABI DebugVariable(const DbgVariableIntrinsic *DII);
LLVM_ABI DebugVariable(const DbgVariableRecord *DVR);
DebugVariable(const DILocalVariable *Var,
@@ -4681,7 +4679,6 @@ template <> struct DenseMapInfo<DebugVariable> {
/// information).
class DebugVariableAggregate : public DebugVariable {
public:
- LLVM_ABI DebugVariableAggregate(const DbgVariableIntrinsic *DVI);
DebugVariableAggregate(const DebugVariable &V)
: DebugVariable(V.getVariable(), std::nullopt, V.getInlinedAt()) {}
};
diff --git a/llvm/include/llvm/IR/IntrinsicsAMDGPU.td b/llvm/include/llvm/IR/IntrinsicsAMDGPU.td
index d8fda0e..ecda6c4 100644
--- a/llvm/include/llvm/IR/IntrinsicsAMDGPU.td
+++ b/llvm/include/llvm/IR/IntrinsicsAMDGPU.td
@@ -3572,6 +3572,12 @@ def int_amdgcn_cvt_f16_bf8 : ClangBuiltin<"__builtin_amdgcn_cvt_f16_bf8">,
[llvm_i32_ty, llvm_i32_ty],
[IntrNoMem, ImmArg<ArgIndex<1>>]>;
+def int_amdgcn_sat_pk4_i4_i8 : ClangBuiltin<"__builtin_amdgcn_sat_pk4_i4_i8">,
+ DefaultAttrsIntrinsic<[llvm_i16_ty], [llvm_i32_ty], [IntrNoMem, IntrSpeculatable]>;
+
+def int_amdgcn_sat_pk4_u4_u8 : ClangBuiltin<"__builtin_amdgcn_sat_pk4_u4_u8">,
+ DefaultAttrsIntrinsic<[llvm_i16_ty], [llvm_i32_ty], [IntrNoMem, IntrSpeculatable]>;
+
//===----------------------------------------------------------------------===//
// Special Intrinsics for backend internal use only. No frontend
// should emit calls to these.
diff --git a/llvm/include/llvm/IR/PassManager.h b/llvm/include/llvm/IR/PassManager.h
index 4f44ae5..ea8226c 100644
--- a/llvm/include/llvm/IR/PassManager.h
+++ b/llvm/include/llvm/IR/PassManager.h
@@ -491,6 +491,22 @@ public:
/// invalidate them, unless they are preserved by the PreservedAnalyses set.
void invalidate(IRUnitT &IR, const PreservedAnalyses &PA);
+ /// Directly clear a cached analysis for an IR unit.
+ ///
+ /// Using invalidate() over this is preferred unless you are really
+ /// sure you want to *only* clear this analysis without asking if it is
+ /// invalid.
+ template <typename AnalysisT> void clearAnalysis(IRUnitT &IR) {
+ AnalysisResultListT &ResultsList = AnalysisResultLists[&IR];
+ AnalysisKey *ID = AnalysisT::ID();
+
+ auto I =
+ llvm::find_if(ResultsList, [&ID](auto &E) { return E.first == ID; });
+ assert(I != ResultsList.end() && "Analysis must be available");
+ ResultsList.erase(I);
+ AnalysisResults.erase({ID, &IR});
+ }
+
private:
/// Look up a registered analysis pass.
PassConceptT &lookUpPass(AnalysisKey *ID) {
diff --git a/llvm/include/llvm/MC/MCDisassembler/MCDisassembler.h b/llvm/include/llvm/MC/MCDisassembler/MCDisassembler.h
index 3a7ca1a..cae2fbc 100644
--- a/llvm/include/llvm/MC/MCDisassembler/MCDisassembler.h
+++ b/llvm/include/llvm/MC/MCDisassembler/MCDisassembler.h
@@ -136,6 +136,18 @@ public:
ArrayRef<uint8_t> Bytes, uint64_t Address,
raw_ostream &CStream) const = 0;
+ /// Returns the disassembly of an instruction bundle for VLIW architectures
+ /// like Hexagon.
+ ///
+ /// \param Instr - An MCInst to populate with the contents of
+ /// the Bundle with sub-instructions encoded as Inst operands.
+ virtual DecodeStatus getInstructionBundle(MCInst &Instr, uint64_t &Size,
+ ArrayRef<uint8_t> Bytes,
+ uint64_t Address,
+ raw_ostream &CStream) const {
+ return Fail;
+ }
+
/// Used to perform separate target specific disassembly for a particular
/// symbol. May parse any prelude that precedes instructions after the
/// start of a symbol, or the entire symbol.
diff --git a/llvm/include/llvm/MC/MCObjectStreamer.h b/llvm/include/llvm/MC/MCObjectStreamer.h
index a55fd4a..319e131 100644
--- a/llvm/include/llvm/MC/MCObjectStreamer.h
+++ b/llvm/include/llvm/MC/MCObjectStreamer.h
@@ -73,20 +73,9 @@ public:
MCSymbol *emitCFILabel() override;
void emitCFISections(bool EH, bool Debug) override;
- void insert(MCFragment *F) {
- auto *Sec = CurFrag->getParent();
- F->setParent(Sec);
- F->setLayoutOrder(CurFrag->getLayoutOrder() + 1);
- CurFrag->Next = F;
- CurFrag = F;
- Sec->curFragList()->Tail = F;
- }
-
/// Get a data fragment to write into, creating a new one if the current
/// fragment is not FT_Data.
- /// Optionally a \p STI can be passed in so that a new fragment is created
- /// if the Subtarget differs from the current fragment.
- MCFragment *getOrCreateDataFragment(const MCSubtargetInfo *STI = nullptr);
+ MCFragment *getOrCreateDataFragment();
protected:
bool changeSectionImpl(MCSection *Section, uint32_t Subsection);
diff --git a/llvm/include/llvm/MC/MCSection.h b/llvm/include/llvm/MC/MCSection.h
index 296fdd8..313071e 100644
--- a/llvm/include/llvm/MC/MCSection.h
+++ b/llvm/include/llvm/MC/MCSection.h
@@ -188,6 +188,7 @@ public:
// destructors.
class MCFragment {
friend class MCAssembler;
+ friend class MCStreamer;
friend class MCObjectStreamer;
friend class MCSection;
diff --git a/llvm/include/llvm/MC/MCStreamer.h b/llvm/include/llvm/MC/MCStreamer.h
index b3a9aab..4b91dbc 100644
--- a/llvm/include/llvm/MC/MCStreamer.h
+++ b/llvm/include/llvm/MC/MCStreamer.h
@@ -429,7 +429,6 @@ public:
CurFrag->getParent() == getCurrentSection().first);
return CurFrag;
}
-
/// Save the current and previous section on the section stack.
void pushSection() {
SectionStack.push_back(
@@ -457,6 +456,9 @@ public:
MCSymbol *endSection(MCSection *Section);
+ void insert(MCFragment *F);
+ void newFragment();
+
/// Returns the mnemonic for \p MI, if the streamer has access to a
/// instruction printer and returns an empty string otherwise.
virtual StringRef getMnemonic(const MCInst &MI) const { return ""; }
diff --git a/llvm/include/llvm/Passes/CodeGenPassBuilder.h b/llvm/include/llvm/Passes/CodeGenPassBuilder.h
index a8176eb..b0360f1 100644
--- a/llvm/include/llvm/Passes/CodeGenPassBuilder.h
+++ b/llvm/include/llvm/Passes/CodeGenPassBuilder.h
@@ -281,7 +281,7 @@ protected:
FunctionPassManager FPM;
FPM.addPass(createFunctionToMachineFunctionPassAdaptor(std::move(MFPM)));
- FPM.addPass(InvalidateAnalysisPass<MachineFunctionAnalysis>());
+ FPM.addPass(FreeMachineFunctionPass());
if (this->PB.AddInCGSCCOrder) {
MPM.addPass(createModuleToPostOrderCGSCCPassAdaptor(
createCGSCCToFunctionPassAdaptor(std::move(FPM))));
diff --git a/llvm/include/llvm/Transforms/Utils/SSAUpdater.h b/llvm/include/llvm/Transforms/Utils/SSAUpdater.h
index 4e5da81..9500b1f 100644
--- a/llvm/include/llvm/Transforms/Utils/SSAUpdater.h
+++ b/llvm/include/llvm/Transforms/Utils/SSAUpdater.h
@@ -29,7 +29,6 @@ template <typename T> class SSAUpdaterTraits;
class Type;
class Use;
class Value;
-class DbgValueInst;
/// Helper class for SSA formation on a set of values defined in
/// multiple blocks.
@@ -123,8 +122,6 @@ public:
/// value set to the new SSA value if available, and undef if not.
void UpdateDebugValues(Instruction *I);
void UpdateDebugValues(Instruction *I,
- SmallVectorImpl<DbgValueInst *> &DbgValues);
- void UpdateDebugValues(Instruction *I,
SmallVectorImpl<DbgVariableRecord *> &DbgValues);
/// Rewrite a use like \c RewriteUse but handling in-block definitions.
@@ -136,7 +133,6 @@ public:
private:
Value *GetValueAtEndOfBlockInternal(BasicBlock *BB);
- void UpdateDebugValue(Instruction *I, DbgValueInst *DbgValue);
void UpdateDebugValue(Instruction *I, DbgVariableRecord *DbgValue);
};