aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2012-01-26 21:37:55 +0000
committerChris Lattner <sabre@nondot.org>2012-01-26 21:37:55 +0000
commit61a1d6cb81a14eb977d7278fbde7d563be280533 (patch)
tree21270e8a64127804370a106e240215be50abcdfa /llvm/lib/CodeGen/MachineFunction.cpp
parent49b1e38e4bee0f0c6f8b49e1a62d5284084e09e7 (diff)
downloadllvm-61a1d6cb81a14eb977d7278fbde7d563be280533.zip
llvm-61a1d6cb81a14eb977d7278fbde7d563be280533.tar.gz
llvm-61a1d6cb81a14eb977d7278fbde7d563be280533.tar.bz2
progress making the world safe to ConstantDataVector. While
we're at it, allow PatternMatch's "neg" pattern to match integer vector negations, and enhance ComputeNumSigned bits to handle shl of vectors. llvm-svn: 149082
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineFunction.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp
index 6bfd970..a720467 100644
--- a/llvm/lib/CodeGen/MachineFunction.cpp
+++ b/llvm/lib/CodeGen/MachineFunction.cpp
@@ -655,9 +655,12 @@ static bool CanShareConstantPoolEntry(const Constant *A, const Constant *B,
if (A->getType() == B->getType()) return false;
// For now, only support constants with the same size.
- if (TD->getTypeStoreSize(A->getType()) != TD->getTypeStoreSize(B->getType()))
+ uint64_t StoreSize = TD->getTypeStoreSize(A->getType());
+ if (StoreSize != TD->getTypeStoreSize(B->getType()) ||
+ StoreSize > 128)
return false;
+
// If a floating-point value and an integer value have the same encoding,
// they can share a constant-pool entry.
if (const ConstantFP *AFP = dyn_cast<ConstantFP>(A))