[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 10:16:25 PDT 2019


bixia created this revision.
Herald added subscribers: llvm-commits, hiraditya, jlebar, sanjoy, jholewinski.
Herald added a project: LLVM.

Previously, we translate llvm.round to PTX cvt.rni, which rounds to the
even interger when the source is equidistant between two integers. This
is not correct as llvm.round should round away from zero. This change
replaces llvm.round with a round away from zero implementation through
target specific custom lowering.

Modify a few affected tests to not check for cvt.rni. We are also adding
CUDA runnable tests to check for the values produced by llvm.round to
test-suites/External/CUDA.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D59947

Files:
  llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
  llvm/lib/Target/NVPTX/NVPTXISelLowering.h
  llvm/lib/Target/NVPTX/NVPTXInstrInfo.td
  llvm/test/CodeGen/NVPTX/f16-instructions.ll
  llvm/test/CodeGen/NVPTX/f16x2-instructions.ll
  llvm/test/CodeGen/NVPTX/math-intrins.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59947.192674.patch
Type: text/x-patch
Size: 9322 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190328/5cfd3eec/attachment.bin>


More information about the llvm-commits mailing list