This removes the need to handle explicitely the presence or absence of bitcasts when typed pointers are used. It also takes into account the case where we have more than one use of load(call @llvm.amdgc.implicitarg.ptr())
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Some drive by comments
llvm/lib/Target/AMDGPU/AMDGPULowerKernelAttributes.cpp | ||
---|---|---|
84 | This function and uses are unrelated. | |
89 | This does break with the "unique" property below. Two users, one simple one not, will result in a load. Is that expected? | |
105 | A unique load reached via select or phi will not be detected. UniqueLoad && UniqueLoad != L can help with that. Style: I'd remove braces for single return conditionals. | |
138 | I would use the Attributor::checkForAllUses, also unsure why the loads need to be unique. Depending on the call AAPointerInfo would allow you to handle way more things without any of this manual tracing. Either seems to be a useful rewrite beyond the scope of this. Feel free to ignore for now. |
- Rename getUniqueLoadUser into getUniqueSimpleLoadUser.
- Consider the case where the UniqueLoad is 'found' twice.
- Style
llvm/lib/Target/AMDGPU/AMDGPULowerKernelAttributes.cpp | ||
---|---|---|
84 | I'm sorry, I do not understand this remark. What do you mean? | |
89 | It's ok if there is another non-simple load. In fact, this pass could be modified to support multiple loads. My guess is that for simplicity only one is supported for the moment. I renamed the function instead into getUniqueSimpleLoadUser | |
138 | I'm not familiar with it. I'm going to take a look at it. Thanks! |
llvm/lib/Target/AMDGPU/AMDGPULowerKernelAttributes.cpp | ||
---|---|---|
84 | The commit is about the load tracking and stripping. This change (outlining getBasePtrIntrinsic and using it) is unrelated to the content/description of the patch. Make it two patches instead. |
llvm/lib/Target/AMDGPU/AMDGPULowerKernelAttributes.cpp | ||
---|---|---|
84 | Oh! I agree. I created https://reviews.llvm.org/D135266 for that change. |
- Extend AMDGPULowerKernelAttributes to handle multiple occurrences of the attributes in the same function
- Fix reminder indices in test
- Add test-cases with multiple users, and more than one in a single function
This function and uses are unrelated.