[NVPTX] Add a truncate DAG node to some calls.
authorJustin Lebar <jlebar@google.com>
Fri, 1 Apr 2016 01:09:10 +0000 (01:09 +0000)
committerJustin Lebar <jlebar@google.com>
Fri, 1 Apr 2016 01:09:10 +0000 (01:09 +0000)
commit96418481bc5994e72b851e3779a8ff5cc2d2111e
tree2d11df2f265c0ce381589d4354fd2b90dc991cac
parentefcc81cbb4852faec3c0deb20e35225244c67fcb
[NVPTX] Add a truncate DAG node to some calls.

Summary:
Previously, we were running afoul of the assertion

  EVT(CLI.Ins[i].VT) == InVals[i].getValueType() && "LowerCall emitted a value with the wrong type!"

in SelectionDAGBuilder.cpp when running the NVPTX/i8-param.ll test.
This is because our backend (for some reason) treats small return values
as i32, but it wasn't ever truncating the i32 back down to the expected
width in the DAG.

Unclear to me whether this fixes any actual bugs -- in this test, at
least, the generated code is unchanged.

Reviewers: jingyue

Subscribers: llvm-commits, tra, jholewinski

Differential Revision: http://reviews.llvm.org/D17872

llvm-svn: 265091
llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp