mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-23 01:25:32 +00:00
Now that we have C++11, turn simple functors into lambdas and remove a ton of boilerplate.
No intended functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202588 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1682,16 +1682,6 @@ Value *BoUpSLP::vectorizeTree() {
|
||||
return VectorizableTree[0].VectorizedValue;
|
||||
}
|
||||
|
||||
class DTCmp {
|
||||
const DominatorTree *DT;
|
||||
|
||||
public:
|
||||
DTCmp(const DominatorTree *DT) : DT(DT) {}
|
||||
bool operator()(const BasicBlock *A, const BasicBlock *B) const {
|
||||
return DT->properlyDominates(A, B);
|
||||
}
|
||||
};
|
||||
|
||||
void BoUpSLP::optimizeGatherSequence() {
|
||||
DEBUG(dbgs() << "SLP: Optimizing " << GatherSeq.size()
|
||||
<< " gather sequences instructions.\n");
|
||||
@@ -1730,7 +1720,10 @@ void BoUpSLP::optimizeGatherSequence() {
|
||||
// Sort blocks by domination. This ensures we visit a block after all blocks
|
||||
// dominating it are visited.
|
||||
SmallVector<BasicBlock *, 8> CSEWorkList(CSEBlocks.begin(), CSEBlocks.end());
|
||||
std::stable_sort(CSEWorkList.begin(), CSEWorkList.end(), DTCmp(DT));
|
||||
std::stable_sort(CSEWorkList.begin(), CSEWorkList.end(),
|
||||
[this](const BasicBlock *A, const BasicBlock *B) {
|
||||
return DT->properlyDominates(A, B);
|
||||
});
|
||||
|
||||
// Perform O(N^2) search over the gather sequences and merge identical
|
||||
// instructions. TODO: We can further optimize this scan if we split the
|
||||
|
Reference in New Issue
Block a user