Partition use lists so defs always come before uses.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 9 Aug 2012 22:49:46 +0000 (22:49 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 9 Aug 2012 22:49:46 +0000 (22:49 +0000)
commit81a6995243380668e6f991fa4e11dd0a6e37e030
tree44dcd3571c6e0280d0ed7fbb9047d71d703ad1a3
parent46f4c35372062eaf097922b5683bc6639ccf342b
Partition use lists so defs always come before uses.

This makes it possible to speed up def_iterator by stopping at the first
use. This makes def_empty() and getUniqueVRegDef() much faster when
there are many uses.

In a +Asserts build, LiveVariables is 100x faster in one case because
getVRegDef() has an assertion that would scan to the end of a
def_iterator chain.

Spill weight calculation is significantly faster (300x in one case)
because isTriviallyReMaterializable() calls MRI->isConstantPhysReg(%RIP)
which calls def_empty(%RIP).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161634 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/MachineRegisterInfo.h
lib/CodeGen/MachineRegisterInfo.cpp
test/CodeGen/X86/apm.ll
test/CodeGen/X86/xor.ll