[llvm-branch-commits] [llvm-branch] r371053 - Merging r370430:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Sep 5 03:50:25 PDT 2019


Author: hans
Date: Thu Sep  5 03:50:25 2019
New Revision: 371053

URL: http://llvm.org/viewvc/llvm-project?rev=371053&view=rev
Log:
Merging r370430:
------------------------------------------------------------------------
r370430 | djg | 2019-08-30 06:33:22 +0200 (Fri, 30 Aug 2019) | 12 lines

[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

------------------------------------------------------------------------

Added:
    llvm/branches/release_90/test/CodeGen/WebAssembly/multi-return.ll
      - copied unchanged from r370430, llvm/trunk/test/CodeGen/WebAssembly/multi-return.ll
Modified:
    llvm/branches/release_90/   (props changed)
    llvm/branches/release_90/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Propchange: llvm/branches/release_90/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Sep  5 03:50:25 2019
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,366431,366447,366481,366487,366527,366570,366660,366868,366925,367019,367030,367062,367084,367124,367215,367292,367304,367306,367314,367340-367341,367394,367396,367398,367403,367412,367417,367429,367580,367662,367750,367753,367846-367847,367898,367941,368004,368164,368230,368300,368315,368324,368477-368478,368517-368519,368554,368572,368873,369011,369026,369084,369095,369097,369168,369199,369310,369426,369443,369886,370036,370176,370204,370271,370355,370404,370720-370721,370753
+/llvm/trunk:155241,366431,366447,366481,366487,366527,366570,366660,366868,366925,367019,367030,367062,367084,367124,367215,367292,367304,367306,367314,367340-367341,367394,367396,367398,367403,367412,367417,367429,367580,367662,367750,367753,367846-367847,367898,367941,368004,368164,368230,368300,368315,368324,368477-368478,368517-368519,368554,368572,368873,369011,369026,369084,369095,369097,369168,369199,369310,369426,369443,369886,370036,370176,370204,370271,370355,370404,370430,370720-370721,370753

Modified: llvm/branches/release_90/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_90/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=371053&r1=371052&r2=371053&view=diff
==============================================================================
--- llvm/branches/release_90/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original)
+++ llvm/branches/release_90/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Thu Sep  5 03:50:25 2019
@@ -1810,7 +1810,7 @@ void SelectionDAGBuilder::visitRet(const
       // offsets to its parts don't wrap either.
       SDValue Ptr = DAG.getObjectPtrOffset(getCurSDLoc(), RetPtr, Offsets[i]);
 
-      SDValue Val = RetOp.getValue(i);
+      SDValue Val = RetOp.getValue(RetOp.getResNo() + i);
       if (MemVTs[i] != ValueVTs[i])
         Val = DAG.getPtrExtOrTrunc(Val, getCurSDLoc(), MemVTs[i]);
       Chains[i] = DAG.getStore(Chain, getCurSDLoc(), Val,




More information about the llvm-branch-commits mailing list