From f805dbc7ec3dc2a7f4f1ec5315a5ccace3a48547 Mon Sep 17 00:00:00 2001 From: Daniel Sanders Date: Mon, 1 Dec 2014 16:26:48 +0000 Subject: [PATCH] Merged from r221081 and r221102: ------------------------------------------------------------------------------- Revert r221056 and others, "[mips] Move F128 argument handling into MipsCCState as we did for returns. NFC." r221056 "[mips] Move F128 argument handling into MipsCCState as we did for returns. NFC." r221058 "[mips] Fix unused variable warning introduced in r221056" r221059 "[mips] Move all ByVal handling into CCState and tablegen-erated code. NFC." r221061 "Renamed CCState members that appear to misspell 'Processed' as 'Proceed'. NFC." It caused an undefined behavior in LLVM :: CodeGen/Mips/return-vector.ll. ------------------------------------------------------------------------------- Re-commit r221056 and others with fix, "[mips] Move F128 argument handling into MipsCCState as we did for returns. NFC." sret arguments can never originate from an f128 argument so we detect sret arguments and push false into OriginalArgWasF128. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223040 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Mips/MipsISelLowering.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/Target/Mips/MipsISelLowering.cpp b/lib/Target/Mips/MipsISelLowering.cpp index e51f3cb608f..3eefc030750 100644 --- a/lib/Target/Mips/MipsISelLowering.cpp +++ b/lib/Target/Mips/MipsISelLowering.cpp @@ -111,8 +111,17 @@ private: const MachineFunction &MF = getMachineFunction(); for (unsigned i = 0; i < Ins.size(); ++i) { Function::const_arg_iterator FuncArg = MF.getFunction()->arg_begin(); - std::advance(FuncArg, Ins[i].OrigArgIndex); + // SRet arguments cannot originate from f128 or {f128} returns so we just + // push false. We have to handle this specially since SRet arguments + // aren't mapped to an original argument. + if (Ins[i].Flags.isSRet()) { + OriginalArgWasF128.push_back(false); + continue; + } + + assert(Ins[i].OrigArgIndex < MF.getFunction()->arg_size()); + std::advance(FuncArg, Ins[i].OrigArgIndex); OriginalArgWasF128.push_back( originalTypeIsF128(FuncArg->getType(), nullptr)); }