[PATCH] D153257: AMDGPU: Implement llvm.set.rounding

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 2 00:25:46 PDT 2023


foad added inline comments.


================
Comment at: llvm/test/CodeGen/AMDGPU/llvm.set.rounding.ll:16-18
+; GFX678-NEXT:    s_add_i32 s34, s4, -4
+; GFX678-NEXT:    s_cmp_lt_u32 s4, 4
+; GFX678-NEXT:    s_cselect_b32 s34, s4, s34
----------------
arsenm wrote:
> foad wrote:
> > Simpler:
> > ```
> >   s_add_i32 s34, s4, -4
> >   s_min_u32 s34, s4, s34
> > ```
> I would have hoped the combiner would deal with that
That would be way more likely if you changed the operands of the cmp to match the operands of the select. For the combiner to optimize it the way you've written it, it would need to understand the relationship between s4 and s34.


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

https://reviews.llvm.org/D153257



More information about the llvm-commits mailing list