Make sure type is not extended or untyped before create a constant of the type. No...
authorEvan Cheng <evan.cheng@apple.com>
Tue, 26 Jun 2012 01:19:33 +0000 (01:19 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Tue, 26 Jun 2012 01:19:33 +0000 (01:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159179 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index 0bdd8b85497990005892f317e8427363995c1a13..28c3be9eb60c6d1847cfc949b1393f2c3163b49d 100644 (file)
@@ -5020,6 +5020,10 @@ SDValue DAGCombiner::ReduceLoadWidth(SDNode *N) {
   LoadSDNode *LN0 = cast<LoadSDNode>(N0);
   EVT PtrType = N0.getOperand(1).getValueType();
 
+  if (PtrType == MVT::Untyped || PtrType.isExtended())
+    // It's not possible to generate a constant of extended or untyped type.
+    return SDValue();
+
   // For big endian targets, we need to adjust the offset to the pointer to
   // load the correct bytes.
   if (TLI.isBigEndian()) {