This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombiner] Use the result value type in visitCONCAT_VECTORS
ClosedPublic

Authored by thegameg on Dec 10 2018, 4:46 AM.

Details

Summary

This triggers an assert when combining concat_vectors of a bitcast of merge_values.

Assertion failed: (VT.isVector() && !Operand.getValueType().isVector() && (VT.getVectorElementType() == Operand.getValueType() || (VT.getVectorElementType().isInteger() && Operand.getValueType().isInteger() && VT.getVectorElementType().bitsLE(Operand.getValueType()))) && "Illegal SCALAR_TO_VECTOR node!"), function getNode, file ../lib/CodeGen/SelectionDAG/SelectionDAG.cpp, line 4172.

With asserts disabled, it fails to select:

fatal error: error in backend: Cannot select: 0x7ff19d000e90: i32 = any_extend 0x7ff19d000ae8
  0x7ff19d000ae8: f64,ch = CopyFromReg 0x7ff19d000c20:1, Register:f64 %1
    0x7ff19d000b50: f64 = Register %1
In function: d

Diff Detail

Repository
rL LLVM

Event Timeline

thegameg created this revision.Dec 10 2018, 4:46 AM
andreadb accepted this revision.Dec 10 2018, 5:13 AM
andreadb added a subscriber: andreadb.

I only have one comment. Otherwise, this LGTM. Thanks.

Please add your test case to the already existing combine-concatvectors.ll.

test/CodeGen/X86/combine-concat-vectors.ll
1 ↗(On Diff #177488)

You mean:

; RUN: llc -mtriple=x86_64-- < %s | FileCheck %s

That being said, there is already combine-concatvectors.ll. Your new test case should be added there.

This revision is now accepted and ready to land.Dec 10 2018, 5:13 AM
This revision was automatically updated to reflect the committed changes.
thegameg marked 2 inline comments as done.