OSDN Git Service

[NVPTX] Improve lowering of llvm.ctpop.
authorJustin Lebar <jlebar@google.com>
Wed, 18 Jan 2017 00:08:27 +0000 (00:08 +0000)
committerJustin Lebar <jlebar@google.com>
Wed, 18 Jan 2017 00:08:27 +0000 (00:08 +0000)
commit38c1089801be5e11ee2725706afbc5850d92cfb1
tree10251d6fbfff13b5b7d98ea5b17caaabaa9ac151
parent7470b2cf62d20bb77f9f858a5784870f7d847a85
[NVPTX] Improve lowering of llvm.ctpop.

Summary:
Avoid an unnecessary conversion operation when using the result of
ctpop.i32 or ctpop.i16 as an i32, as in both cases the ptx instruction
we run returns an i32.

(Previously if we used the value as an i32, we'd do an unnecessary
zext+trunc.)

Reviewers: tra

Subscribers: jholewinski, llvm-commits

Differential Revision: https://reviews.llvm.org/D28721

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292302 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/NVPTX/NVPTXInstrInfo.td
test/CodeGen/NVPTX/intrinsics.ll