1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

[NFC] Remove obsolete method headerMayThrow

llvm-svn: 344596
This commit is contained in:
Max Kazantsev 2018-10-16 09:11:25 +00:00
parent 6008cf59bd
commit 8e3b278003
2 changed files with 2 additions and 20 deletions

View File

@ -66,11 +66,6 @@ public:
/// Copy colors of block \p Old into the block \p New.
void copyColors(BasicBlock *New, BasicBlock *Old);
/// Returns true iff the header block of the loop for which this info is
/// calculated contains an instruction that may throw or otherwise exit
/// abnormally.
virtual bool headerMayThrow() const = 0;
/// Returns true iff the block \p BB potentially may throw exception. It can
/// be false-positive in cases when we want to avoid complex analysis.
virtual bool blockMayThrow(const BasicBlock *BB) const = 0;
@ -112,8 +107,6 @@ class SimpleLoopSafetyInfo: public LoopSafetyInfo {
bool HeaderMayThrow = false; // Same as previous, but specific to loop header
public:
virtual bool headerMayThrow() const;
virtual bool blockMayThrow(const BasicBlock *BB) const;
virtual bool anyBlockMayThrow() const;

View File

@ -33,10 +33,6 @@ void LoopSafetyInfo::copyColors(BasicBlock *New, BasicBlock *Old) {
ColorsForNewBlock = ColorsForOldBlock;
}
bool SimpleLoopSafetyInfo::headerMayThrow() const {
return HeaderMayThrow;
}
bool SimpleLoopSafetyInfo::blockMayThrow(const BasicBlock *BB) const {
(void)BB;
return anyBlockMayThrow();
@ -203,10 +199,6 @@ bool LoopSafetyInfo::allLoopPathsLeadToBlock(const Loop *CurLoop,
bool SimpleLoopSafetyInfo::isGuaranteedToExecute(const Instruction &Inst,
const DominatorTree *DT,
const Loop *CurLoop) const {
// We have to check to make sure that the instruction dominates all
// of the exit blocks. If it doesn't, then there is a path out of the loop
// which does not execute this instruction, so we can't hoist it.
// If the instruction is in the header block for the loop (which is very
// common), it is always guaranteed to dominate the exit blocks. Since this
// is a common case, and can save some work, check it now.
@ -215,15 +207,12 @@ bool SimpleLoopSafetyInfo::isGuaranteedToExecute(const Instruction &Inst,
// Inst unless we can prove that Inst comes before the potential implicit
// exit. At the moment, we use a (cheap) hack for the common case where
// the instruction of interest is the first one in the block.
return !headerMayThrow() ||
return !HeaderMayThrow ||
Inst.getParent()->getFirstNonPHIOrDbg() == &Inst;
// If there is a path from header to exit or latch that doesn't lead to our
// instruction's block, return false.
if (!allLoopPathsLeadToBlock(CurLoop, Inst.getParent(), DT))
return false;
return true;
return allLoopPathsLeadToBlock(CurLoop, Inst.getParent(), DT);
}