[llvm-commits] Speeding up instruction selection

Chris Lattner clattner at apple.com
Thu Mar 6 11:21:33 PST 2008


On Mar 6, 2008, at 5:44 AM, Roman Levenstein wrote:

> Hi,
>
> One more observation:
> For big MBBs (like the one in big4,bc),
> llvm::SelectionDAG::ReplaceAllUsesOfValueWith can become a bottleneck
> if there are thousends of uses. SDNode.Uses is currently a
> small-vector, so that the deletion by means of removeUser is VERY,
> VERY slow.

If you are interested in this, it would be much better to use a linked  
data structure like LLVM Value/Use does and MachineRegisterInfo/ 
MachineOperand does.  This allows constant time for all def/use  
maintenance operations.

> With all my recent changes to ScheduleDAG and instruction selector,
> the compilation time for big4.bc went down from 45-50 seconds to 6-9
> seconds!!! This is almost a 10 times performance speed-up which makes
> the compiler much more scaleable.

Nice!  Does it also help more normal cases?  That would be excellent.   
All the work you're doing is also very helpful when we start putting  
multiple basic blocks at once in a selectiondag.  Thanks for working  
on this!

-Chris




More information about the llvm-commits mailing list