summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorMax Kazantsev <max.kazantsev@azul.com>2018-10-16 06:34:53 +0000
committerMax Kazantsev <max.kazantsev@azul.com>2018-10-16 06:34:53 +0000
commitc8466f937cc2dbc80412dcfcb1051bf74f399a80 (patch)
treebaff1a18c1a7ebbff438b03e7694640bfc014ebd /llvm/lib/Transforms
parentf12a43d38a51b18e0f6587483d221f981cb4a892 (diff)
downloadbcm5719-llvm-c8466f937cc2dbc80412dcfcb1051bf74f399a80.tar.gz
bcm5719-llvm-c8466f937cc2dbc80412dcfcb1051bf74f399a80.zip
[NFC] Turn isGuaranteedToExecute into a method
llvm-svn: 344587
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LICM.cpp6
-rw-r--r--llvm/lib/Transforms/Scalar/LoopUnswitch.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
index 601d49fc03f..9bf75a4ffbf 100644
--- a/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LICM.cpp
@@ -1116,7 +1116,7 @@ static void hoist(Instruction &I, const DominatorTree *DT, const Loop *CurLoop,
// The check on hasMetadataOtherThanDebugLoc is to prevent us from burning
// time in isGuaranteedToExecute if we don't actually have anything to
// drop. It is a compile time optimization, not required for correctness.
- !isGuaranteedToExecute(I, DT, CurLoop, SafetyInfo))
+ !SafetyInfo->isGuaranteedToExecute(I, DT, CurLoop))
I.dropUnknownNonDebugMetadata();
// Move the new node to the Preheader, before its terminator.
@@ -1150,7 +1150,7 @@ static bool isSafeToExecuteUnconditionally(Instruction &Inst,
return true;
bool GuaranteedToExecute =
- isGuaranteedToExecute(Inst, DT, CurLoop, SafetyInfo);
+ SafetyInfo->isGuaranteedToExecute(Inst, DT, CurLoop);
if (!GuaranteedToExecute) {
auto *LI = dyn_cast<LoadInst>(&Inst);
@@ -1408,7 +1408,7 @@ bool llvm::promoteLoopAccessesToScalars(
if (!DereferenceableInPH || !SafeToInsertStore ||
(InstAlignment > Alignment)) {
- if (isGuaranteedToExecute(*UI, DT, CurLoop, SafetyInfo)) {
+ if (SafetyInfo->isGuaranteedToExecute(*UI, DT, CurLoop)) {
DereferenceableInPH = true;
SafeToInsertStore = true;
Alignment = std::max(Alignment, InstAlignment);
diff --git a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
index 13e6bd13754..cd49f51283f 100644
--- a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
@@ -721,7 +721,7 @@ bool LoopUnswitch::processCurrentLoop() {
// This is a workaround for the discrepancy between LLVM IR and MSan
// semantics. See PR28054 for more details.
if (SanitizeMemory &&
- !isGuaranteedToExecute(*TI, DT, currentLoop, &SafetyInfo))
+ !SafetyInfo.isGuaranteedToExecute(*TI, DT, currentLoop))
continue;
if (BranchInst *BI = dyn_cast<BranchInst>(TI)) {
OpenPOWER on IntegriCloud