]> granicus.if.org Git - llvm/commitdiff
VNCoercion: Make the function signatures all consistent
authorDaniel Berlin <dberlin@dberlin.org>
Sat, 11 Mar 2017 00:51:01 +0000 (00:51 +0000)
committerDaniel Berlin <dberlin@dberlin.org>
Sat, 11 Mar 2017 00:51:01 +0000 (00:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297537 91177308-0d34-0410-b5e6-96231b3b80d8

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

index d3c998fa8a8c3ce78dbe89087791cca676d257c0..edc63ca38dbd186e2193969e14fdd38a2e8dbe97 100644 (file)
@@ -53,7 +53,7 @@ Value *coerceAvailableValueToLoadType(Value *StoredVal, Type *LoadedTy,
 /// 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.
index b59531061670485c5af159795475f7c68640ebef..1208311fa3c3961d4661e8d36a466de29bbc9863 100644 (file)
@@ -832,7 +832,7 @@ bool GVN::AnalyzeLoadAvailability(LoadInst *LI, MemDepResult DepInfo,
       // 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;
index 38d26e922c385ca60e10f47c63732992e8651fdc..b317aa7e38a09b9f989ab5f545731b1dde3133af 100644 (file)
@@ -190,13 +190,12 @@ static int analyzeLoadFromClobberingWrite(Type *LoadTy, Value *LoadPtr,
 /// 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());