]> granicus.if.org Git - llvm/commitdiff
Addressing post-commit comments regarding not expanding UDIV;
authorSjoerd Meijer <sjoerd.meijer@arm.com>
Fri, 8 Jul 2016 14:17:09 +0000 (14:17 +0000)
committerSjoerd Meijer <sjoerd.meijer@arm.com>
Fri, 8 Jul 2016 14:17:09 +0000 (14:17 +0000)
we don't expand only when compiling for minimum code size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274847 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/ARM/urem-opt-size.ll

index 456c5498e3cdba1562d9dd37f364fada70d22856..2931ad276a484a44270639ae006d072d417d2a96 100644 (file)
@@ -14516,9 +14516,9 @@ SDValue DAGCombiner::BuildSDIVPow2(SDNode *N) {
 /// number.
 /// Ref: "Hacker's Delight" or "The PowerPC Compiler Writer's Guide".
 SDValue DAGCombiner::BuildUDIV(SDNode *N) {
-  // when optimising for size, we don't want to expand a div to a mul and
+  // when optimising for minimum size, we don't want to expand a div to a mul
   // and a shift.
-  if (ForCodeSize)
+  if (DAG.getMachineFunction().getFunction()->optForMinSize())
     return SDValue();
 
   ConstantSDNode *C = isConstOrConstSplat(N->getOperand(1));
index 4490a47093e0a480e9fc86efeba7bc4697272cb8..4c9aec10d0ffbaf7e4aa109f3a8c240b914984e0 100644 (file)
@@ -1,4 +1,4 @@
-; When optimising for size, we don't want to expand a div to a mul and
+; When optimising for minimum size, we don't want to expand a udiv to a mul
 ; and a shift sequence. As a result, the urem instruction will not be
 ; expanded to a sequence of umull, lsrs, muls and sub instructions, but
 ; just a call to __aeabi_uidivmod.