[llvm-branch-commits] [llvm-branch] r223040 - Merged from r221081 and r221102:

Daniel Sanders daniel.sanders at imgtec.com
Mon Dec 1 08:26:48 PST 2014


Author: dsanders
Date: Mon Dec  1 10:26:48 2014
New Revision: 223040

URL: http://llvm.org/viewvc/llvm-project?rev=223040&view=rev
Log:
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.


Modified:
    llvm/branches/release_35/lib/Target/Mips/MipsISelLowering.cpp

Modified: llvm/branches/release_35/lib/Target/Mips/MipsISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_35/lib/Target/Mips/MipsISelLowering.cpp?rev=223040&r1=223039&r2=223040&view=diff
==============================================================================
--- llvm/branches/release_35/lib/Target/Mips/MipsISelLowering.cpp (original)
+++ llvm/branches/release_35/lib/Target/Mips/MipsISelLowering.cpp Mon Dec  1 10:26:48 2014
@@ -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));
     }





More information about the llvm-branch-commits mailing list