[PATCH] D27154: [CodeGen] Fix result type for SMULO/UMULO legalization

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 28 12:18:35 PST 2016


efriedma added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:3521
+    EVT RType = Node->getValueType(1);
+    EVT OType = getSetCCResultType(VT);
+    if (RType.getSizeInBits() < OType.getSizeInBits())
----------------
Isn't OType just TopHalf.getType()?


================
Comment at: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:3523
+    if (RType.getSizeInBits() < OType.getSizeInBits())
+      TopHalf = DAG.getNode(ISD::TRUNCATE, dl, RType, TopHalf);
+
----------------
Please add an assertion that RType.getSizeInBits() <= OType.getSizeInBits(), just in case someone runs into it.


https://reviews.llvm.org/D27154





More information about the llvm-commits mailing list