[PATCH] D103323: [DAGCombiner] Add support for mulhi const folding in DAGCombiner

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 18 03:57:14 PDT 2021


foad added a comment.

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.



================
Comment at: llvm/test/CodeGen/AMDGPU/dagcombine-mulhs-const.ll:5
+; MULHS C1, C2 replacement results in 0x4237 in the following add
+; GCN: s_add_u32 s0, 0x4237, s0
+
----------------
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!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103323/new/

https://reviews.llvm.org/D103323



More information about the llvm-commits mailing list