Details
- Reviewers
JonChesterfield arsenm
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Some comments inline.
If this corrects behaviour as described in the comment, it needs tests. I can't see a behaviour change in the diff.
If it's a non functional refactor, I think it makes the code substantially less legible than it was before. Especially dislike using multiple booleans for control flow.
llvm/lib/Target/AMDGPU/Utils/AMDGPULDSUtils.cpp | ||
---|---|---|
59 | Changing from User to GlobalVariable seems reasonable in itself | |
61 | Why all these booleans? They make the control flow more complicated, but after staring at it for a while, don't appear to do anything different to the 'continue' we had before. | |
68 | Do you know of prior art for this style of commenting? In general I like comments to describe the 'why', and only the 'what' if the implementation is very complicated. I don't think llvm does much of the /* this code will do foo */ do_foo() style. | |
112 | this comment is worse than the equivalent code immediately above since it refers to 3 instead of the named value | |
115 | Moving the predicate (the long sequence of tests) into a separate function seems OK. Should be s/continue/return false/g | |
136 | Changing from none of (use requires lowering) to if (can skip) seems ok, not sure if makes any difference | |
llvm/lib/Target/AMDGPU/Utils/AMDGPULDSUtils.h | ||
25–26 | I don't think these benefit from comments. Not sure what 'required' can mean in the context of getAlign. Perhaps the clearer thing to do is put the one line functions in the header directly |
I am confused myself now. I am not able to recollect what was forced me to change the code here. When, I was working on the changes for D91516, there was some test it forced my to re-arrange the code as I did here. Anyhow, let's hold this patch for now, and come back to it, when D91516 necessitates it.
Fixed review comments by Jon - Removed all the new code changes, and have made a small cosmetic
changes to original code.
I will be abondaning this patch for now, since there is no much clarity about this patch at the moment. I will reopen a new patch when the need arises with much clarity and needed lit tests.
I don't think these benefit from comments. Not sure what 'required' can mean in the context of getAlign. Perhaps the clearer thing to do is put the one line functions in the header directly