[Openmp-commits] [PATCH] D106845: [OpenMP] Try to simplify all loads in device code
Johannes Doerfert via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Mon Jul 26 23:45:54 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG70b75f62fc61: [OpenMP] Try to simplify all loads in device code (authored by jdoerfert).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106845/new/
https://reviews.llvm.org/D106845
Files:
llvm/include/llvm/Transforms/IPO/Attributor.h
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
Index: llvm/lib/Transforms/IPO/OpenMPOpt.cpp
===================================================================
--- llvm/lib/Transforms/IPO/OpenMPOpt.cpp
+++ llvm/lib/Transforms/IPO/OpenMPOpt.cpp
@@ -3991,11 +3991,23 @@
// Create an ExecutionDomain AA for every function and a HeapToStack AA for
// every function if there is a device kernel.
+ if (!isOpenMPDevice(M))
+ return;
+
for (auto *F : SCC) {
- if (!F->isDeclaration())
- A.getOrCreateAAFor<AAExecutionDomain>(IRPosition::function(*F));
- if (isOpenMPDevice(M))
- A.getOrCreateAAFor<AAHeapToStack>(IRPosition::function(*F));
+ if (F->isDeclaration())
+ continue;
+
+ A.getOrCreateAAFor<AAExecutionDomain>(IRPosition::function(*F));
+ A.getOrCreateAAFor<AAHeapToStack>(IRPosition::function(*F));
+
+ for (auto &I : instructions(*F)) {
+ if (auto *LI = dyn_cast<LoadInst>(&I)) {
+ bool UsedAssumedInformation = false;
+ A.getAssumedSimplified(IRPosition::value(*LI), /* AA */ nullptr,
+ UsedAssumedInformation);
+ }
+ }
}
}
Index: llvm/include/llvm/Transforms/IPO/Attributor.h
===================================================================
--- llvm/include/llvm/Transforms/IPO/Attributor.h
+++ llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -1544,6 +1544,13 @@
UsedAssumedInformation);
}
+ /// If \p V is assumed simplified, return it, if it is unclear yet,
+ /// return None, otherwise return `nullptr`. Same as the public version
+ /// except that it can be used without recording dependences on any \p AA.
+ Optional<Value *> getAssumedSimplified(const IRPosition &V,
+ const AbstractAttribute *AA,
+ bool &UsedAssumedInformation);
+
/// Register \p CB as a simplification callback.
/// `Attributor::getAssumedSimplified` will use these callbacks before
/// we it will ask `AAValueSimplify`. It is important to ensure this
@@ -1561,13 +1568,6 @@
DenseMap<IRPosition, SmallVector<SimplifictionCallbackTy, 1>>
SimplificationCallbacks;
- /// If \p V is assumed simplified, return it, if it is unclear yet,
- /// return None, otherwise return `nullptr`. Same as the public version
- /// except that it can be used without recording dependences on any \p AA.
- Optional<Value *> getAssumedSimplified(const IRPosition &V,
- const AbstractAttribute *AA,
- bool &UsedAssumedInformation);
-
public:
/// Translate \p V from the callee context into the call site context.
Optional<Value *>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106845.361917.patch
Type: text/x-patch
Size: 2693 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210727/98fb17f5/attachment.bin>
More information about the Openmp-commits
mailing list