[PATCH] D79045: [X86] Don't return true from isTruncateFree for vectors

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 29 04:47:29 PDT 2020


RKSimon added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:30612
 bool X86TargetLowering::isTruncateFree(EVT VT1, EVT VT2) const {
-  if (!VT1.isInteger() || !VT2.isInteger())
-    return false;
-  // Truncate to mask registers aren't free.
-  // TODO: No vector truncates are free.
-  if (Subtarget.hasAVX512() && VT2.isVector() &&
-      VT2.getVectorElementType() == MVT::i1)
+  if (!VT1.isScalarInteger() || !VT2.isScalarInteger())
     return false;
----------------
Do we need some kind of hasSSE() check to prevent the i686 regression in llvm/test/CodeGen/X86/shift-combine.ll ?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79045/new/

https://reviews.llvm.org/D79045





More information about the llvm-commits mailing list