[PATCH] D59947: [NVPTX] Fix the codegen for llvm.round.

Bixia Zheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 28 17:19:32 PDT 2019


bixia marked an inline comment as done.
bixia added a comment.

In D59947#1446390 <https://reviews.llvm.org/D59947#1446390>, @jlebar wrote:

> Does XLA:GPU built with this change pass the exhaustive test you added for kRound after we revert the change that made kRound call into libdevice?


Yes, I took off the current workaround and ran exhaustive test.



================
Comment at: llvm/test/CodeGen/NVPTX/math-intrins.ll:77
 define float @round_float(float %a) {
-  ; CHECK: cvt.rni.f32.f32
+  ; CHECK: cvt.rzi.f32.f32
   %b = call float @llvm.round.f32(float %a)
----------------
tra wrote:
> Why do we end up with .rzi (round to nearest integer *in the direction of zero*) here? Wasn't this patch supposed to change rounding to be *away* from zero?
The emulate implementation is eventually translated to cvt.rzi.  I really don't have a good idea on how to modify this test, was also thinking to modify the original CHECK to CHECK-NOT, or delete the test. What do you suggest?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D59947





More information about the llvm-commits mailing list