[PATCH] D49064: DAG: Add helper for creating shifts with correct type

Justin Bogner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 20 17:31:39 PDT 2018


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

Patch LGTM.

In https://reviews.llvm.org/D49064#1183446, @efriedma wrote:

> I'm not really a fan of the LegalTypes boolean; it's just asking for people to pass the wrong value.  Can we just check whether the type is legal, or something like that?


I agree the LegalTypes boolean isn't ideal, but it isn't actually being introduced here (getShiftAmount already had it) so I don't see that conversation as blocking for this change.



================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:571
     SDValue OddVal = DAG.getNode(ISD::SRL, DL, ValueVT, Val,
-                                 DAG.getIntPtrConstant(RoundBits, DL));
+      DAG.getShiftAmountConstant(RoundBits, ValueVT, DL, false));
+
----------------
Mark what the boolean argument is please (ie, /*LegalTypes=*/false or so)


https://reviews.llvm.org/D49064





More information about the llvm-commits mailing list