[llvm] r202449 - Fix visitTRUNCATE for legal i1 values

Hal Finkel hfinkel at anl.gov
Thu Feb 27 16:26:45 PST 2014


Author: hfinkel
Date: Thu Feb 27 18:26:45 2014
New Revision: 202449

URL: http://llvm.org/viewvc/llvm-project?rev=202449&view=rev
Log:
Fix visitTRUNCATE for legal i1 values

This extract-and-trunc vector optimization cannot work for i1 values as
currently implemented, and so I'm disabling this for now for i1 values. In the
future, this can be fixed properly.

Soon I'll commit support for i1 CR bit tracking in the PowerPC backend, and
this will be covered by one of the existing regression tests.

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=202449&r1=202448&r2=202449&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Feb 27 18:26:45 2014
@@ -5808,7 +5808,7 @@ SDValue DAGCombiner::visitTRUNCATE(SDNod
   // creates this pattern) and before operation legalization after which
   // we need to be more careful about the vector instructions that we generate.
   if (N0.getOpcode() == ISD::EXTRACT_VECTOR_ELT &&
-      LegalTypes && !LegalOperations && N0->hasOneUse()) {
+      LegalTypes && !LegalOperations && N0->hasOneUse() && VT != MVT::i1) {
 
     EVT VecTy = N0.getOperand(0).getValueType();
     EVT ExTy = N0.getValueType();





More information about the llvm-commits mailing list