[PATCH] D34990: Fix endianness bug in DAGCombiner::visitTRUNCATE

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 9 06:15:06 PDT 2017


RKSimon added a reviewer: RKSimon.
RKSimon added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:8377
       EVT IdxVT = TLI.getVectorIdxTy(DAG.getDataLayout());
+      unsigned Idx = DAG.getDataLayout().isBigEndian() ? 1 : 0;
       return DAG.getNode(ISD::EXTRACT_VECTOR_ELT, SL, VT,
----------------
I'm not sure this is generally correct - for example what about the (i16 trunc (i64 (bitcast v4i16:x))) case? Shouldn't the extracted big-endian index then be 3?


https://reviews.llvm.org/D34990





More information about the llvm-commits mailing list