[llvm-commits] [llvm] r159179 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Evan Cheng evan.cheng at apple.com
Mon Jun 25 18:19:33 PDT 2012


Author: evancheng
Date: Mon Jun 25 20:19:33 2012
New Revision: 159179

URL: http://llvm.org/viewvc/llvm-project?rev=159179&view=rev
Log:
Make sure type is not extended or untyped before create a constant of the type. No test case. Found by inspection.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=159179&r1=159178&r2=159179&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Mon Jun 25 20:19:33 2012
@@ -5020,6 +5020,10 @@
   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()) {





More information about the llvm-commits mailing list