1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00
llvm-mirror/lib
Simon Dardis 56164e7cbd [mips] Don't create nested CALLSEQ_START..CALLSEQ_END nodes.
For the MIPS O32 ABI, the current call lowering logic naively lowers each
call, creating the reserved argument area to hold the argument spill areas for
$a0..$a3 and the outgoing parameter area if one is required at each call site.

In the case of a sufficently large byval argument, a call to memcpy is used
to write the start+16..end of the argument into the outgoing parameter area.
This is done within the CALLSEQ_START..CALLSEQ_END of the callee. The CALLSEQ
nodes are responsible for performing the necessary stack adjustments.

Since the O32/N32/N64 MIPS ABIs do not have a red-zone and writing below the
stack pointer and reading the values back is unpredictable, the call to memcpy
cannot be hoisted out of the callee's CALLSEQ nodes.

However, for the O32 ABI requires the reserved argument area for functions
which have parameters. The naive lowering of calls will then create nested
CALLSEQ sequences. For N32 and N64 these nodes are also created, but with
zero stack adjustments as those ABIs do not have a reserved argument area.

This patch addresses the correctness issue by recognizing the special case
of lowering a byval argument that uses memcpy. By recognizing that the
incoming chain already has a CALLSEQ_START node on it when calling memcpy,
the CALLSEQ nodes are not created. For the N32 and N64 ABIs, this is not an
issue, as no stack adjustment has to be performed.

For the O32 ABI, the correctness reasoning is different. In the case of a
sufficently large byval argument, registers a0..a3 are going to be used for
the callee's arguments, mandating the creation of the reserved argument area.
The call to memcpy in the naive case will also create its own reserved
argument area. However, since the reserved argument area consists of undefined
values, both calls can use the same reserved argument area.

Reviewers: abeserminji, atanasyan

Differential Revision: https://reviews.llvm.org/D44296

llvm-svn: 327388
2018-03-13 12:50:03 +00:00
..
Analysis [Evaluator] Evaluate load/store with bitcast 2018-03-13 10:19:50 +00:00
AsmParser Make the LLParser accept call instructions of variables in the program AS 2018-02-27 11:15:11 +00:00
BinaryFormat [DWARF v5] Support for verbose dumping of .debug_rnglist entries 2018-03-08 20:52:35 +00:00
Bitcode [DebugInfo] Support DWARF v5 source code embedding extension 2018-02-23 23:01:06 +00:00
CodeGen [CodeGenPrepare] Respect endianness in splitMergedValStore. 2018-03-13 08:36:20 +00:00
DebugInfo [DebugInfo] Replace unreachable with None 2018-03-12 14:45:08 +00:00
Demangle
ExecutionEngine [RuntimeDyld][MachO] Fix assertion in encodeAddend, add missing directive to 2018-03-01 01:44:33 +00:00
Fuzzer
FuzzMutate [llvm-opt-fuzzer] Add another pack of passes for continuous fuzzing 2018-02-19 11:57:07 +00:00
IR [ConstantFold] fp_binop AnyConstant, undef --> NaN 2018-03-10 15:56:25 +00:00
IRReader
LineEditor
Linker [ThinLTO] Recommit of import global variables 2018-03-12 10:30:50 +00:00
LTO [LTO] Return proper error object rather than null LTOModule 2018-03-13 04:37:01 +00:00
MC Delay creating an alias for @@@. 2018-03-09 18:42:25 +00:00
Object Delay creating an alias for @@@. 2018-03-09 18:42:25 +00:00
ObjectYAML Reland "[DebugInfo] Support DWARF expressions in eh_frame" 2018-03-08 00:46:53 +00:00
Option [NFC] Replace iterators in PrintHelp with range-based for 2018-03-12 18:31:07 +00:00
Passes Remove the LoopInstSimplify pass (-loop-instsimplify) 2018-03-12 20:49:42 +00:00
ProfileData [SampleFDO] Extend SampleProfReader to handle demangled names. 2018-03-07 16:45:33 +00:00
Support Fix compilation on Darwin with expensive checks. 2018-03-12 11:01:05 +00:00
TableGen TableGen: Remove space at EOL in TGLexer.{h,cpp} 2018-03-09 18:32:04 +00:00
Target [mips] Don't create nested CALLSEQ_START..CALLSEQ_END nodes. 2018-03-13 12:50:03 +00:00
Testing
ToolDrivers
Transforms [Evaluator] Evaluate load/store with bitcast 2018-03-13 10:19:50 +00:00
WindowsManifest
XRay
CMakeLists.txt
LLVMBuild.txt