mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 05:29:24 +00:00
Inline the fastpath of PATypeHolder::get(). This is a small speedup in
instcombine among other things. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54814 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
21066541ae
commit
3b12ab4519
@ -392,6 +392,17 @@ inline void PATypeHandle::removeUser() {
|
||||
|
||||
// Define inline methods for PATypeHolder.
|
||||
|
||||
/// get - This implements the forwarding part of the union-find algorithm for
|
||||
/// abstract types. Before every access to the Type*, we check to see if the
|
||||
/// type we are pointing to is forwarding to a new type. If so, we drop our
|
||||
/// reference to the type.
|
||||
///
|
||||
inline Type* PATypeHolder::get() const {
|
||||
const Type *NewTy = Ty->getForwardedType();
|
||||
if (!NewTy) return const_cast<Type*>(Ty);
|
||||
return *const_cast<PATypeHolder*>(this) = NewTy;
|
||||
}
|
||||
|
||||
inline void PATypeHolder::addRef() {
|
||||
assert(Ty && "Type Holder has a null type!");
|
||||
if (Ty->isAbstract())
|
||||
|
@ -34,21 +34,6 @@ using namespace llvm;
|
||||
AbstractTypeUser::~AbstractTypeUser() {}
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Type PATypeHolder Implementation
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
/// get - This implements the forwarding part of the union-find algorithm for
|
||||
/// abstract types. Before every access to the Type*, we check to see if the
|
||||
/// type we are pointing to is forwarding to a new type. If so, we drop our
|
||||
/// reference to the type.
|
||||
///
|
||||
Type* PATypeHolder::get() const {
|
||||
const Type *NewTy = Ty->getForwardedType();
|
||||
if (!NewTy) return const_cast<Type*>(Ty);
|
||||
return *const_cast<PATypeHolder*>(this) = NewTy;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Type Class Implementation
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
Loading…
Reference in New Issue
Block a user