llvm.org GIT mirror llvm / 1dc12aa
Give a small negative bias to giant edge bundles. This helps compile time when the greedy register allocator splits live ranges in giant functions. Without the bias, we would try to grow regions through the giant edge bundles, usually to find out that the region became too big and expensive. If a live range has many uses in blocks near the giant bundle, the small negative bias doesn't make a big difference, and we still consider regions including the giant edge bundle. Giant edge bundles are usually connected to landing pads or indirect branches. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157174 91177308-0d34-0410-b5e6-96231b3b80d8 Jakob Stoklund Olesen 8 years ago
2 changed file(s) with 12 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
4545 unsigned getNumBundles() const { return EC.getNumClasses(); }
4646
4747 /// getBlocks - Return an array of blocks that are connected to Bundle.
48 ArrayRef getBlocks(unsigned Bundle) { return Blocks[Bundle]; }
48 ArrayRef getBlocks(unsigned Bundle) const { return Blocks[Bundle]; }
4949
5050 /// getMachineFunction - Return the last machine function computed.
5151 const MachineFunction *getMachineFunction() const { return MF; }
206206 return;
207207 ActiveNodes->set(n);
208208 nodes[n].clear();
209
210 // Very large bundles usually come from big switches, indirect branches,
211 // landing pads, or loops with many 'continue' statements. It is difficult to
212 // allocate registers when so many different blocks are involved.
213 //
214 // Give a small negative bias to large bundles such that 1/32 of the
215 // connected blocks need to be interested before we consider expanding the
216 // region through the bundle. This helps compile time by limiting the number
217 // of blocks visited and the number of links in the Hopfield network.
218 if (bundles->getBlocks(n).size() > 100)
219 nodes[n].Bias = -0.0625f;
209220 }
210221
211222