Go to the documentation of this file.
14 #ifndef LLVM_SUPPORT_CFGUPDATE_H
15 #define LLVM_SUPPORT_CFGUPDATE_H
28 template <
typename NodePtr>
class Update {
41 return From ==
RHS.From && ToAndKind ==
RHS.ToAndKind;
46 getFrom()->printAsOperand(OS,
false);
48 getTo()->printAsOperand(OS,
false);
51 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
62 template <
typename NodePtr>
65 bool InverseGraph,
bool ReverseResultOrder =
false) {
72 Operations.
reserve(AllUpdates.size());
74 for (
const auto &U : AllUpdates) {
75 NodePtr
From = U.getFrom();
76 NodePtr To = U.getTo();
84 Result.reserve(Operations.
size());
85 for (
auto &
Op : Operations) {
86 const int NumInsertions =
Op.second;
88 if (NumInsertions == 0)
92 Result.push_back({UK,
Op.first.first,
Op.first.second});
99 for (
size_t i = 0,
e = AllUpdates.size();
i !=
e; ++
i) {
100 const auto &U = AllUpdates[
i];
102 Operations[{U.getFrom(), U.getTo()}] =
int(
i);
104 Operations[{U.getTo(), U.getFrom()}] =
int(
i);
108 const auto &OpA = Operations[{A.getFrom(), A.getTo()}];
109 const auto &OpB = Operations[{
B.getFrom(),
B.getTo()}];
110 return ReverseResultOrder ? OpA < OpB : OpA > OpB;
117 #endif // LLVM_SUPPORT_CFGUPDATE_H
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
This is an optimization pass for GlobalISel generic memory operations.
bool operator==(const Update &RHS) const
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Clang compiles this i1 i64 store i64 i64 store i64 i64 store i64 i64 store i64 align Which gets codegen d xmm0 movaps rbp movaps rbp movaps rbp movaps rbp rbp rbp rbp rbp It would be better to have movq s of instead of the movaps s LLVM produces ret int
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
This class implements an extremely fast bulk output stream that can only output to a stream.
Update(UpdateKind Kind, NodePtr From, NodePtr To)
PointerTy getPointer() const
UpdateKind getKind() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
void print(raw_ostream &OS) const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
llvm::DenseMapBase< SmallDenseMap< KeyT, ValueT, 4, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >, KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >::size unsigned size() const
void sort(IteratorTy Start, IteratorTy End)
LLVM_DUMP_METHOD void dump() const
llvm::DenseMapBase< SmallDenseMap< KeyT, ValueT, 4, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >, KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >::reserve void reserve(size_type NumEntries)
Grow the densemap so that it can contain at least NumEntries items before resizing again.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
BlockVerifier::State From
APFloat abs(APFloat X)
Returns the absolute value of the argument.
void LegalizeUpdates(ArrayRef< Update< NodePtr >> AllUpdates, SmallVectorImpl< Update< NodePtr >> &Result, bool InverseGraph, bool ReverseResultOrder=false)