[llvm] 6547a5c - [DAG] Add TODO comment regarding ADD(X,X) -> SHL(X,1) canonicalization
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 30 04:58:54 PDT 2020
Author: Simon Pilgrim
Date: 2020-04-30T12:57:16+01:00
New Revision: 6547a5ceb2213dc49ba2b8a7d98913b39cb331d9
URL: https://github.com/llvm/llvm-project/commit/6547a5ceb2213dc49ba2b8a7d98913b39cb331d9
DIFF: https://github.com/llvm/llvm-project/commit/6547a5ceb2213dc49ba2b8a7d98913b39cb331d9.diff
LOG: [DAG] Add TODO comment regarding ADD(X,X) -> SHL(X,1) canonicalization
As discussed on D78935
Added:
Modified:
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 9042f519d8de..9b00ff84300b 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -6098,6 +6098,7 @@ static SDValue extractShiftForRotate(SelectionDAG &DAG, SDValue OppShift,
ConstantSDNode *OppShiftCst = isConstOrConstSplat(OppShift.getOperand(1));
// (add v v) -> (shl v 1)
+ // TODO: Should this be a general DAG canonicalization?
if (OppShift.getOpcode() == ISD::SRL && OppShiftCst &&
ExtractFrom.getOpcode() == ISD::ADD &&
ExtractFrom.getOperand(0) == ExtractFrom.getOperand(1) &&
More information about the llvm-commits
mailing list