[llvm] r297537 - VNCoercion: Make the function signatures all consistent

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 10 16:51:01 PST 2017


Author: dannyb
Date: Fri Mar 10 18:51:01 2017
New Revision: 297537

URL: http://llvm.org/viewvc/llvm-project?rev=297537&view=rev
Log:
VNCoercion: Make the function signatures all consistent

Modified:
    llvm/trunk/include/llvm/Transforms/Utils/VNCoercion.h
    llvm/trunk/lib/Transforms/Scalar/GVN.cpp
    llvm/trunk/lib/Transforms/Utils/VNCoercion.cpp

Modified: llvm/trunk/include/llvm/Transforms/Utils/VNCoercion.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/VNCoercion.h?rev=297537&r1=297536&r2=297537&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/Utils/VNCoercion.h (original)
+++ llvm/trunk/include/llvm/Transforms/Utils/VNCoercion.h Fri Mar 10 18:51:01 2017
@@ -53,7 +53,7 @@ Value *coerceAvailableValueToLoadType(Va
 /// On success, it returns the offset into DepSI that extraction would start.
 /// On failure, it returns -1.
 int analyzeLoadFromClobberingStore(Type *LoadTy, Value *LoadPtr,
-                                   StoreInst *DepSI);
+                                   StoreInst *DepSI, const DataLayout &DL);
 
 /// This function determines whether a value for the pointer LoadPtr can be
 /// extracted from the load at DepLI.

Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=297537&r1=297536&r2=297537&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Fri Mar 10 18:51:01 2017
@@ -832,7 +832,7 @@ bool GVN::AnalyzeLoadAvailability(LoadIn
       // Can't forward from non-atomic to atomic without violating memory model.
       if (Address && LI->isAtomic() <= DepSI->isAtomic()) {
         int Offset =
-          analyzeLoadFromClobberingStore(LI->getType(), Address, DepSI);
+          analyzeLoadFromClobberingStore(LI->getType(), Address, DepSI, DL);
         if (Offset != -1) {
           Res = AvailableValue::get(DepSI->getValueOperand(), Offset);
           return true;

Modified: llvm/trunk/lib/Transforms/Utils/VNCoercion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/VNCoercion.cpp?rev=297537&r1=297536&r2=297537&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/VNCoercion.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/VNCoercion.cpp Fri Mar 10 18:51:01 2017
@@ -190,13 +190,12 @@ static int analyzeLoadFromClobberingWrit
 /// This function is called when we have a
 /// memdep query of a load that ends up being a clobbering store.
 int analyzeLoadFromClobberingStore(Type *LoadTy, Value *LoadPtr,
-                                   StoreInst *DepSI) {
+                                   StoreInst *DepSI, const DataLayout &DL) {
   // Cannot handle reading from store of first-class aggregate yet.
   if (DepSI->getValueOperand()->getType()->isStructTy() ||
       DepSI->getValueOperand()->getType()->isArrayTy())
     return -1;
 
-  const DataLayout &DL = DepSI->getModule()->getDataLayout();
   Value *StorePtr = DepSI->getPointerOperand();
   uint64_t StoreSize =
       DL.getTypeSizeInBits(DepSI->getValueOperand()->getType());




More information about the llvm-commits mailing list