[llvm-commits] [llvm] r123620 - in /llvm/trunk: lib/Target/CellSPU/SPUISelLowering.cpp test/CodeGen/CellSPU/stores.ll
Kalle Raiskila
kalle.raiskila at nokia.com
Mon Jan 17 03:59:20 PST 2011
Author: kraiskil
Date: Mon Jan 17 05:59:20 2011
New Revision: 123620
URL: http://llvm.org/viewvc/llvm-project?rev=123620&view=rev
Log:
Don't crash SPU BE with memory accesses with big alignmnet.
Modified:
llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp
llvm/trunk/test/CodeGen/CellSPU/stores.ll
Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=123620&r1=123619&r2=123620&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Mon Jan 17 05:59:20 2011
@@ -560,7 +560,7 @@
assert( LN->getAddressingMode() == ISD::UNINDEXED
&& "we should get only UNINDEXED adresses");
// clean aligned loads can be selected as-is
- if (InVT.getSizeInBits() == 128 && alignment == 16)
+ if (InVT.getSizeInBits() == 128 && (alignment%16) == 0)
return SDValue();
// Get pointerinfos to the memory chunk(s) that contain the data to load
@@ -573,7 +573,7 @@
SDValue basePtr = LN->getBasePtr();
SDValue rotate;
- if (alignment == 16) {
+ if ((alignment%16) == 0) {
ConstantSDNode *CN;
// Special cases for a known aligned load to simplify the base pointer
@@ -777,7 +777,7 @@
assert( SN->getAddressingMode() == ISD::UNINDEXED
&& "we should get only UNINDEXED adresses");
// clean aligned loads can be selected as-is
- if (StVT.getSizeInBits() == 128 && alignment == 16)
+ if (StVT.getSizeInBits() == 128 && (alignment%16) == 0)
return SDValue();
SDValue alignLoadVec;
@@ -785,7 +785,7 @@
SDValue the_chain = SN->getChain();
SDValue insertEltOffs;
- if (alignment == 16) {
+ if ((alignment%16) == 0) {
ConstantSDNode *CN;
// Special cases for a known aligned load to simplify the base pointer
// and insertion byte:
Modified: llvm/trunk/test/CodeGen/CellSPU/stores.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/stores.ll?rev=123620&r1=123619&r2=123620&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/CellSPU/stores.ll (original)
+++ llvm/trunk/test/CodeGen/CellSPU/stores.ll Mon Jan 17 05:59:20 2011
@@ -162,3 +162,12 @@
store i32 %val, i32*%ptr, align 2
ret void
}
+
+define void @store_v8( <8 x float> %val, <8 x float>* %ptr )
+{
+;CHECK: stq
+;CHECK: stq
+;CHECK: bi $lr
+ store <8 x float> %val, <8 x float>* %ptr
+ ret void
+}
More information about the llvm-commits
mailing list