[PATCH] Fix illegal DAG produced by SelectionDAG::getConstant() for v2i64 type

Daniel Sanders daniel.sanders at imgtec.com
Wed Nov 6 07:17:22 PST 2013


  As discussed in the comments of D1971, Quentin's observation that 'virtual' was missing revealed a bug in the handling of big-endian vectors on MIPS MSA where it would reverse the endianness of the elements instead of the order of the elements, but would then go on to pass the MSA tests anyway because it was calling the generic implementation of isVectorEltOrderLittleEndian() instead of the MIPS one.

  I've replaced the incorrect code with a comment explaining that the element order needs to be reversed but no code is required to do so because getConstant() returns a splatted vector.

  Can you confirm that this version looks good?


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1021-1024
@@ +1020,6 @@
+    // to the endianness of the elements (because the BITCAST is itself a
+    // vector shuffle in this situation). However, we do not need any code to
+    // perform this reversal because getConstant() is producing a vector
+    // splat.
+    // This situation occurs in MIPS MSA.
+
----------------
These are the lines that changed


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

BRANCH
  msa/bugfix-getconstant2

ARCANIST PROJECT
  llvm



More information about the llvm-commits mailing list