[PATCH] D53478: [DAGCombine] SimplifyNodeWithTwoResults - ensure same legalization for LO/HI operands (PR21207)

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 21 05:36:48 PDT 2018


RKSimon created this revision.
RKSimon added reviewers: niravd, efriedma, spatel, resistor.

Back in 2014, https://reviews.llvm.org/rL199678 relaxed the HI operand to permit isOperationLegalOrCustom after op legalization without any test changes; but PR21207 is right - we shouldn't be creating custom operations after op legalization. This patch reverts https://reviews.llvm.org/rL199678.

I haven't been able to create a suitable test (same as https://reviews.llvm.org/rL199678 didn't cause any diffs), but PR21207 reports an out of tree issue and by inspection alone it appears to be the correct thing to do.


Repository:
  rL LLVM

https://reviews.llvm.org/D53478

Files:
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp


Index: lib/CodeGen/SelectionDAG/DAGCombiner.cpp
===================================================================
--- lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -3556,7 +3556,7 @@
   bool HiExists = N->hasAnyUseOfValue(1);
   if (!HiExists &&
       (!LegalOperations ||
-       TLI.isOperationLegalOrCustom(LoOp, N->getValueType(0)))) {
+       TLI.isOperationLegal(LoOp, N->getValueType(0)))) {
     SDValue Res = DAG.getNode(LoOp, SDLoc(N), N->getValueType(0), N->ops());
     return CombineTo(N, Res, Res);
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53478.170334.patch
Type: text/x-patch
Size: 572 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181021/38053274/attachment.bin>


More information about the llvm-commits mailing list