From a303c417bbdb53703c2c17398b08486bde78f1f6 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Tue, 2 May 2017 18:30:13 +0000 Subject: Vendor import of llvm trunk r301939: https://llvm.org/svn/llvm-project/llvm/trunk@301939 --- lib/CodeGen/GlobalISel/CallLowering.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/CodeGen/GlobalISel/CallLowering.cpp') diff --git a/lib/CodeGen/GlobalISel/CallLowering.cpp b/lib/CodeGen/GlobalISel/CallLowering.cpp index 035a2ac78ed99..ebfe6cb3b733f 100644 --- a/lib/CodeGen/GlobalISel/CallLowering.cpp +++ b/lib/CodeGen/GlobalISel/CallLowering.cpp @@ -83,8 +83,8 @@ void CallLowering::setArgFlags(CallLowering::ArgInfo &Arg, unsigned OpIdx, // For ByVal, alignment should be passed from FE. BE will guess if // this info is not there but there are cases it cannot get right. unsigned FrameAlign; - if (FuncInfo.getParamAlignment(OpIdx)) - FrameAlign = FuncInfo.getParamAlignment(OpIdx); + if (FuncInfo.getParamAlignment(OpIdx - 1)) + FrameAlign = FuncInfo.getParamAlignment(OpIdx - 1); else FrameAlign = getTLI()->getByValTypeAlignment(ElementTy, DL); Arg.Flags.setByValAlign(FrameAlign); -- cgit v1.3