mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-17 06:33:21 +00:00
Override dominates and properlyDominates for SCEVAddRecExpr, as a
SCEVAddRecExpr doesn't necessarily dominate blocks merely dominated by all of its operands. This fixes an abort compiling 403.gcc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96056 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9c60f534cb
commit
39125d8ef9
@ -417,6 +417,10 @@ namespace llvm {
|
||||
|
||||
virtual bool isLoopInvariant(const Loop *QueryLoop) const;
|
||||
|
||||
bool dominates(BasicBlock *BB, DominatorTree *DT) const;
|
||||
|
||||
bool properlyDominates(BasicBlock *BB, DominatorTree *DT) const;
|
||||
|
||||
/// isAffine - Return true if this is an affine AddRec (i.e., it represents
|
||||
/// an expressions A+B*x where A and B are loop invariant values.
|
||||
bool isAffine() const {
|
||||
|
@ -312,6 +312,21 @@ bool SCEVAddRecExpr::isLoopInvariant(const Loop *QueryLoop) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
SCEVAddRecExpr::dominates(BasicBlock *BB, DominatorTree *DT) const {
|
||||
return DT->dominates(L->getHeader(), BB) &&
|
||||
SCEVNAryExpr::dominates(BB, DT);
|
||||
}
|
||||
|
||||
bool
|
||||
SCEVAddRecExpr::properlyDominates(BasicBlock *BB, DominatorTree *DT) const {
|
||||
// This uses a "dominates" query instead of "properly dominates" query because
|
||||
// the instruction which produces the addrec's value is a PHI, and a PHI
|
||||
// effectively properly dominates its entire containing block.
|
||||
return DT->dominates(L->getHeader(), BB) &&
|
||||
SCEVNAryExpr::properlyDominates(BB, DT);
|
||||
}
|
||||
|
||||
void SCEVAddRecExpr::print(raw_ostream &OS) const {
|
||||
OS << "{" << *Operands[0];
|
||||
for (unsigned i = 1, e = Operands.size(); i != e; ++i)
|
||||
|
Loading…
x
Reference in New Issue
Block a user