llvm-6502/test/CodeGen/Mips/msa
Daniel Sanders ea28aafa83 Fix illegal DAG produced by SelectionDAG::getConstant() for v2i64 type
Summary:
When getConstant() is called for an expanded vector type, it is split into
multiple scalar constants which are then combined using appropriate build_vector
and bitcast operations.

In addition to the usual big/little endian differences, the case where the
element-order of the vector does not have the same endianness as the elements
themselves is also accounted for.  For example, for v4i32 on big-endian MIPS,
the byte-order of the vector is <3210,7654,BA98,FEDC>. For little-endian, it is
<0123,4567,89AB,CDEF>.
Handling this case turns out to be a nop since getConstant() returns a splatted
vector (so reversing the element order doesn't change the value)

This fixes a number of cases in MIPS MSA where calling getConstant() during
operation legalization introduces illegal types (e.g. to legalize v2i64 UNDEF
into a v2i64 BUILD_VECTOR of illegal i64 zeros). It should also handle bigger
differences between illegal and legal types such as legalizing v2i64 into v8i16.

lowerMSASplatImm() in the MIPS backend no longer needs to avoid calling
getConstant() so this function has been updated in the same patch.

For the sake of transparency, the steps I've taken since the review are:
* Added 'virtual' to isVectorEltOrderLittleEndian() as requested. This revealed
  that the MIPS tests were falsely passing because a polymorphic function was
  not actually polymorphic in the reviewed patch.
* Fixed the tests that were now failing. This involved deleting the code to
  handle the MIPS MSA element-order (which was previously doing an byte-order
  swap instead of an element-order swap). This left
  isVectorEltOrderLittleEndian() unused and it was deleted.
* Fixed build failures caused by rebasing beyond r194467-r194472. These build
  failures involved the bset, bneg, and bclr instructions added in these commits
  using lowerMSASplatImm() in a way that was no longer valid after this patch.
  Some of these were fixed by calling SelectionDAG::getConstant() instead,
  others were fixed by a new function getBuildVectorSplat() that provided the
  removed functionality of lowerMSASplatImm() in a more sensible way.

Reviewers: bkramer

Reviewed By: bkramer

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1973

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194811 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15 12:56:49 +00:00
..
2r_vector_scalar.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
2r.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
2rf_exup.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
2rf_float_int.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
2rf_fq.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
2rf_int_float.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
2rf_tq.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
2rf.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
3r_4r_widen.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
3r_4r.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
3r_splat.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
3r-a.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
3r-b.ll Fix illegal DAG produced by SelectionDAG::getConstant() for v2i64 type 2013-11-15 12:56:49 +00:00
3r-c.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
3r-d.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
3r-i.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
3r-m.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
3r-p.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
3r-s.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
3r-v.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
3rf_4rf_q.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
3rf_4rf.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
3rf_exdo.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
3rf_float_int.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
3rf_int_float.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
3rf_q.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
3rf.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
arithmetic_float.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
arithmetic.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
basic_operations_float.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
basic_operations_little.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
basic_operations.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
bit.ll Fix illegal DAG produced by SelectionDAG::getConstant() for v2i64 type 2013-11-15 12:56:49 +00:00
bitcast.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
bitwise.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
compare_float.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
compare.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
elm_copy.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
elm_cxcmsa.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
elm_insv.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
elm_move.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
elm_shift_slide.ll Fix illegal DAG produced by SelectionDAG::getConstant() for v2i64 type 2013-11-15 12:56:49 +00:00
endian.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
i5_ld_st.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
i5-a.ll Fix illegal DAG produced by SelectionDAG::getConstant() for v2i64 type 2013-11-15 12:56:49 +00:00
i5-b.ll Fix illegal DAG produced by SelectionDAG::getConstant() for v2i64 type 2013-11-15 12:56:49 +00:00
i5-c.ll Fix illegal DAG produced by SelectionDAG::getConstant() for v2i64 type 2013-11-15 12:56:49 +00:00
i5-m.ll Fix illegal DAG produced by SelectionDAG::getConstant() for v2i64 type 2013-11-15 12:56:49 +00:00
i5-s.ll Fix illegal DAG produced by SelectionDAG::getConstant() for v2i64 type 2013-11-15 12:56:49 +00:00
i8.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
i10.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
inline-asm.ll [mips][msa] Enable inlinse assembly for MSA. 2013-11-12 12:56:01 +00:00
llvm-stress-s525530439.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
llvm-stress-s997348632.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
llvm-stress-s1704963983.ll Fix illegal DAG produced by SelectionDAG::getConstant() for v2i64 type 2013-11-15 12:56:49 +00:00
llvm-stress-s1935737938.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
llvm-stress-s3997499501.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
llvm-stress-sz1-s742806235.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
shift-dagcombine.ll Vector forms of SHL, SRA, and SRL can be constant folded using SimplifyVBinOp too 2013-11-11 17:23:41 +00:00
shuffle.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
special.ll [mips][msa] Added lsa instruction 2013-10-17 13:38:20 +00:00
spill.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00
vec.ll [mips][msa] Added support for matching bmnz, bmnzi, bmz, and bmzi from normal IR (i.e. not intrinsics) 2013-10-30 15:20:38 +00:00
vecs10.ll [mips][msa] Build all the tests in little and big endian modes and correct an incorrect test. 2013-11-15 11:04:16 +00:00