[PATCH] D24956: [SelectionDAG] Add expansion and promotion of [US]MUL_LOHI

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 22 15:23:47 PST 2016


efriedma added a comment.

Sorry about the delay...

Have you seen https://reviews.llvm.org/D26628 ?  Does that interact with the patch in any way?

TargetLowering::expandMUL_LOHI is kind of difficult to review with all the different unrelated changes involved; would it be possible to separate out the non-functional changes?



================
Comment at: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:3340
+    SmallVector<SDValue, 4> Halves;
+    EVT HalfType = EVT(VT).getHalfSizedIntegerVT(*DAG.getContext());
+    if (TLI.expandMUL_LOHI(Node->getOpcode(), VT, Node, LHS, RHS, Halves,
----------------
Maybe add an assertion here that HalfType is a legal type?  Some architectures could trip over this...


================
Comment at: lib/CodeGen/SelectionDAG/TargetLowering.cpp:3257
+                           DAG, OnlyLegalOrCustom, LL, LH, RL, RH);
+  if (Result.size() >= 2) {
+    Lo = Result[0];
----------------
Should there be an assertion here?  If expandMUL_LOHI isn't returning exactly two results, something went wrong.


https://reviews.llvm.org/D24956





More information about the llvm-commits mailing list