aboutsummaryrefslogtreecommitdiff
path: root/llvm/include
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/ADT/ImmutableSet.h2
-rw-r--r--llvm/include/llvm/BinaryFormat/Dwarf.h2
-rw-r--r--llvm/include/llvm/CodeGen/AsmPrinter.h27
-rw-r--r--llvm/include/llvm/CodeGen/TargetLowering.h3
-rw-r--r--llvm/include/llvm/IR/ConstantFPRange.h16
-rw-r--r--llvm/include/llvm/IR/Instructions.h2
-rw-r--r--llvm/include/llvm/Support/raw_ostream.h2
-rw-r--r--llvm/include/llvm/Target/TargetSelectionDAG.td15
-rw-r--r--llvm/include/llvm/TargetParser/Triple.h8
9 files changed, 43 insertions, 34 deletions
diff --git a/llvm/include/llvm/ADT/ImmutableSet.h b/llvm/include/llvm/ADT/ImmutableSet.h
index 310539f..017585a4 100644
--- a/llvm/include/llvm/ADT/ImmutableSet.h
+++ b/llvm/include/llvm/ADT/ImmutableSet.h
@@ -21,9 +21,7 @@
#include "llvm/ADT/iterator.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
-#include "llvm/Support/Signals.h"
#include <cassert>
#include <cstdint>
#include <functional>
diff --git a/llvm/include/llvm/BinaryFormat/Dwarf.h b/llvm/include/llvm/BinaryFormat/Dwarf.h
index 815e85d..5039a3f 100644
--- a/llvm/include/llvm/BinaryFormat/Dwarf.h
+++ b/llvm/include/llvm/BinaryFormat/Dwarf.h
@@ -390,7 +390,7 @@ toDW_LNAME(SourceLanguage language) {
case DW_LANG_C11:
return {{DW_LNAME_C, 201112}};
case DW_LANG_C17:
- return {{DW_LNAME_C, 201712}};
+ return {{DW_LNAME_C, 201710}};
case DW_LANG_C_plus_plus:
return {{DW_LNAME_C_plus_plus, 0}};
case DW_LANG_C_plus_plus_03:
diff --git a/llvm/include/llvm/CodeGen/AsmPrinter.h b/llvm/include/llvm/CodeGen/AsmPrinter.h
index 4c744a2..19ca444 100644
--- a/llvm/include/llvm/CodeGen/AsmPrinter.h
+++ b/llvm/include/llvm/CodeGen/AsmPrinter.h
@@ -198,26 +198,13 @@ private:
/// and targets.
using CGTypeId = uint64_t;
- /// Map type identifiers to callsite labels. Labels are generated for each
- /// indirect callsite in the function.
- SmallVector<std::pair<CGTypeId, MCSymbol *>> CallSiteLabels;
+ /// Unique target type IDs.
+ SmallSet<CGTypeId, 4> IndirectCalleeTypeIDs;
+ /// Unique direct callees.
SmallSet<MCSymbol *, 4> DirectCallees;
};
- /// Enumeration of function kinds, and their mapping to function kind values
- /// stored in callgraph section entries.
- enum class FunctionKind : uint64_t {
- /// Function cannot be target to indirect calls.
- NOT_INDIRECT_TARGET = 0,
-
- /// Function may be target to indirect calls but its type id is unknown.
- INDIRECT_TARGET_UNKNOWN_TID = 1,
-
- /// Function may be target to indirect calls and its type id is known.
- INDIRECT_TARGET_KNOWN_TID = 2,
- };
-
- enum CallGraphSectionFormatVersion : uint64_t {
+ enum CallGraphSectionFormatVersion : uint8_t {
V_0 = 0,
};
@@ -386,9 +373,9 @@ public:
/// are available. Returns empty string otherwise.
StringRef getConstantSectionSuffix(const Constant *C) const;
- /// Iff MI is an indirect call, generate and emit a label after the callsites
- /// which will be used to populate the .callgraph section. For direct
- /// callsites add the callee symbol to direct callsites list of FuncCGInfo.
+ /// If MI is an indirect call, add expected type IDs to indirect type ids
+ /// list. If MI is a direct call add the callee symbol to direct callsites
+ /// list of FuncCGInfo.
void handleCallsiteForCallgraph(
FunctionCallGraphInfo &FuncCGInfo,
const MachineFunction::CallSiteInfoMap &CallSitesInfoMap,
diff --git a/llvm/include/llvm/CodeGen/TargetLowering.h b/llvm/include/llvm/CodeGen/TargetLowering.h
index 88691b9..73f2c55 100644
--- a/llvm/include/llvm/CodeGen/TargetLowering.h
+++ b/llvm/include/llvm/CodeGen/TargetLowering.h
@@ -847,8 +847,7 @@ public:
/// This is usually true on most targets. But some targets, like Thumb1,
/// have immediate shift instructions, but no immediate "and" instruction;
/// this makes the fold unprofitable.
- virtual bool shouldFoldConstantShiftPairToMask(const SDNode *N,
- CombineLevel Level) const {
+ virtual bool shouldFoldConstantShiftPairToMask(const SDNode *N) const {
return true;
}
diff --git a/llvm/include/llvm/IR/ConstantFPRange.h b/llvm/include/llvm/IR/ConstantFPRange.h
index 4a54caa..d47f6c0 100644
--- a/llvm/include/llvm/IR/ConstantFPRange.h
+++ b/llvm/include/llvm/IR/ConstantFPRange.h
@@ -206,6 +206,22 @@ public:
/// Calculate range of negated values.
LLVM_ABI ConstantFPRange negate() const;
+
+ /// Get the range without NaNs. It is useful when we apply nnan flag to range
+ /// of operands/results.
+ ConstantFPRange getWithoutNaN() const {
+ return ConstantFPRange(Lower, Upper, false, false);
+ }
+
+ /// Get the range without infinities. It is useful when we apply ninf flag to
+ /// range of operands/results.
+ LLVM_ABI ConstantFPRange getWithoutInf() const;
+
+ /// Return a new range in the specified format with the specified rounding
+ /// mode.
+ LLVM_ABI ConstantFPRange
+ cast(const fltSemantics &DstSem,
+ APFloat::roundingMode RM = APFloat::rmNearestTiesToEven) const;
};
inline raw_ostream &operator<<(raw_ostream &OS, const ConstantFPRange &CR) {
diff --git a/llvm/include/llvm/IR/Instructions.h b/llvm/include/llvm/IR/Instructions.h
index de7a237..27930bb 100644
--- a/llvm/include/llvm/IR/Instructions.h
+++ b/llvm/include/llvm/IR/Instructions.h
@@ -1715,7 +1715,7 @@ public:
static SelectInst *Create(Value *C, Value *S1, Value *S2,
const Twine &NameStr = "",
InsertPosition InsertBefore = nullptr,
- Instruction *MDFrom = nullptr) {
+ const Instruction *MDFrom = nullptr) {
SelectInst *Sel =
new (AllocMarker) SelectInst(C, S1, S2, NameStr, InsertBefore);
if (MDFrom)
diff --git a/llvm/include/llvm/Support/raw_ostream.h b/llvm/include/llvm/Support/raw_ostream.h
index f87344e..70916d8 100644
--- a/llvm/include/llvm/Support/raw_ostream.h
+++ b/llvm/include/llvm/Support/raw_ostream.h
@@ -739,7 +739,7 @@ class LLVM_ABI raw_null_ostream : public raw_pwrite_stream {
uint64_t current_pos() const override;
public:
- explicit raw_null_ostream() = default;
+ explicit raw_null_ostream() : raw_pwrite_stream(/*Unbuffered=*/true) {}
~raw_null_ostream() override;
};
diff --git a/llvm/include/llvm/Target/TargetSelectionDAG.td b/llvm/include/llvm/Target/TargetSelectionDAG.td
index 774063b..632be7a 100644
--- a/llvm/include/llvm/Target/TargetSelectionDAG.td
+++ b/llvm/include/llvm/Target/TargetSelectionDAG.td
@@ -119,11 +119,12 @@ def SDTIntShiftOp : SDTypeProfile<1, 2, [ // shl, sra, srl
SDTCisSameAs<0, 1>, SDTCisInt<0>, SDTCisInt<2>, SDTCisSameNumEltsAs<0, 2>
]>;
def SDTIntShiftPairOp : SDTypeProfile<2, 3, [ // shl_parts, sra_parts, srl_parts
- SDTCisInt<0>, SDTCisSameAs<1, 0>,
- SDTCisSameAs<2, 0>, SDTCisSameAs<3, 0>, SDTCisInt<4>
+ SDTCisInt<0>, SDTCisSameAs<1, 0>, SDTCisSameAs<2, 0>, SDTCisSameAs<3, 0>,
+ SDTCisInt<4>, SDTCisSameNumEltsAs<0, 4>
]>;
def SDTIntShiftDOp: SDTypeProfile<1, 3, [ // fshl, fshr
- SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>, SDTCisInt<0>, SDTCisInt<3>
+ SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>, SDTCisInt<0>, SDTCisInt<3>,
+ SDTCisSameNumEltsAs<0, 3>
]>;
def SDTIntSatNoShOp : SDTypeProfile<1, 2, [ // ssat with no shift
SDTCisSameAs<0, 1>, SDTCisInt<2>
@@ -139,7 +140,7 @@ def SDTFPBinOp : SDTypeProfile<1, 2, [ // fadd, fmul, etc.
SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>, SDTCisFP<0>
]>;
def SDTFPSignOp : SDTypeProfile<1, 2, [ // fcopysign.
- SDTCisSameAs<0, 1>, SDTCisFP<0>, SDTCisFP<2>
+ SDTCisSameAs<0, 1>, SDTCisFP<0>, SDTCisFP<2>, SDTCisSameNumEltsAs<0, 2>
]>;
def SDTFPTernaryOp : SDTypeProfile<1, 3, [ // fmadd, fnmsub, etc.
SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>, SDTCisSameAs<0, 3>, SDTCisFP<0>
@@ -148,7 +149,7 @@ def SDTIntUnaryOp : SDTypeProfile<1, 1, [ // bitreverse
SDTCisSameAs<0, 1>, SDTCisInt<0>
]>;
def SDTIntBitCountUnaryOp : SDTypeProfile<1, 1, [ // ctlz, cttz
- SDTCisInt<0>, SDTCisInt<1>
+ SDTCisInt<0>, SDTCisInt<1>, SDTCisSameNumEltsAs<0, 1>
]>;
def SDTIntExtendOp : SDTypeProfile<1, 1, [ // sext, zext, anyext
SDTCisInt<0>, SDTCisInt<1>, SDTCisOpSmallerThanOp<1, 0>, SDTCisSameNumEltsAs<0, 1>
@@ -300,10 +301,10 @@ def SDTVecInsert : SDTypeProfile<1, 3, [ // vector insert
SDTCisEltOfVec<2, 1>, SDTCisSameAs<0, 1>, SDTCisPtrTy<3>
]>;
def SDTVecReduce : SDTypeProfile<1, 1, [ // vector reduction
- SDTCisInt<0>, SDTCisVec<1>
+ SDTCisInt<0>, SDTCisVec<1>, SDTCisInt<1>
]>;
def SDTFPVecReduce : SDTypeProfile<1, 1, [ // FP vector reduction
- SDTCisFP<0>, SDTCisVec<1>
+ SDTCisFP<0>, SDTCisEltOfVec<0, 1>
]>;
def SDTVecReverse : SDTypeProfile<1, 1, [ // vector reverse
diff --git a/llvm/include/llvm/TargetParser/Triple.h b/llvm/include/llvm/TargetParser/Triple.h
index ed2e01c..dc8cd86d 100644
--- a/llvm/include/llvm/TargetParser/Triple.h
+++ b/llvm/include/llvm/TargetParser/Triple.h
@@ -277,6 +277,7 @@ public:
MuslF32,
MuslSF,
MuslX32,
+ MuslWALI,
LLVM,
MSVC,
@@ -798,6 +799,12 @@ public:
return getObjectFormat() == Triple::DXContainer;
}
+ /// Tests whether the target uses WALI Wasm
+ bool isWALI() const {
+ return getArch() == Triple::wasm32 && isOSLinux() &&
+ getEnvironment() == Triple::MuslWALI;
+ }
+
/// Tests whether the target is the PS4 platform.
bool isPS4() const {
return getArch() == Triple::x86_64 &&
@@ -840,6 +847,7 @@ public:
getEnvironment() == Triple::MuslF32 ||
getEnvironment() == Triple::MuslSF ||
getEnvironment() == Triple::MuslX32 ||
+ getEnvironment() == Triple::MuslWALI ||
getEnvironment() == Triple::OpenHOS || isOSLiteOS();
}