This contains the required pass for performing the 64bit integer division at the IR level. The algorithm has not been incorporated yet but just the skeleton is given for review.
Details
Diff Detail
Event Timeline
include/llvm/CodeGen/Passes.h | ||
---|---|---|
395–397 | These parts touching generic code should be removed since it is a backend pass now. The IDs etc. declarations should be only in AMDGPU.h | |
lib/Target/AMDGPU/AMDGPU.h | ||
88 | Description comments should be in the pass file instead | |
lib/Target/AMDGPU/AMDGPU64bitDivision.cpp | ||
8 ↗ | (On Diff #50381) | There should not be a free function like this. This should be a method of the pass |
lib/Target/AMDGPU/AMDGPU64bitDivision.h | ||
1–2 | This header is unnecessary, this can be done entirely in the one cpp file | |
3–6 | You don't need these | |
8–14 | Also any of these | |
lib/Target/AMDGPU/AMDGPUISelLowering.cpp | ||
256–257 | This looks like an unrelated change, and is also incorrect since this should work already. i32 has an instruction and i64 should already be expanded | |
257–260 | Random whitespace change | |
lib/Target/AMDGPU/AMDGPUIntegerDivisionPass.cpp | ||
1 | Name out of date | |
9–11 | This should have a description or be removed | |
13 | AMDGPU.h should be the first included file | |
27 | This should be all lower case and - separated, otherwise it won't really work as a -debug-only= argument | |
37 | This should be removed | |
67 | Dead code | |
70–74 | Dead code | |
90–91 | You're going to need to pre-increment this pointer to avoid iterator invalidation issues when you delete the original div instruction | |
93 | You can pre-increment the iterators to avoid skipping back to the beginning | |
106 | You can do Type->isIntegerTy(64) | |
150 | This shouldn't be here | |
lib/Target/AMDGPU/AMDGPUTargetMachine.cpp | ||
39 ↗ | (On Diff #50381) | Random whitespace |
56 ↗ | (On Diff #50381) | Comment not needed |
207 ↗ | (On Diff #50381) | Comments should never include names |
208 ↗ | (On Diff #50381) | I think this should be moved to addCodeGenPrepare after TargetPassConfig::addCodeGenPrepare() |
include/llvm/CodeGen/Passes.h | ||
---|---|---|
395–397 | Since this is a target specific pass the ID should be defined in AMDGPU.h like the other AMDGPU passes. | |
649–650 | This should go in AMDGPU.h too. | |
include/llvm/InitializePasses.h | ||
152 | This in AMDGPU.h too. | |
include/llvm/LinkAllPasses.h | ||
148–149 | I don't think this is needed. |
These parts touching generic code should be removed since it is a backend pass now. The IDs etc. declarations should be only in AMDGPU.h