]> granicus.if.org Git - llvm/commit
[CodeGen] Fix lowering for returning the result of an extractvalue
authorDan Gohman <dan433584@gmail.com>
Fri, 30 Aug 2019 04:33:22 +0000 (04:33 +0000)
committerDan Gohman <dan433584@gmail.com>
Fri, 30 Aug 2019 04:33:22 +0000 (04:33 +0000)
commita57252fd4522ec2e09feab7d909da8e45f8d049a
tree1c346eeded6c79cd4a857af61fc1bdbdf8f01429
parent537f2893c9b2d9b2efa08d3eb597f3c154b1f652
[CodeGen] Fix lowering for returning the result of an extractvalue

When the number of return values exceeds the number of registers available,
SelectionDAGBuilder::visitRet transforms a function's return to use a
pointer to a buffer to hold return values. When the returned value is an
operator such as extractvalue, the value may have a non-zero result number.
Add that number to the indexing when obtaining the values to store.

This fixes https://bugs.llvm.org/show_bug.cgi?id=43132.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370430 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
test/CodeGen/WebAssembly/multi-return.ll [new file with mode: 0644]