diff options
Diffstat (limited to 'llvm/lib/CodeGen/ShrinkWrap.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/ShrinkWrap.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/ShrinkWrap.cpp b/llvm/lib/CodeGen/ShrinkWrap.cpp index 239572bf773e..fa57eb30fac4 100644 --- a/llvm/lib/CodeGen/ShrinkWrap.cpp +++ b/llvm/lib/CodeGen/ShrinkWrap.cpp @@ -83,7 +83,6 @@ #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetMachine.h" #include <cassert> -#include <cstdint> #include <memory> using namespace llvm; @@ -376,12 +375,7 @@ bool ShrinkWrap::useOrDefCSROrFI(const MachineInstr &MI, RegScavenger *RS, template <typename ListOfBBs, typename DominanceAnalysis> static MachineBasicBlock *FindIDom(MachineBasicBlock &Block, ListOfBBs BBs, DominanceAnalysis &Dom, bool Strict = true) { - MachineBasicBlock *IDom = &Block; - for (MachineBasicBlock *BB : BBs) { - IDom = Dom.findNearestCommonDominator(IDom, BB); - if (!IDom) - break; - } + MachineBasicBlock *IDom = Dom.findNearestCommonDominator(iterator_range(BBs)); if (Strict && IDom == &Block) return nullptr; return IDom; @@ -411,8 +405,7 @@ hasDirtyPred(const DenseSet<const MachineBasicBlock *> &ReachableByDirty, /// Derives the list of all the basic blocks reachable from MBB. static void markAllReachable(DenseSet<const MachineBasicBlock *> &Visited, const MachineBasicBlock &MBB) { - SmallVector<MachineBasicBlock *, 4> Worklist(MBB.succ_begin(), - MBB.succ_end()); + SmallVector<MachineBasicBlock *, 4> Worklist(MBB.successors()); Visited.insert(&MBB); while (!Worklist.empty()) { MachineBasicBlock *SuccMBB = Worklist.pop_back_val(); @@ -440,8 +433,7 @@ static bool isSaveReachableThroughClean(const MachineBasicBlock *SavePoint, ArrayRef<MachineBasicBlock *> CleanPreds) { DenseSet<const MachineBasicBlock *> Visited; - SmallVector<MachineBasicBlock *, 4> Worklist(CleanPreds.begin(), - CleanPreds.end()); + SmallVector<MachineBasicBlock *, 4> Worklist(CleanPreds); while (!Worklist.empty()) { MachineBasicBlock *CleanBB = Worklist.pop_back_val(); if (CleanBB == SavePoint) @@ -989,6 +981,7 @@ bool ShrinkWrap::isShrinkWrapEnabled(const MachineFunction &MF) { !(MF.getFunction().hasFnAttribute(Attribute::SanitizeAddress) || MF.getFunction().hasFnAttribute(Attribute::SanitizeThread) || MF.getFunction().hasFnAttribute(Attribute::SanitizeMemory) || + MF.getFunction().hasFnAttribute(Attribute::SanitizeType) || MF.getFunction().hasFnAttribute(Attribute::SanitizeHWAddress)); // If EnableShrinkWrap is set, it takes precedence on whatever the // target sets. The rational is that we assume we want to test |
