summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-12-28 18:53:48 +0000
committerChris Lattner <sabre@nondot.org>2010-12-28 18:53:48 +0000
commit65a699d4d0639a7ff1d319fe94daf5b7ac060ca9 (patch)
tree5d7042ef23bdf2d0c217ad3039667f21f58ba16a /llvm/lib/Transforms
parent102bc019005ce5e41cee47226f54e1090893b3d4 (diff)
downloadbcm5719-llvm-65a699d4d0639a7ff1d319fe94daf5b7ac060ca9.tar.gz
bcm5719-llvm-65a699d4d0639a7ff1d319fe94daf5b7ac060ca9.zip
simplify this, isBytewiseValue handles the extra check. We still
check for "multiple of a byte" in size to make it clear that the >> 3 below is safe. llvm-svn: 122604
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
index 7565b705820..2b6723f0caf 100644
--- a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
@@ -164,12 +164,9 @@ bool LoopIdiomRecognize::processLoopStore(StoreInst *SI, const SCEV *BECount) {
Value *StoredVal = SI->getValueOperand();
Value *StorePtr = SI->getPointerOperand();
- // Check to see if the store updates all bits in memory. We don't want to
- // process things like a store of i3. We also require that the store be a
- // multiple of a byte.
+ // Reject stores that are so large that they overflow an unsigned.
uint64_t SizeInBits = TD->getTypeSizeInBits(StoredVal->getType());
- if ((SizeInBits & 7) || (SizeInBits >> 32) != 0 ||
- SizeInBits != TD->getTypeStoreSizeInBits(StoredVal->getType()))
+ if ((SizeInBits & 7) || (SizeInBits >> 32) != 0)
return false;
// See if the pointer expression is an AddRec like {base,+,1} on the current
OpenPOWER on IntegriCloud