[PATCH] D137635: [CodeGen] Add sources to isVectorClearMaskLegal. NFC.

Han-Kuan Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 8 08:48:59 PST 2022


HanKuanChen added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:23166
 
+        SDValue BitCastN0 = DAG.getBitcast(IntVT, N0);
+        SDValue ZeroInIntVT = DAG.getConstant(0, DL, IntVT);
----------------
RKSimon wrote:
> How nasty would it be NOT to add the bitcast here at all and allow the N0/N1 operands into isVectorClearMaskLegal to keep their original types as long as they can safely be bitcasted to IntVT?
> 
> We'd still bitcast it as part of the getVectorShuffle call of course.
> How nasty would it be NOT to add the bitcast here at all and allow the N0/N1 operands into isVectorClearMaskLegal to keep their original types as long as they can safely be bitcasted to IntVT?

Is the reason we do this because we don't want a `DAG.RemoveDeadNode` in the end?
I wonder will this make people confused since it violates the vector_shuffle interface (return and inputs should have same type).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137635



More information about the llvm-commits mailing list