[PATCH] [x86] Add a ZERO_EXTEND_VECTOR_INREG DAG node and use it when widening vector types to be legal and a ZERO_EXTEND node is encountered.
chandlerc at gmail.com
Wed Jul 9 03:52:23 PDT 2014
Comment at: lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp:745
@@ +744,3 @@
+ int ExtLaneScale = NumSrcElements / NumElements;
+ int EndianOffset = TLI.isBigEndian() ? ExtLaneScale - 1 : 0;
+ for (int i = 0; i < NumElements; ++i)
hfinkel at anl.gov wrote:
> Is the big-endian case covered by one of the existing regression tests?
No, I'm not aware of any way to write a big-endian test case that even produces a ZERO_EXTEND_VECTOR_INREG node. Until there is wider usage of widening legalization on big-endian targets, it isn't really possible to test this code.
I'm going to commit this for now (as it is dead code on BE targets) and let me know if you'd rather turn this into an assert that BE isn't implemented so we remember to add a test, or any other approach for big-endian. Writing a test that covers it is trivial, its just the challenge of even reaching the code.
Comment at: lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:2420
@@ +2419,3 @@
+ // If some legalization strategy other than widening is used on the operand,
+ // we can't safely assume that just zero-extending the low lanes in the
+ // correct transformation.
Filipe Cabecinhas wrote:
> s/in the/is the/?
Done when committed.
More information about the llvm-commits