diff options
| author | Lang Hames <lhames@gmail.com> | 2010-07-17 06:31:41 +0000 |
|---|---|---|
| committer | Lang Hames <lhames@gmail.com> | 2010-07-17 06:31:41 +0000 |
| commit | 211e7ce7e7e4cc1e0a719d97c884ba7928e64cb7 (patch) | |
| tree | d7b06687a94b1004638e19287c500c3bbd7a598c /llvm/lib/CodeGen/RegAllocPBQP.cpp | |
| parent | 9de5967244a57beee5e0531c4b75ce38976da39f (diff) | |
| download | bcm5719-llvm-211e7ce7e7e4cc1e0a719d97c884ba7928e64cb7.tar.gz bcm5719-llvm-211e7ce7e7e4cc1e0a719d97c884ba7928e64cb7.zip | |
Iterating over sets of pointers in a heuristic was a bad idea. Switching
any command line paramater changed the register allocation produced by
PBQP.
Turns out variety is not the spice of life.
Fixed some comparators, added others. All good now.
llvm-svn: 108613
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocPBQP.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/RegAllocPBQP.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/RegAllocPBQP.cpp b/llvm/lib/CodeGen/RegAllocPBQP.cpp index 45104b48fe4..a7ea8e7c3ad 100644 --- a/llvm/lib/CodeGen/RegAllocPBQP.cpp +++ b/llvm/lib/CodeGen/RegAllocPBQP.cpp @@ -104,7 +104,15 @@ namespace { virtual bool runOnMachineFunction(MachineFunction &MF); private: - typedef std::map<const LiveInterval*, unsigned> LI2NodeMap; + + class LIOrdering { + public: + bool operator()(const LiveInterval *li1, const LiveInterval *li2) const { + return li1->reg < li2->reg; + } + }; + + typedef std::map<const LiveInterval*, unsigned, LIOrdering> LI2NodeMap; typedef std::vector<const LiveInterval*> Node2LIMap; typedef std::vector<unsigned> AllowedSet; typedef std::vector<AllowedSet> AllowedSetMap; @@ -112,7 +120,7 @@ namespace { typedef std::pair<unsigned, unsigned> RegPair; typedef std::map<RegPair, PBQP::PBQPNum> CoalesceMap; - typedef std::set<LiveInterval*> LiveIntervalSet; + typedef std::set<LiveInterval*, LIOrdering> LiveIntervalSet; typedef std::vector<PBQP::Graph::NodeItr> NodeVector; |

