[PATCH] D48586: [AMDGPU] Early expansion of 32 bit udiv/urem

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 26 12:40:22 PDT 2018


rampitec added a comment.

In https://reviews.llvm.org/D48586#1143943, @arsenm wrote:

> Won't doing this break the case where both the div and rem are used, so the full expansion will be used twice?


opt combines its. For instance:

  a[0] = x % y;
  a[1] = x / y;

  %4 = udiv i32 %1, %2
  %5 = mul i32 %4, %2
  %6 = sub i32 %1, %5


https://reviews.llvm.org/D48586





More information about the llvm-commits mailing list