Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | ||
---|---|---|
5086 | You don't need "OrTrunc" here and below. |
Thanks for reviews.
Made suggested changes.
I'll add some test cases as well - but I'm off for a few days. I'll do it on return.
Do you have any in mind? I can add SSE2 vector examples if that would help? But scalars are trickier
You can simplify the test case to:
define amdgpu_cs i64 @main(i64 %arg) { entry: %d = udiv i64 %arg, 100000 ret i64 %d }
and it still shows the effect. Surely there are already some tests for i64 divide-by-constant that you could tweak, rather than adding a whole new file.
llvm/test/CodeGen/AMDGPU/dagcombine-mulhs-const.ll | ||
---|---|---|
5 | Obviously folding the mul_hi is good, but the s_add that you check for looks like this: s_mov_b32 s0, 0x346d900 ... s_add_u32 s0, 0x4237, s0 so it should also be folded to a constant! |
@dstuttard Please can you rebase? rGcc38f8939da4aec85e7d0ef4de412e30d4de5a14 should give you vector coverage
llvm/test/CodeGen/AMDGPU/dagcombine-mulhs-const.ll | ||
---|---|---|
5 | Yes - that could be another one to do - then fix up this test (or not worry about it at all given that there's now an X86 test that tests this, thanks to Simon) |
llvm/test/CodeGen/AMDGPU/udiv.ll | ||
---|---|---|
206 ↗ | (On Diff #356448) | Good idea. See latest change. |
Use DL variable that already exists