[X86] Use cached OptForSize in X86ISelDAGToDAG.cpp instead of pulling it from the...
authorCraig Topper <craig.topper@intel.com>
Fri, 29 Mar 2019 18:36:40 +0000 (18:36 +0000)
committerCraig Topper <craig.topper@intel.com>
Fri, 29 Mar 2019 18:36:40 +0000 (18:36 +0000)
llvm-svn: 357297

llvm/lib/Target/X86/X86ISelDAGToDAG.cpp

index 1832cd2..444df1a 100644 (file)
@@ -2690,8 +2690,7 @@ bool X86DAGToDAGISel::foldLoadStoreIntoMemOperand(SDNode *Node) {
   case X86ISD::ADD:
   case X86ISD::SUB:
     // Try to match inc/dec.
-    if (!Subtarget->slowIncDec() ||
-        CurDAG->getMachineFunction().getFunction().optForSize()) {
+    if (!Subtarget->slowIncDec() || OptForSize) {
       bool IsOne = isOneConstant(StoredVal.getOperand(1));
       bool IsNegOne = isAllOnesConstant(StoredVal.getOperand(1));
       // ADD/SUB with 1/-1 and carry flag isn't used can use inc/dec.