mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
IfConversion's AnalyzeBlocks method always returns false; clean it up.
llvm-svn: 106027
This commit is contained in:
parent
fd75be1770
commit
81b428d9ad
@ -167,8 +167,7 @@ namespace {
|
|||||||
std::vector<IfcvtToken*> &Tokens);
|
std::vector<IfcvtToken*> &Tokens);
|
||||||
bool FeasibilityAnalysis(BBInfo &BBI, SmallVectorImpl<MachineOperand> &Cond,
|
bool FeasibilityAnalysis(BBInfo &BBI, SmallVectorImpl<MachineOperand> &Cond,
|
||||||
bool isTriangle = false, bool RevBranch = false);
|
bool isTriangle = false, bool RevBranch = false);
|
||||||
bool AnalyzeBlocks(MachineFunction &MF,
|
void AnalyzeBlocks(MachineFunction &MF, std::vector<IfcvtToken*> &Tokens);
|
||||||
std::vector<IfcvtToken*> &Tokens);
|
|
||||||
void InvalidatePreds(MachineBasicBlock *BB);
|
void InvalidatePreds(MachineBasicBlock *BB);
|
||||||
void RemoveExtraEdges(BBInfo &BBI);
|
void RemoveExtraEdges(BBInfo &BBI);
|
||||||
bool IfConvertSimple(BBInfo &BBI, IfcvtKind Kind);
|
bool IfConvertSimple(BBInfo &BBI, IfcvtKind Kind);
|
||||||
@ -253,7 +252,8 @@ bool IfConverter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
while (IfCvtLimit == -1 || (int)NumIfCvts < IfCvtLimit) {
|
while (IfCvtLimit == -1 || (int)NumIfCvts < IfCvtLimit) {
|
||||||
// Do an initial analysis for each basic block and find all the potential
|
// Do an initial analysis for each basic block and find all the potential
|
||||||
// candidates to perform if-conversion.
|
// candidates to perform if-conversion.
|
||||||
bool Change = AnalyzeBlocks(MF, Tokens);
|
bool Change = false;
|
||||||
|
AnalyzeBlocks(MF, Tokens);
|
||||||
while (!Tokens.empty()) {
|
while (!Tokens.empty()) {
|
||||||
IfcvtToken *Token = Tokens.back();
|
IfcvtToken *Token = Tokens.back();
|
||||||
Tokens.pop_back();
|
Tokens.pop_back();
|
||||||
@ -802,11 +802,9 @@ IfConverter::BBInfo &IfConverter::AnalyzeBlock(MachineBasicBlock *BB,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// AnalyzeBlocks - Analyze all blocks and find entries for all if-conversion
|
/// AnalyzeBlocks - Analyze all blocks and find entries for all if-conversion
|
||||||
/// candidates. It returns true if any CFG restructuring is done to expose more
|
/// candidates.
|
||||||
/// if-conversion opportunities.
|
void IfConverter::AnalyzeBlocks(MachineFunction &MF,
|
||||||
bool IfConverter::AnalyzeBlocks(MachineFunction &MF,
|
|
||||||
std::vector<IfcvtToken*> &Tokens) {
|
std::vector<IfcvtToken*> &Tokens) {
|
||||||
bool Change = false;
|
|
||||||
std::set<MachineBasicBlock*> Visited;
|
std::set<MachineBasicBlock*> Visited;
|
||||||
for (unsigned i = 0, e = Roots.size(); i != e; ++i) {
|
for (unsigned i = 0, e = Roots.size(); i != e; ++i) {
|
||||||
for (idf_ext_iterator<MachineBasicBlock*> I=idf_ext_begin(Roots[i],Visited),
|
for (idf_ext_iterator<MachineBasicBlock*> I=idf_ext_begin(Roots[i],Visited),
|
||||||
@ -818,8 +816,6 @@ bool IfConverter::AnalyzeBlocks(MachineFunction &MF,
|
|||||||
|
|
||||||
// Sort to favor more complex ifcvt scheme.
|
// Sort to favor more complex ifcvt scheme.
|
||||||
std::stable_sort(Tokens.begin(), Tokens.end(), IfcvtTokenCmp);
|
std::stable_sort(Tokens.begin(), Tokens.end(), IfcvtTokenCmp);
|
||||||
|
|
||||||
return Change;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// canFallThroughTo - Returns true either if ToBB is the next block after BB or
|
/// canFallThroughTo - Returns true either if ToBB is the next block after BB or
|
||||||
|
Loading…
x
Reference in New Issue
Block a user