[PATCH] D55507: [DAGCombiner] Use the result value type in visitCONCAT_VECTORS

Francis Visoiu Mistrih via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 10 06:36:58 PST 2018


This revision was automatically updated to reflect the committed changes.
thegameg marked 2 inline comments as done.
Closed by commit rL348759: [DAGCombiner] Use the result value type in visitCONCAT_VECTORS (authored by thegameg, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D55507?vs=177488&id=177501#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55507/new/

https://reviews.llvm.org/D55507

Files:
  llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/trunk/test/CodeGen/X86/combine-concatvectors.ll


Index: llvm/trunk/test/CodeGen/X86/combine-concatvectors.ll
===================================================================
--- llvm/trunk/test/CodeGen/X86/combine-concatvectors.ll
+++ llvm/trunk/test/CodeGen/X86/combine-concatvectors.ll
@@ -16,3 +16,44 @@
   store <8 x float> %ins2, <8 x float>* %out, align 32
   ret void
 }
+
+; Check that this does not fail to combine concat_vectors of a value from
+; merge_values through a bitcast.
+define void @d() personality i8* undef {
+; CHECK-LABEL: d:
+; CHECK:       # %bb.0: # %entry
+; CHECK-NEXT:    pushq %rax
+; CHECK-NEXT:    .cfi_def_cfa_offset 16
+; CHECK-NEXT:  .Ltmp0:
+; CHECK-NEXT:    callq *%rax
+; CHECK-NEXT:  .Ltmp1:
+; CHECK-NEXT:  # %bb.1: # %bar
+; CHECK-NEXT:  .Ltmp2:
+; CHECK-NEXT:    callq *%rax
+; CHECK-NEXT:  .Ltmp3:
+; CHECK-NEXT:  # %bb.2: # %baz
+; CHECK-NEXT:  .LBB1_3: # %foo
+; CHECK-NEXT:  .Ltmp4:
+entry:
+  %call16 = invoke { i8, double } undef()
+          to label %bar unwind label %foo
+
+foo:                                              ; preds = %bar, %entry
+  %0 = landingpad { i8*, i32 }
+          cleanup
+  br label %bazr
+
+bar:                                              ; preds = %entry
+  %1 = extractvalue { i8, double } %call16, 1
+  %2 = bitcast double %1 to <2 x float>
+  invoke void undef()
+          to label %baz unwind label %foo
+
+baz:                                              ; preds = %bar
+  %3 = extractelement <2 x float> %2, i64 0
+  br label %bazr
+
+bazr:                                             ; preds = %baz, %foo
+  %exn.obj = extractvalue { i8*, i32 } undef, 0
+  unreachable
+}
Index: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
===================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -16544,7 +16544,7 @@
           TLI.isTypeLegal(Scalar->getOperand(0).getValueType()))
         Scalar = Scalar->getOperand(0);
 
-      EVT SclTy = Scalar->getValueType(0);
+      EVT SclTy = Scalar.getValueType();
 
       if (!SclTy.isFloatingPoint() && !SclTy.isInteger())
         return SDValue();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55507.177501.patch
Type: text/x-patch
Size: 2166 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181210/5f1b6844/attachment.bin>


More information about the llvm-commits mailing list