diff options
author | Chris Lattner <sabre@nondot.org> | 2009-10-05 05:54:46 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-10-05 05:54:46 +0000 |
commit | fdd87907185162d3ffec237c426530d63c23bcca (patch) | |
tree | 764fe48a8294ae462f454fb0fd7f82e4f03bacca /llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp | |
parent | 3a2e503e33efdbf723f95fc592fe62335248b078 (diff) | |
download | bcm5719-llvm-fdd87907185162d3ffec237c426530d63c23bcca.tar.gz bcm5719-llvm-fdd87907185162d3ffec237c426530d63c23bcca.zip |
strength reduce a ton of type equality tests to check the typeid (Through
the new predicates I added) instead of going through a context and doing a
pointer comparison. Besides being cheaper, this allows a smart compiler
to turn the if sequence into a switch.
llvm-svn: 83297
Diffstat (limited to 'llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp index 6d069593969..610d874b368 100644 --- a/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp +++ b/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp @@ -1297,8 +1297,7 @@ static void MergeInType(const Type *In, uint64_t Offset, const Type *&VecTy, VecTy = VInTy; return; } - } else if (In == Type::getFloatTy(Context) || - In == Type::getDoubleTy(Context) || + } else if (In->isFloatTy() || In->isDoubleTy() || (isa<IntegerType>(In) && In->getPrimitiveSizeInBits() >= 8 && isPowerOf2_32(In->getPrimitiveSizeInBits()))) { // If we're accessing something that could be an element of a vector, see |