[PATCH] D49078: [CVP] Handle calls with void return value. No need to create CVPLattice state for it.

Xin Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 9 07:58:44 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL336551: [CVP] Handle calls with void return value. No need to create CVPLattice stateā€¦ (authored by trentxintong, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D49078?vs=154601&id=154608#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D49078

Files:
  llvm/trunk/lib/Transforms/IPO/CalledValuePropagation.cpp


Index: llvm/trunk/lib/Transforms/IPO/CalledValuePropagation.cpp
===================================================================
--- llvm/trunk/lib/Transforms/IPO/CalledValuePropagation.cpp
+++ llvm/trunk/lib/Transforms/IPO/CalledValuePropagation.cpp
@@ -268,6 +268,10 @@
 
     // If we can't track the function's return values, there's nothing to do.
     if (!F || !canTrackReturnsInterprocedurally(F)) {
+      // Void return, No need to create and update CVPLattice state as no one
+      // can use it.
+      if (I->getType()->isVoidTy())
+        return;
       ChangedValues[RegI] = getOverdefinedVal();
       return;
     }
@@ -283,6 +287,12 @@
       ChangedValues[RegFormal] =
           MergeValues(SS.getValueState(RegFormal), SS.getValueState(RegActual));
     }
+
+    // Void return, No need to create and update CVPLattice state as no one can
+    // use it.
+    if (I->getType()->isVoidTy())
+      return;
+
     ChangedValues[RegI] =
         MergeValues(SS.getValueState(RegI), SS.getValueState(RetF));
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49078.154608.patch
Type: text/x-patch
Size: 1035 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180709/262cd315/attachment.bin>


More information about the llvm-commits mailing list