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

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 8 09:00:41 PST 2022


RKSimon 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);
----------------
HanKuanChen wrote:
> 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).
Mainly I'm expecting this to go wrong in the future :-( I'm not sure we should be encouraging creation/deletion of temporary nodes like this just for an analysis call.


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