Fix visitTRUNCATE for legal i1 values
authorHal Finkel <hfinkel@anl.gov>
Fri, 28 Feb 2014 00:26:45 +0000 (00:26 +0000)
committerHal Finkel <hfinkel@anl.gov>
Fri, 28 Feb 2014 00:26:45 +0000 (00:26 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202449 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index 3a522105f905ccadfd43a80aa2bb65605ec0ee0e..50578502389c01cd5cb19af842fc2a0835de31a6 100644 (file)
@@ -5808,7 +5808,7 @@ SDValue DAGCombiner::visitTRUNCATE(SDNode *N) {
   // 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();