[PATCH] D47959: [DAG] Avoid needing to walk out legalization tables. NFCI.

Justin Bogner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 13 14:37:44 PDT 2018


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

A couple of very minor nitpicks about use of auto, below, but overall this looks very nice. LGTM.



================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:102
+        auto NewValId = ReplacedValues[ResId];
+        DenseMap<TableId, TableId>::iterator I = ReplacedValues.find(NewValId);
         while (I != ReplacedValues.end()) {
----------------
Better to use auto for iterators.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h:259-260
   SDValue GetPromotedInteger(SDValue Op) {
-    SDValue &PromotedOp = PromotedIntegers[Op];
-    RemapValue(PromotedOp);
+    auto &PromotedId = PromotedIntegers[getTableId(Op)];
+    auto PromotedOp = getSDValue(PromotedId);
     assert(PromotedOp.getNode() && "Operand wasn't promoted?");
----------------
I'd probably spell out the types here - it isn't any longer and it's arguably slightly easier to read. Similarly in a few places below, especially in the cases that currently mix using auto and spelling out SDValue.


Repository:
  rL LLVM

https://reviews.llvm.org/D47959





More information about the llvm-commits mailing list