-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combine DMA loads #146
base: master
Are you sure you want to change the base?
Combine DMA loads #146
Changes from all commits
ad654ba
b83a38a
77150c6
76952cf
a5fd0d3
57f4bff
a5a1397
408477a
0a46290
7a31e86
70d1d85
fd9fed0
c39687c
2d18ead
c7358c3
a055fbe
6ca4768
4bb82e9
86cf23b
efebd92
59cd141
28de130
3b3bfb7
e96cd41
99961e7
90c50ca
6237397
998e468
6e5fafa
414e448
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,20 +16,25 @@ | |
#include "../optimization/ControlFlow.h" | ||
#include "../optimization/Eliminator.h" | ||
#include "../optimization/Reordering.h" | ||
#include "../intermediate/operators.h" | ||
#include "../spirv/SPIRVBuiltins.h" | ||
#include "Inliner.h" | ||
#include "LiteralValues.h" | ||
#include "LongOperations.h" | ||
#include "MemoryAccess.h" | ||
#include "Rewrite.h" | ||
|
||
#include "../optimization/Combiner.h" | ||
|
||
#include "log.h" | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
using namespace vc4c; | ||
using namespace vc4c::normalization; | ||
using namespace vc4c::periphery; | ||
using namespace vc4c::operators; | ||
|
||
static bool checkWorkGroupUniform(const Value& arg) | ||
{ | ||
|
@@ -253,6 +258,16 @@ void Normalizer::normalize(Module& module) const | |
PROFILE_COUNTER_WITH_PREV(vc4c::profiler::COUNTER_NORMALIZATION + 2, "Eliminate Phi-nodes (after)", | ||
method->countInstructions(), vc4c::profiler::COUNTER_NORMALIZATION + 1); | ||
} | ||
|
||
{ | ||
// TODO: move this optimization to appropriate location | ||
auto kernels = module.getKernels(); | ||
for(Method* kernelFunc : kernels) | ||
{ | ||
optimizations::combineDMALoads(module, *kernelFunc, config); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this code have to be run before the normalization steps (e.g. before the memory accesses are rewritten)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. It is easy to combine There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please add this to a comment |
||
} | ||
} | ||
|
||
auto kernels = module.getKernels(); | ||
// 2. inline kernel-functions | ||
for(Method* kernelFunc : kernels) | ||
|
@@ -266,6 +281,7 @@ void Normalizer::normalize(Module& module) const | |
PROFILE_COUNTER_WITH_PREV(vc4c::profiler::COUNTER_NORMALIZATION + 5, "Inline (after)", | ||
kernel.countInstructions(), vc4c::profiler::COUNTER_NORMALIZATION + 4); | ||
} | ||
|
||
// 3. run other normalization steps on kernel functions | ||
const auto f = [&module, this](Method* kernelFunc) -> void { normalizeMethod(module, *kernelFunc); }; | ||
ThreadPool::scheduleAll<Method*>("Normalization", kernels, f, THREAD_LOGGER.get()); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these signed or unsigned? Can you please name them correctly and add a comment?