[llvm] r339147 - [DAG] Allow non-uniform constant vectors to call BuildSDIV
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 7 07:50:39 PDT 2018
Author: rksimon
Date: Tue Aug 7 07:50:39 2018
New Revision: 339147
URL: http://llvm.org/viewvc/llvm-project?rev=339147&view=rev
Log:
[DAG] Allow non-uniform constant vectors to call BuildSDIV
This was missed in D50185.
NFC until we add actual non-uniform support to BuildSDIV (similar BuildUDIV support in D49248) - for now it just early outs.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=339147&r1=339146&r2=339147&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Tue Aug 7 07:50:39 2018
@@ -3218,7 +3218,8 @@ SDValue DAGCombiner::visitSDIVLike(SDVal
// alternate sequence. Targets may check function attributes for size/speed
// trade-offs.
AttributeList Attr = DAG.getMachineFunction().getFunction().getAttributes();
- if (N1C && !TLI.isIntDivCheap(N->getValueType(0), Attr))
+ if (isConstantOrConstantVector(N1, /*NoOpaques*/ true) &&
+ !TLI.isIntDivCheap(N->getValueType(0), Attr))
if (SDValue Op = BuildSDIV(N))
return Op;
More information about the llvm-commits
mailing list