OSDN Git Service

[RegisterBankInfo] Cache the getMinimalPhysRegClass information
authorQuentin Colombet <qcolombet@apple.com>
Fri, 13 Oct 2017 21:16:15 +0000 (21:16 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Fri, 13 Oct 2017 21:16:15 +0000 (21:16 +0000)
commit92e9ed5a6ecec75f812081a027e80edb5d6c96a9
treec2a140f5574c47c854dc0b1dbae567d10ce019fe
parent5d72c6ca6b1c57ccbebcfc0ce0e6b94d8d266824
[RegisterBankInfo] Cache the getMinimalPhysRegClass information

TargetRegisterInfo::getMinimalPhysRegClass is actually pretty expensive
because it has to iterate over all the register classes.
Cache this information as we need and get it so that we limit its usage.
Right now, we heavily rely on it, because this is how we get the mapping
for vregs defined by copies from physreg (i.e., the one that are ABI
related).

Improve compile time by up to 10% for that pass.

NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315759 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h
lib/CodeGen/GlobalISel/RegBankSelect.cpp
lib/CodeGen/GlobalISel/RegisterBankInfo.cpp