Change isSafeToLoadUnconditionally arguments order. Separated from http://reviews.llvm.org/D10920.
llvm-svn: 257894
diff --git a/llvm/lib/Transforms/Scalar/SROA.cpp b/llvm/lib/Transforms/Scalar/SROA.cpp
index 4fa7a9f..bf3ec96 100644
--- a/llvm/lib/Transforms/Scalar/SROA.cpp
+++ b/llvm/lib/Transforms/Scalar/SROA.cpp
@@ -1193,7 +1193,7 @@
// is already a load in the block, then we can move the load to the pred
// block.
if (isDereferenceablePointer(InVal, DL) ||
- isSafeToLoadUnconditionally(InVal, TI, MaxAlign))
+ isSafeToLoadUnconditionally(InVal, MaxAlign, TI))
continue;
return false;
@@ -1274,10 +1274,10 @@
// absolutely (e.g. allocas) or at this point because we can see other
// accesses to it.
if (!TDerefable &&
- !isSafeToLoadUnconditionally(TValue, LI, LI->getAlignment()))
+ !isSafeToLoadUnconditionally(TValue, LI->getAlignment(), LI))
return false;
if (!FDerefable &&
- !isSafeToLoadUnconditionally(FValue, LI, LI->getAlignment()))
+ !isSafeToLoadUnconditionally(FValue, LI->getAlignment(), LI))
return false;
}
diff --git a/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
index 114d22d..0fc6953 100644
--- a/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
+++ b/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
@@ -1151,12 +1151,12 @@
// Both operands to the select need to be dereferencable, either absolutely
// (e.g. allocas) or at this point because we can see other accesses to it.
if (!TDerefable &&
- !isSafeToLoadUnconditionally(SI->getTrueValue(), LI,
- LI->getAlignment()))
+ !isSafeToLoadUnconditionally(SI->getTrueValue(), LI->getAlignment(),
+ LI))
return false;
if (!FDerefable &&
- !isSafeToLoadUnconditionally(SI->getFalseValue(), LI,
- LI->getAlignment()))
+ !isSafeToLoadUnconditionally(SI->getFalseValue(), LI->getAlignment(),
+ LI))
return false;
}
@@ -1230,7 +1230,7 @@
// If this pointer is always safe to load, or if we can prove that there is
// already a load in the block, then we can move the load to the pred block.
if (isDereferenceablePointer(InVal, DL) ||
- isSafeToLoadUnconditionally(InVal, Pred->getTerminator(), MaxAlign))
+ isSafeToLoadUnconditionally(InVal, MaxAlign, Pred->getTerminator()))
continue;
return false;
diff --git a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
index 4e84d72..c809944 100644
--- a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
@@ -455,8 +455,8 @@
// FIXME: Writes to memory only matter if they may alias the pointer
// being loaded from.
if (CI->mayWriteToMemory() ||
- !isSafeToLoadUnconditionally(L->getPointerOperand(), L,
- L->getAlignment()))
+ !isSafeToLoadUnconditionally(L->getPointerOperand(),
+ L->getAlignment(), L))
return false;
}
}