aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNadav Rotem <nadav.rotem@intel.com>2011-09-21 08:45:10 +0000
committerNadav Rotem <nadav.rotem@intel.com>2011-09-21 08:45:10 +0000
commit9c6cdf4c1c82842a97e02bef4cef2431ad2e61a3 (patch)
treed20d167bf3c5c409345c86de85c1b166ceb1dcb4
parentb5b8d20ddd287992ee286bf5f4d059fd527823ad (diff)
Insert a sanity check on the combining of x86 truncing-store nodes. This comes to replace the problematic check that was removed in r139995.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140246 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/X86/X86ISelLowering.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp
index 175d23750e..f7aae14bba 100644
--- a/lib/Target/X86/X86ISelLowering.cpp
+++ b/lib/Target/X86/X86ISelLowering.cpp
@@ -13563,6 +13563,9 @@ static SDValue PerformSTORECombine(SDNode *N, SelectionDAG &DAG,
// From, To sizes and ElemCount must be pow of two
if (!isPowerOf2_32(NumElems * FromSz * ToSz)) return SDValue();
+ // We are going to use the original vector elt for storing.
+ // accumulated smaller vector elements must be a multiple of the store size.
+ if (0 != (NumElems * FromSz) % ToSz) return SDValue();
unsigned SizeRatio = FromSz / ToSz;