mirror of
https://github.com/intel/llvm.git
synced 2026-01-17 06:40:01 +08:00
Fixes priority queue ordering in llvm-flo block reordering
Summary: Fixes a bug which caused the block reordering heuristic to put in the same cluster hot basic blocks and cold basic blocks, increasing I-cache misses. (cherry picked from FBD2588203)
This commit is contained in:
committed by
Maksim Panchenko
parent
d4d773458c
commit
2539539bde
@@ -590,7 +590,7 @@ void BinaryFunction::optimizeLayout() {
|
||||
std::map<EdgeTy, uint64_t> Weight;
|
||||
|
||||
// Define a comparison function to establish SWO between edges
|
||||
auto Comp = [&Weight](EdgeTy A, EdgeTy B) { return Weight[A] > Weight[B]; };
|
||||
auto Comp = [&Weight](EdgeTy A, EdgeTy B) { return Weight[A] < Weight[B]; };
|
||||
std::priority_queue<EdgeTy, std::vector<EdgeTy>, decltype(Comp)> Queue(Comp);
|
||||
|
||||
typedef std::vector<BinaryBasicBlock *> ClusterTy;
|
||||
|
||||
Reference in New Issue
Block a user