[PATCH] D55883: [TargetLowering] Fix propagation of undefs in zero extension ops (PR40091)

Andrea Di Biagio via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 19 03:59:04 PST 2018


andreadb accepted this revision.
andreadb added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: lib/CodeGen/SelectionDAG/TargetLowering.cpp:1852-1866
+  case ISD::ZERO_EXTEND_VECTOR_INREG: {
+    APInt SrcUndef, SrcZero;
+    SDValue Src = Op.getOperand(0);
+    unsigned NumSrcElts = Src.getValueType().getVectorNumElements();
+    APInt DemandedSrcElts = DemandedElts.zextOrSelf(NumSrcElts);
+    if (SimplifyDemandedVectorElts(Src, DemandedSrcElts, SrcUndef,
+                                   SrcZero, TLO, Depth + 1))
----------------
You can probably try to merge this case with the previous one, since they have a lot of code in common.
That being said, I leave this decision to you. If you think it would make it less readable then it is fine to keep it like this.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D55883





More information about the llvm-commits mailing list