summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/ScalarReplAggregates.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-10-05 05:54:46 +0000
committerChris Lattner <sabre@nondot.org>2009-10-05 05:54:46 +0000
commitcf0fe8d813727383d630055bb9d1cde21b00b7e7 (patch)
tree4ed7b0bdfe761ae52997a152437d00ddaae10360 /lib/Transforms/Scalar/ScalarReplAggregates.cpp
parent5f7962c1b6574e6d834925158886d7c0a1bab5dc (diff)
downloadllvm-cf0fe8d813727383d630055bb9d1cde21b00b7e7.tar.gz
llvm-cf0fe8d813727383d630055bb9d1cde21b00b7e7.tar.bz2
llvm-cf0fe8d813727383d630055bb9d1cde21b00b7e7.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83297 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/ScalarReplAggregates.cpp')
-rw-r--r--lib/Transforms/Scalar/ScalarReplAggregates.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/lib/Transforms/Scalar/ScalarReplAggregates.cpp
index 6d06959396..610d874b36 100644
--- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp
+++ b/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