llvm.org GIT mirror llvm / be80800
[WebAssembly] Fix stack offsets of return values from call lowering. Summary: Fixes PR35220 Reviewers: vadimcn, alexcrichton Reviewed By: alexcrichton Subscribers: pepyakin, alexcrichton, jfb, dschuff, sbc100, jgravelle-google, llvm-commits, aheejin Differential Revision: https://reviews.llvm.org/D39866 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317895 91177308-0d34-0410-b5e6-96231b3b80d8 Jatin Bhateja 2 years ago
2 changed file(s) with 14 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
80438043 uint64_t Offset = OldOffsets[i];
80448044 MVT RegisterVT = getRegisterType(CLI.RetTy->getContext(), RetVT);
80458045 unsigned NumRegs = getNumRegisters(CLI.RetTy->getContext(), RetVT);
8046 unsigned RegisterVTSize = RegisterVT.getSizeInBits();
8046 unsigned RegisterVTByteSZ = RegisterVT.getSizeInBits() / 8;
80478047 RetTys.append(NumRegs, RegisterVT);
80488048 for (unsigned j = 0; j != NumRegs; ++j)
8049 Offsets.push_back(Offset + j * RegisterVTSize);
8049 Offsets.push_back(Offset + j * RegisterVTByteSZ);
80508050 }
80518051 }
80528052
0 ; RUN: llc < %s -asm-verbose=false | FileCheck %s
11 ; Test that UMULO works correctly on 64-bit operands.
22 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
3 target triple = "wasm32-unknown-emscripten"
3 target triple = "wasm32-unknown-unknown"
44
55 ; CHECK-LABEL: _ZN4core3num21_$LT$impl$u20$u64$GT$15overflowing_mul17h07be88b4cbac028fE:
66 ; CHECK: __multi3
1818
1919 attributes #0 = { inlinehint }
2020 attributes #1 = { nounwind readnone speculatable }
21
22 ; CHECK-LABEL: wut:
23 ; CHECK: call __multi3@FUNCTION, $2, $0, $pop0, $1, $pop10
24 ; CHECK: i64.load $0=, 8($2)
25 define i1 @wut(i64, i64) {
26 start:
27 %2 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %0, i64 %1)
28 %3 = extractvalue { i64, i1 } %2, 1
29 ret i1 %3
30 }
31