Currently memory attributions are not supported for gpu::LaunchOp, this patch implements memory attributions for gpu::LaunchOp and modifies the KernelOutlining pass to make the attributions available in GPUFuncOp.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Constructed explicitly the TypeRanges in outlineKernelFuncImpl when building gpu::GPUFuncOp.
mlir/test/Dialect/GPU/outlining.mlir | ||
---|---|---|
353 | Can you restrict the test to the memory attribution? It's not clear to me that we need to match every operands and other stuff here. | |
382 | Same here: I'm pretty sure we don't need all of these checks | |
396 | Can you clarify how are the checks above related to the attributions? |
mlir/test/Dialect/GPU/outlining.mlir | ||
---|---|---|
353 | These tests are variants from 2 existing tests in this file, my rationale was that I wanted to proof that adding the attributions doesn't mess with anything already existing. However I'll remove them. | |
396 | Yeah, I'm just realizing tests should be target for the specific feature. The only lines that truly tests are 391 and 403-404. I'll change the tests. |
LGTM
mlir/lib/Dialect/GPU/IR/GPUDialect.cpp | ||
---|---|---|
380 | I don't know if this is the kind of thing they're used for, but a LLVM_DEBUG(llvm::dbgs() << "Couldn't get AddressSpaceAttr for: " << type << "\n")(but then again there's no LLVM_DEBUG in this file at all so maybe such reporting isn't the current convention). | |
744 | You didn't do this but can you change this to say "all of them index types" (which also makes it clearer that the sentence is listing the region args). | |
780 | same here regarding plurals |
mlir/lib/Dialect/GPU/IR/GPUDialect.cpp | ||
---|---|---|
380 | All of these functions were already there, I just relocated them to the start of the file. Having said that, it might be a good idea to start introducing this kind of debug annotations. |
I don't know if this is the kind of thing they're used for, but a LLVM_DEBUG(llvm::dbgs() << "Couldn't get AddressSpaceAttr for: " << type << "\n")(but then again there's no LLVM_DEBUG in this file at all so maybe such reporting isn't the current convention).