[PATCH] D28732: [NVPTX] Implement min/max in tablegen, rather than with custom DAGComine logic.

Justin Lebar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 14 08:55:58 PST 2017


jlebar created this revision.
jlebar added a reviewer: tra.
jlebar added a subscriber: llvm-commits.
Herald added a subscriber: jholewinski.

This change also lets us use max.{s,u}16.  There's a vague warning in a
test about this maybe being less efficient, but I could not come up with
a case where the resulting SASS (sm_35 or sm_60) was different with or
without max.{s,u}16.  It's true that nvcc seems to emit only
max.{s,u}32, but even ptxas 7.0 seems to have no problem generating
efficient SASS from max.{s,u}16 (the casts up to i32 and back down to
i16 seem to be implicit and nops, happening via register aliasing).

In the absence of evidence, better to have fewer special cases, emit
more straightforward code, etc.  In particular, if a new GPU has 16-bit
min/max instructions, we want to be able to use them.


https://reviews.llvm.org/D28732

Files:
  llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
  llvm/lib/Target/NVPTX/NVPTXInstrInfo.td
  llvm/test/CodeGen/NVPTX/combine-min-max.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28732.84454.patch
Type: text/x-patch
Size: 8068 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170114/8a87ccbb/attachment.bin>


More information about the llvm-commits mailing list