Tom Stellard [Tue, 17 Mar 2015 20:42:08 +0000 (20:42 +0000)]
Merging r214336:
------------------------------------------------------------------------
r214336 | rafael.espindola | 2014-07-30 17:04:00 -0400 (Wed, 30 Jul 2014) | 9 lines
SimplifyCFG: Avoid miscompilations due to removed lifetime intrinsics.
The lifetime intrinsics need some work in order to make it clear which
optimizations are or are not valid.
For now dropping this optimization avoids a miscompilation.
Patch by Björn Steinbrink.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@232544
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Tue, 17 Mar 2015 18:09:58 +0000 (18:09 +0000)]
Merging r229352:
------------------------------------------------------------------------
r229352 | david.majnemer | 2015-02-15 23:02:09 -0500 (Sun, 15 Feb 2015) | 9 lines
IR: Properly return nullptr when getAggregateElement is out-of-bounds
We didn't properly handle the out-of-bounds case for
ConstantAggregateZero and UndefValue. This would manifest as a crash
when the constant folder was asked to fold a load of a constant global
whose struct type has no operands.
This fixes PR22595.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@232512
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 16 Mar 2015 10:40:59 +0000 (10:40 +0000)]
Added MIPS changes to release notes for 3.5.2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@232369
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 13 Mar 2015 11:54:32 +0000 (11:54 +0000)]
Try to make AsmPrinter vtable compatible with previous shared library.
r232083 added AsmPrinter::emitInlineAsmStart() before
AsmPrinter::emitInlineAsmEnd(), changing the vtable in an incompatible way.
This patch swaps the declaration order so that the new vtable entry is at the
end of the vtable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@232162
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Thu, 12 Mar 2015 19:21:16 +0000 (19:21 +0000)]
Merging r225521:
------------------------------------------------------------------------
r225521 | tomatabacu | 2015-01-09 15:00:30 +0000 (Fri, 09 Jan 2015) | 1 line
[mips] Add comment which explains why we need to change the assembler options before and after inline asm blocks. NFC.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@232084
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Thu, 12 Mar 2015 19:17:32 +0000 (19:17 +0000)]
Merging r224425:
------------------------------------------------------------------------
r224425 | tomatabacu | 2014-12-17 10:56:16 +0000 (Wed, 17 Dec 2014) | 17 lines
[mips] Set GCC-compatible MIPS asssembler options before inline asm blocks.
Summary:
When generating MIPS assembly, LLVM always overrides the default assembler options by emitting the '.set noreorder', '.set nomacro' and '.set noat' directives,
while GCC uses the default options if an assembly-level function contains inline assembly code.
This becomes a problem when the code generated by LLVM is interleaved with inline assembly which assumes GCC-like assembler options (from Linux, for example).
This patch fixes these conflicts by setting the appropriate assembler options at the beginning of an inline asm block and popping them at the end.
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6637
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@232083
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Thu, 12 Mar 2015 19:12:54 +0000 (19:12 +0000)]
Merging r217432:
------------------------------------------------------------------------
r217432 | tomatabacu | 2014-09-09 11:15:38 +0100 (Tue, 09 Sep 2014) | 12 lines
[mips] Add assembler support for .set push/pop directive.
Summary:
These directives are used to save the current assembler options (in the case of ".set push") and restore the previously saved options (in the case of ".set pop").
Contains work done by Matheus Almeida.
Reviewers: dsanders
Reviewed By: dsanders
Differential Revision: http://reviews.llvm.org/D4821
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@232082
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Thu, 12 Mar 2015 16:23:09 +0000 (16:23 +0000)]
Merging r217254:
------------------------------------------------------------------------
r217254 | tomatabacu | 2014-09-05 16:43:21 +0100 (Fri, 05 Sep 2014) | 9 lines
[mips] Rename data members and member functions in MipsAssemblerOptions.
Summary: Use the naming convention from the LLVM Coding Standards.
Reviewers: dsanders
Reviewed By: dsanders
Differential Revision: http://reviews.llvm.org/D4972
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@232054
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 6 Mar 2015 13:24:18 +0000 (13:24 +0000)]
Merging r230235:
------------------------------------------------------------------------
r230235 | dsanders | 2015-02-23 17:22:16 +0000 (Mon, 23 Feb 2015) | 16 lines
[mips] Honour -mno-odd-spreg for vector insert/extract when MSA is enabled.
Summary:
-mno-odd-spreg prohibits the use of odd-numbered single-precision floating
point registers. However, vector insert/extract was still using them when
manipulating the subregisters of an MSA register. Fixed this by ensuring
that insertion/extraction is only performed on even-numbered vector
registers when -mno-odd-spreg is given.
Reviewers: vmedic, sstankovic
Reviewed By: sstankovic
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D7672
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@231472
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 6 Mar 2015 13:19:44 +0000 (13:19 +0000)]
Merging r227089:
------------------------------------------------------------------------
r227089 | vkalintiris | 2015-01-26 12:33:22 +0000 (Mon, 26 Jan 2015) | 15 lines
[mips] Enable arithmetic and binary operations for the i128 data type.
Summary:
This patch adds support for some operations that were missing from
128-bit integer types (add/sub/mul/sdiv/udiv... etc.). With these
changes we can support the __int128_t and __uint128_t data types
from C/C++.
Depends on D7125
Reviewers: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D7143
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@231471
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 6 Mar 2015 13:09:25 +0000 (13:09 +0000)]
Merging r227087:
Except for the MIPS-II and MIPS-III cases since these targets were not
supported in 3.5.1.
------------------------------------------------------------------------
r227087 | vkalintiris | 2015-01-26 12:04:40 +0000 (Mon, 26 Jan 2015) | 7 lines
[mips] Add tests for bitwise binary and integer arithmetic operators.
Reviewers: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D7125
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@231469
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 6 Mar 2015 12:51:21 +0000 (12:51 +0000)]
Partially merging r221686:
Only the testcase minus the MIPS-II and MIPS-IV cases have been merged.
They are required to cleanly apply a subsequent patch.
------------------------------------------------------------------------
r221686 | vkalintiris | 2014-11-11 11:43:55 +0000 (Tue, 11 Nov 2014) | 16 lines
[mips] Add preliminary support for the MIPS II target.
Summary:
This patch enables code generation for the MIPS II target. Pre-Mips32
targets don't have the MUL instruction, so we add the correspondent
pattern that uses the MULT/MFLO combination in order to retrieve the
product.
This is WIP as we don't support code generation for select nodes due to
the lack of conditional-move instructions.
Reviewers: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6150
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@231468
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 6 Mar 2015 12:38:41 +0000 (12:38 +0000)]
Merging r226171:
------------------------------------------------------------------------
r226171 | dsanders | 2015-01-15 15:41:03 +0000 (Thu, 15 Jan 2015) | 11 lines
[mips] Fix a typo in the compare patterns for MIPS32r6/MIPS64r6.
Summary: The patterns intended for the SETLE node were actually matching the SETLT node.
Reviewers: atanasyan, sstankovic, vmedic
Reviewed By: vmedic
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6997
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@231467
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 6 Mar 2015 12:34:10 +0000 (12:34 +0000)]
Merging r225529:
------------------------------------------------------------------------
r225529 | dsanders | 2015-01-09 17:21:30 +0000 (Fri, 09 Jan 2015) | 18 lines
[mips] Add support for accessing $gp as a named register.
Summary:
Mips Linux uses $gp to hold a pointer to thread info structure and accesses it
with a named register. This makes this work for LLVM.
The N32 ABI doesn't quite work yet since the frontend generates incorrect IR
for this case. It neglects to truncate the 64-bit GPR to a 32-bit value before
converting to a pointer. Given correct IR (as in the testcase in this patch),
it works correctly.
Reviewers: sstankovic, vmedic, atanasyan
Reviewed By: atanasyan
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6893
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@231466
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 6 Mar 2015 11:47:54 +0000 (11:47 +0000)]
Revert r231463 and r231462.
The build fails after merging them due to two missing functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@231464
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 6 Mar 2015 11:40:28 +0000 (11:40 +0000)]
Merging r225521:
------------------------------------------------------------------------
r225521 | tomatabacu | 2015-01-09 15:00:30 +0000 (Fri, 09 Jan 2015) | 1 line
[mips] Add comment which explains why we need to change the assembler options before and after inline asm blocks. NFC.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@231463
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 6 Mar 2015 11:39:52 +0000 (11:39 +0000)]
Merging r224425:
------------------------------------------------------------------------
r224425 | tomatabacu | 2014-12-17 10:56:16 +0000 (Wed, 17 Dec 2014) | 17 lines
[mips] Set GCC-compatible MIPS asssembler options before inline asm blocks.
Summary:
When generating MIPS assembly, LLVM always overrides the default assembler options by emitting the '.set noreorder', '.set nomacro' and '.set noat' directives,
while GCC uses the default options if an assembly-level function contains inline assembly code.
This becomes a problem when the code generated by LLVM is interleaved with inline assembly which assumes GCC-like assembler options (from Linux, for example).
This patch fixes these conflicts by setting the appropriate assembler options at the beginning of an inline asm block and popping them at the end.
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6637
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@231462
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 14 Jan 2015 01:21:39 +0000 (01:21 +0000)]
Bump version to 3.5.2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@225916
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 6 Jan 2015 08:51:50 +0000 (08:51 +0000)]
Merging r222856:
------------------------------------------------------------------------
r222856 | majnemer | 2014-11-26 15:00:38 -0800 (Wed, 26 Nov 2014) | 8 lines
Revert "Added inst combine transforms for single bit tests from Chris's note"
This reverts commit r210006, it miscompiled libapr which is used in who
knows how many projects.
A test has been added to ensure that we don't regress again.
I'll work on a rewrite of what the optimization was trying to do later.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@225255
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Thu, 18 Dec 2014 10:43:48 +0000 (10:43 +0000)]
Merging r224333:
------------------------------------------------------------------------
r224333 | dsanders | 2014-12-16 11:21:58 +0000 (Tue, 16 Dec 2014) | 3 lines
[mips] Fix arguments-struct.ll for Windows and OSX hosts.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@224510
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 9 Dec 2014 02:43:05 +0000 (02:43 +0000)]
Fixup backport of r223318
TM.getSubtargetImpl()->getRegisterInfo() needs to be TM.getRegisterInfo() in 3.5.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223749
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 9 Dec 2014 02:37:53 +0000 (02:37 +0000)]
Merging r223708:
------------------------------------------------------------------------
r223708 | hfinkel | 2014-12-08 22:54:22 +0000 (Mon, 08 Dec 2014) | 13 lines
[PowerPC] Don't use a non-allocatable register to implement the 'cc' alias
GCC accepts 'cc' as an alias for 'cr0', and we need to do the same when
processing inline asm constraints. This had previously been implemented using a
non-allocatable register, named 'cc', that was listed as an alias of 'cr0', but
the infrastructure does not seem to support this properly (neither the register
allocator nor the scheduler properly accounts for the alias). Instead, we can
just process this as a naming alias inside of the inline asm
constraint-processing code, so we'll do that instead.
There are two regression tests, one where the post-RA scheduler did the wrong
thing with the non-allocatable alias, and one where the register allocator did
the wrong thing. Fixes PR21742.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223748
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 9 Dec 2014 02:37:11 +0000 (02:37 +0000)]
Merging r223328:
------------------------------------------------------------------------
r223328 | hfinkel | 2014-12-04 00:46:20 +0000 (Thu, 04 Dec 2014) | 8 lines
[PowerPC] 'cc' should be an alias only to 'cr0'
We had mistakenly believed that GCC's 'cc' referred to the entire
condition-code register (cr0 through cr7) -- and implemented this in r205630 to
fix PR19326, but 'cc' is actually an alias only to 'cr0'. This is causing LLVM
to clobber too much with legacy code with inline asm using the 'cc' clobber.
Fixes PR21451.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223747
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 9 Dec 2014 02:36:22 +0000 (02:36 +0000)]
Merging r223318:
------------------------------------------------------------------------
r223318 | hfinkel | 2014-12-03 23:40:13 +0000 (Wed, 03 Dec 2014) | 12 lines
[PowerPC] Fix inline asm memory operands not to use r0
On PowerPC, inline asm memory operands might be expanded as 0($r), where $r is
a register containing the address. As a result, this register cannot be r0, and
we need to enforce this register subclass constraint to prevent miscompiling
the code (we'd get this constraint for free with the usual instruction
definitions, but that scheme has no knowledge of how we end up printing inline
asm memory operands, and so here we need to do it 'by hand'). We can accomplish
this within the current address-mode selection framework by introducing an
explicit COPY_TO_REGCLASS node.
Fixes PR21443.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223746
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 9 Dec 2014 02:35:44 +0000 (02:35 +0000)]
Merging r223220:
------------------------------------------------------------------------
r223220 | hfinkel | 2014-12-03 09:37:50 +0000 (Wed, 03 Dec 2014) | 23 lines
[PowerPC] Print all inline-asm consts as signed numbers
Almost all immediates in PowerPC assembly (both 32-bit and 64-bit) are signed
numbers, and it is important that we print them as such. To make sure that
happens, we change PPCTargetLowering::LowerAsmOperandForConstraint so that it
does all intermediate checks on a signed-extended int64_t value, and then
creates the resulting target constant using MVT::i64. This will ensure that all
negative values are printed as negative values (mirroring what is done in other
backends to achieve the same sign-extension effect).
This came up in the context of inline assembly like this:
"add%I2 %0,%0,%2", ..., "Ir"(-1ll)
where we used to print:
addi 3,3,
4294967295
and gcc would print:
addi 3,3,-1
and gas accepts both forms, but our builtin assembler (correctly) does not. Now
we print -1 like gcc does.
While here, I replaced a bunch of custom integer checks with isInt<16> and
friends from MathExtras.h.
Thanks to Paul Hargrove for the bug report.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223745
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 9 Dec 2014 02:33:41 +0000 (02:33 +0000)]
Merging r222996:
------------------------------------------------------------------------
r222996 | foad | 2014-12-01 09:42:32 +0000 (Mon, 01 Dec 2014) | 19 lines
[PowerPC] Fix unwind info with dynamic stack realignment
Summary:
PowerPC DWARF unwind info defined CFA as SP + offset even in a function
where the stack had been dynamically realigned. This clearly doesn't
work because the offset from SP to CFA is not a constant. Fix it by
defining CFA as BP instead.
This was causing the AddressSanitizer null_deref test to fail 50% of
the time, depending on whether SP happened to be 32-byte aligned on
entry to a particular function or not.
Reviewers: willschm, uweigand, hfinkel
Reviewed By: hfinkel
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6410
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223744
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 9 Dec 2014 02:30:53 +0000 (02:30 +0000)]
Merging r222672:
------------------------------------------------------------------------
r222672 | uweigand | 2014-11-24 18:09:47 +0000 (Mon, 24 Nov 2014) | 10 lines
[PowerPC] Fix PR 21652 - copy st_other bits on symbol assignment
When processing an assignment in the integrated assembler that sets
a symbol to the value of another symbol, we need to copy the st_other
bits that encode the local entry point offset.
Modeled after MipsTargetELFStreamer::emitAssignment handling of the
ELF::STO_MIPS_MICROMIPS flag.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223743
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 9 Dec 2014 02:28:44 +0000 (02:28 +0000)]
Merging r221703:
------------------------------------------------------------------------
r221703 | wschmidt | 2014-11-11 20:44:09 +0000 (Tue, 11 Nov 2014) | 48 lines
[PowerPC] Replace foul hackery with real calls to __tls_get_addr
My original support for the general dynamic and local dynamic TLS
models contained some fairly obtuse hacks to generate calls to
__tls_get_addr when lowering a TargetGlobalAddress. Rather than
generating real calls, special GET_TLS_ADDR nodes were used to wrap
the calls and only reveal them at assembly time. I attempted to
provide correct parameter and return values by chaining CopyToReg and
CopyFromReg nodes onto the GET_TLS_ADDR nodes, but this was also not
fully correct. Problems were seen with two back-to-back stores to TLS
variables, where the call sequences ended up overlapping with unhappy
results. Additionally, since these weren't real calls, the proper
register side effects of a call were not recorded, so clobbered values
were kept live across the calls.
The proper thing to do is to lower these into calls in the first
place. This is relatively straightforward; see the changes to
PPCTargetLowering::LowerGlobalTLSAddress() in PPCISelLowering.cpp.
The changes here are standard call lowering, except that we need to
track the fact that these calls will require a relocation. This is
done by adding a machine operand flag of MO_TLSLD or MO_TLSGD to the
TargetGlobalAddress operand that appears earlier in the sequence.
The calls to LowerCallTo() eventually find their way to
LowerCall_64SVR4() or LowerCall_32SVR4(), which call FinishCall(),
which calls PrepareCall(). In PrepareCall(), we detect the calls to
__tls_get_addr and immediately snag the TargetGlobalTLSAddress with
the annotated relocation information. This becomes an extra operand
on the call following the callee, which is expected for nodes of type
tlscall. We change the call opcode to CALL_TLS for this case. Back
in FinishCall(), we change it again to CALL_NOP_TLS for 64-bit only,
since we require a TOC-restore nop following the call for the 64-bit
ABIs.
During selection, patterns in PPCInstrInfo.td and PPCInstr64Bit.td
convert the CALL_TLS nodes into BL_TLS nodes, and convert the
CALL_NOP_TLS nodes into BL8_NOP_TLS nodes. This replaces the code
removed from PPCAsmPrinter.cpp, as the BL_TLS or BL8_NOP_TLS
nodes can now be emitted normally using their patterns and the
associated printTLSCall print method.
Finally, as a result of these changes, all references to get-tls-addr
in its various guises are no longer used, so they have been removed.
There are existing TLS tests to verify the changes haven't messed
anything up). I've added one new test that verifies that the problem
with the original code has been fixed.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223742
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 9 Dec 2014 02:26:40 +0000 (02:26 +0000)]
Merging rr220959:
------------------------------------------------------------------------
r220959 | uweigand | 2014-10-31 10:33:14 +0000 (Fri, 31 Oct 2014) | 13 lines
[PowerPC] Load BlockAddress values from the TOC in 64-bit SVR4 code
Since block address values can be larger than 2GB in 64-bit code, they
cannot be loaded simply using an @l / @ha pair, but instead must be
loaded from the TOC, just like GlobalAddress, ConstantPool, and
JumpTable values are.
The commit also fixes a bug in PPCLinuxAsmPrinter::doFinalization where
temporary labels could not be used as TOC values, since code would
attempt (and fail) to use GetOrCreateSymbol to create a symbol of the
same name as the temporary label.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223741
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 9 Dec 2014 02:23:59 +0000 (02:23 +0000)]
Merging r219441:
------------------------------------------------------------------------
r219441 | sfantao | 2014-10-09 20:42:56 +0000 (Thu, 09 Oct 2014) | 3 lines
Fix bug in GPR to FPR moves in PPC64LE.
The current implementation of GPR->FPR register moves uses a stack slot. This mechanism writes a double word and reads a word. In big-endian the load address must be displaced by 4-bytes in order to get the right value. In little endian this is no longer required. This patch fixes the issue and adds LE regression tests to fast-isel-conversion which currently expose this problem.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223740
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 9 Dec 2014 02:21:12 +0000 (02:21 +0000)]
Merging r217993:
------------------------------------------------------------------------
r217993 | sfantao | 2014-09-17 23:25:06 +0000 (Wed, 17 Sep 2014) | 5 lines
Fix FastISel bug in boolean returns for PowerPC.
For PPC targets, FastISel does not take the sign extension information into account when selecting return instructions whose operands are constants. A consequence of this is that the return of boolean values is not correct. This patch fixes the problem by evaluating the sign extension information also for constants, forwarding this information to PPCMaterializeInt which takes this information to drive the sign extension during the materialization.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223739
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 9 Dec 2014 02:18:38 +0000 (02:18 +0000)]
Merging r216917:
------------------------------------------------------------------------
r216917 | samsonov | 2014-09-02 17:38:34 +0000 (Tue, 02 Sep 2014) | 4 lines
Fix signed integer overflow in PPCInstPrinter.
This bug was reported by UBSan.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223738
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 9 Dec 2014 02:09:06 +0000 (02:09 +0000)]
Merging r214517:
------------------------------------------------------------------------
r214517 | uweigand | 2014-08-01 14:35:58 +0000 (Fri, 01 Aug 2014) | 8 lines
[PowerPC] PR20280 - Slots for byval parameters are not immutable
Found by inspection while looking at PR20280: code would mark slots
in the parameter save area where a byval parameter is passed as
"immutable". This is not correct since code is allowed to modify
byval parameters in place in the parameter save area.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223736
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 9 Dec 2014 01:56:18 +0000 (01:56 +0000)]
Merging r215793:
------------------------------------------------------------------------
r215793 | hfinkel | 2014-08-16 00:16:29 +0000 (Sat, 16 Aug 2014) | 9 lines
[PowerPC] Darwin byval arguments are not immutable
On PPC/Darwin, byval arguments occur at fixed stack offsets in the callee's
frame, but are not immutable -- the pointer value is directly available to the
higher-level code as the address of the argument, and the value of the byval
argument can be modified at the IR level.
This is necessary, but not sufficient, to fix PR20280. When PR20280 is fixed in
a follow-up commit, its test case will cover this change.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223735
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 9 Dec 2014 01:53:54 +0000 (01:53 +0000)]
Merging r213960:
------------------------------------------------------------------------
r213960 | hfinkel | 2014-07-25 17:47:22 +0000 (Fri, 25 Jul 2014) | 3 lines
[PowerPC] Support TLS on PPC32/ELF
Patch by Justin Hibbits!
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223734
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 8 Dec 2014 23:29:14 +0000 (23:29 +0000)]
Merging r223500 (this time for real):
------------------------------------------------------------------------
r223500 | dexonsmith | 2014-12-05 11:13:42 -0800 (Fri, 05 Dec 2014) | 9 lines
BFI: Saturate when combining edges to a successor
When a loop gets bundled up, its outgoing edges are quite large, and can
just barely overflow 64-bits. If one successor has multiple incoming
edges -- and that successor is getting all the incoming mass --
combining just its edges can overflow. Handle that by saturating rather
than asserting.
This fixes PR21622.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223716
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 8 Dec 2014 23:22:11 +0000 (23:22 +0000)]
Reverting r223712; apparently I don't understand SVN
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223713
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 8 Dec 2014 23:18:00 +0000 (23:18 +0000)]
Merging r223500:
------------------------------------------------------------------------
r223500 | dexonsmith | 2014-12-05 11:13:42 -0800 (Fri, 05 Dec 2014) | 9 lines
BFI: Saturate when combining edges to a successor
When a loop gets bundled up, its outgoing edges are quite large, and can
just barely overflow 64-bits. If one successor has multiple incoming
edges -- and that successor is getting all the incoming mass --
combining just its edges can overflow. Handle that by saturating rather
than asserting.
This fixes PR21622.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223712
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 8 Dec 2014 09:16:46 +0000 (09:16 +0000)]
Merging r221318:
------------------------------------------------------------------------
r221318 | majnemer | 2014-11-04 15:49:08 -0800 (Tue, 04 Nov 2014) | 10 lines
Analysis: Make isSafeToSpeculativelyExecute fire less for divides
Divides and remainder operations do not behave like other operations
when they are given poison: they turn into undefined behavior.
It's really hard to know if the operands going into a div are or are not
poison. Because of this, we should only choose to speculate if there
are constant operands which we can easily reason about.
This fixes PR21412.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223647
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 8 Dec 2014 09:15:41 +0000 (09:15 +0000)]
I did not intend to merge these in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223646
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 8 Dec 2014 09:11:48 +0000 (09:11 +0000)]
Merging r215818:
------------------------------------------------------------------------
r215818 | majnemer | 2014-08-16 02:23:42 -0700 (Sat, 16 Aug 2014) | 12 lines
InstCombine: Fix a potential bug in 0 - (X sdiv C) -> (X sdiv -C)
While *most* (X sdiv 1) operations will get caught by InstSimplify, it
is still possible for a sdiv to appear in the worklist which hasn't been
simplified yet.
This means that it is possible for 0 - (X sdiv 1) to get transformed
into (X sdiv -1); dividing by -1 can make the transform produce undef
values instead of the proper result.
Sorry for the lack of testcase, it's a bit problematic because it relies
on the exact order of operations in the worklist.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223645
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 8 Dec 2014 09:11:36 +0000 (09:11 +0000)]
Merging r214385:
------------------------------------------------------------------------
r214385 | majnemer | 2014-07-30 21:49:29 -0700 (Wed, 30 Jul 2014) | 9 lines
InstCombine: Correctly propagate NSW/NUW for x-(-A) -> x+A
We can only propagate the nsw bits if both subtraction instructions are
marked with the appropriate bit.
N.B. We only propagate the nsw bit in InstCombine because the nuw case
is already handled in InstSimplify.
This fixes PR20189.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223644
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 8 Dec 2014 09:10:57 +0000 (09:10 +0000)]
Fix merge conflict & minor test output differences
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223643
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 8 Dec 2014 08:54:39 +0000 (08:54 +0000)]
Merging r222500:
------------------------------------------------------------------------
r222500 | majnemer | 2014-11-20 18:37:38 -0800 (Thu, 20 Nov 2014) | 1 line
This Reassociate change unintentionally slipped in r222499
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223640
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 8 Dec 2014 08:53:47 +0000 (08:53 +0000)]
Merging r216891:
------------------------------------------------------------------------
r216891 | majnemer | 2014-09-01 14:20:14 -0700 (Mon, 01 Sep 2014) | 12 lines
SROA: Don't insert instructions before a PHI
SROA may decide that it needs to insert a bitcast and would set it's
insertion point before a PHI. This will create an invalid module
right quick.
Instead, choose the first insertion point in the basic block that holds
our PHI.
This fixes PR20822.
Differential Revision: http://reviews.llvm.org/D5141
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223639
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 8 Dec 2014 08:50:39 +0000 (08:50 +0000)]
Merging r217115:
------------------------------------------------------------------------
r217115 | majnemer | 2014-09-03 17:23:13 -0700 (Wed, 03 Sep 2014) | 3 lines
IndVarSimplify: Address review comments for r217102
No functional change intended, just some cleanups and comments added.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223638
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 8 Dec 2014 08:50:22 +0000 (08:50 +0000)]
Merging rr217102:
------------------------------------------------------------------------
r217102 | majnemer | 2014-09-03 16:03:18 -0700 (Wed, 03 Sep 2014) | 11 lines
IndVarSimplify: Don't let LFTR compare against a poison value
LinearFunctionTestReplace tries to use the *next* indvar to compare
against when possible. However, it may be the case that the calculation
for the next indvar has NUW/NSW flags and that it may only be safely
used inside the loop. Using it in a comparison to calculate the exit
condition could result in observing poison.
This fixes PR20680.
Differential Revision: http://reviews.llvm.org/D5174
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223637
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 8 Dec 2014 08:49:20 +0000 (08:49 +0000)]
Merging rr221501:
------------------------------------------------------------------------
r221501 | majnemer | 2014-11-06 16:31:14 -0800 (Thu, 06 Nov 2014) | 7 lines
LoopVectorize: Don't assume pointees are sized
A pointer's pointee might not be sized: the pointee could be a function.
Report this as IK_NoInduction when calculating isInductionVariable.
This fixes PR21508.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223636
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 8 Dec 2014 08:48:58 +0000 (08:48 +0000)]
Merging rr222376:
------------------------------------------------------------------------
r222376 | majnemer | 2014-11-19 11:36:18 -0800 (Wed, 19 Nov 2014) | 3 lines
AliasSet: Simplify mergeSetIn
No functional change intended.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223635
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 8 Dec 2014 08:48:09 +0000 (08:48 +0000)]
Merging r222338:
------------------------------------------------------------------------
r222338 | majnemer | 2014-11-19 01:41:05 -0800 (Wed, 19 Nov 2014) | 16 lines
AliasSetTracker: UnknownInsts should contribute to the refcount
AliasSetTracker::addUnknown may create an AliasSet devoid of pointers
just to contain an instruction if no suitable AliasSet already exists.
It will then AliasSet::addUnknownInst and we will be done.
However, it's possible for addUnknown to choose an existing AliasSet to
addUnknownInst.
If this were to occur, we are in a bit of a pickle: removing pointers
from the AliasSet can cause the entire AliasSet to become destroyed,
taking our unknown instructions out with them.
Instead, keep track whether or not our AliasSet has any unknown
instructions.
This fixes PR21582.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223627
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Sat, 6 Dec 2014 10:34:51 +0000 (10:34 +0000)]
Merging r215169:
------------------------------------------------------------------------
r215169 | ghoflehner | 2014-08-08 00:19:55 +0100 (Fri, 08 Aug 2014) | 2 lines
Fix for multi-line comment warning
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223582
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Sat, 6 Dec 2014 10:34:24 +0000 (10:34 +0000)]
Merging r220360:
------------------------------------------------------------------------
r220360 | filcab | 2014-10-22 03:16:06 +0100 (Wed, 22 Oct 2014) | 5 lines
Silence gcc's -Wcomment
gcc's (4.7, I think) -Wcomment warning is not "as smart" as clang's and
warns even if the line right after the backslash-newline sequence only has
a line comment that starts at the beginning of the line.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223581
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zolotukhin [Fri, 5 Dec 2014 22:31:29 +0000 (22:31 +0000)]
Merging r223171:
PR21302. Vectorize only bottom-tested loops.
rdar://problem/
18886083
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223535
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zolotukhin [Fri, 5 Dec 2014 22:29:16 +0000 (22:29 +0000)]
Merging r223170:
Apply loop-rotate to several vectorizer tests.
Such loops shouldn't be vectorized due to the loops form.
After applying loop-rotate (+simplifycfg) the tests again start to check
what they are intended to check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223534
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zolotukhin [Fri, 5 Dec 2014 22:17:26 +0000 (22:17 +0000)]
Merging r221009:
Correctly update dom-tree after loop vectorizer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223531
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 5 Dec 2014 11:06:13 +0000 (11:06 +0000)]
Add the big-endian O32 small structures bugfix to the Mips release notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223459
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 5 Dec 2014 10:20:37 +0000 (10:20 +0000)]
Merging r223148:
------------------------------------------------------------------------
r223148 | dsanders | 2014-12-02 20:40:27 +0000 (Tue, 02 Dec 2014) | 17 lines
[mips] Fix passing of small structures for big-endian O32.
Summary:
Like N32/N64, they must be passed in the upper bits of the register.
The new code could be merged with the existing if-statements but I've
refrained from doing this since it will make porting the O32 implementation
to tablegen harder later.
Reviewers: vmedic
Reviewed By: vmedic
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6463
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223457
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Thu, 4 Dec 2014 22:59:55 +0000 (22:59 +0000)]
Merging r223055:
ARM: lower tail calls correctly when using GHC calling convention.
Patch by Ben Gamari.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223406
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 3 Dec 2014 18:17:15 +0000 (18:17 +0000)]
Merging r223163:
------------------------------------------------------------------------
r223163 | cmatthews | 2014-12-02 14:19:21 -0800 (Tue, 02 Dec 2014) | 5 lines
Give lit a --xunit-xml-output option for saving results in xunit format
--xunit-xml-output saves test results to disk in JUnit's xml format. This will allow Jenkins to report the details of a lit run.
Based on a patch by David Chisnall.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223250
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Wed, 3 Dec 2014 17:21:26 +0000 (17:21 +0000)]
Moved [ASZ]ExtUpper to the end of the CCValAssign::LocInfo enum.
This makes the 3.5.1 version of libLLVM-3.5.so compatible with the 3.5.0 version.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223242
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Wed, 3 Dec 2014 13:43:39 +0000 (13:43 +0000)]
Added release notes for the Mips target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223231
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 19:38:20 +0000 (19:38 +0000)]
Merged from r221604:
[mips] Fix sret arguments for N32/N64 which were accidentally broken in r221534.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223070
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 19:33:33 +0000 (19:33 +0000)]
Merged from r221534:
[mips] Promote i32 arguments to i64 for the N32/N64 ABI and fix <64-bit structs...
Summary:
... and after all that refactoring, it's possible to distinguish softfloat
floating point values from integers so this patch no longer breaks softfloat to
do it.
Remove direct handling of i32's in the N32/N64 ABI by promoting them to
i64. This more closely reflects the ABI documentation and also fixes
problems with stack arguments on big-endian targets.
We now rely on signext/zeroext annotations (already generated by clang) and
the Assert[SZ]ext nodes to avoid the introduction of unnecessary sign/zero
extends.
It was not possible to convert three tests to use signext/zeroext. These tests
are bswap.ll, ctlz-v.ll, ctlz-v.ll. It's not possible to put signext on a
vector type so we just accept the sign extends here for now. These tests don't
pass the vectors the same way clang does (clang puts multiple elements in the
same argument, these map 1 element to 1 argument) so we don't need to worry too
much about it.
With this patch, all known N32/N64 bugs should be fixed and we now pass the
first 10,000 tests generated by ABITestGen.py.
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6117
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223069
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 19:02:59 +0000 (19:02 +0000)]
Merged from r221529:
[mips] Removed the remainder of MipsCC. NFC.
Summary:
One of the calls to AllocateStack (the one in LowerCall) doesn't look like
it should be there but it was there before and removing it breaks the
frame size calculation.
Reviewers: vmedic, theraven
Reviewed By: theraven
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6116
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223065
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 18:57:45 +0000 (18:57 +0000)]
Merged from r221528:
[mips] Remove MipsCC::reservedArgArea() in favour of MipsABIInfo::GetCalleeAllocdArgSizeInBytes(). NFC.
Summary:
Reviewers: theraven, vmedic
Reviewed By: vmedic
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6115
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223063
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 18:52:41 +0000 (18:52 +0000)]
Merged from r221527:
MipsCCState.h: Use LLVM_DELETED_FUNCTION for msc17.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223062
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 18:48:22 +0000 (18:48 +0000)]
Merged from r221525:
[mips] Move MipsCCState to a separate file and clang-formatted it.
Summary:
Reviewers: theraven, vmedic
Reviewed By: vmedic
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6114
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223061
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 18:43:35 +0000 (18:43 +0000)]
Merged from r221522:
[mips] Fix unused variable warnings introduced in r221521
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223058
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 17:14:37 +0000 (17:14 +0000)]
Merged from r221521:
[mips] Remove remaining use of MipsCC::intArgRegs() in favour of MipsABIInfo::GetByValArgRegs() and MipsABIInfo::GetVarArgRegs()
Summary:
Reviewers: theraven, vmedic
Reviewed By: vmedic
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6113
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223053
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 17:12:32 +0000 (17:12 +0000)]
Merged from r221519:
[mips] Remove MipsCC::getRegVT(). NFC
Summary: It's no longer used.
Reviewers: vmedic, theraven
Reviewed By: theraven
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6112
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223052
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 17:05:38 +0000 (17:05 +0000)]
Merged from r221518:
[mips] Remove MipsCC::analyzeCallOperands in favour of CCState::AnalyzeCallOperands. NFC
Summary:
In addition to the usual f128 workaround, it was also necessary to provide
a means of accessing ArgListEntry::IsFixed.
Reviewers: theraven, vmedic
Reviewed By: vmedic
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6111
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223048
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 17:02:26 +0000 (17:02 +0000)]
Merged from r221517:
[mips] Move SpecialCallingConv to MipsCCState and use it from tablegen-erated code. NFC
Summary:
In the long run, it should probably become a calling convention in its own
right but for now just move it out of
MipsISelLowering::analyzeCallOperands() so that we can drop this function
in favour of CCState::AnalyzeCallOperands().
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6085
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223047
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 16:35:35 +0000 (16:35 +0000)]
Merged from r221516:
[mips] Removed IsVarArg from MipsISelLowering::analyzeCallOperands(). NFC.
Summary:
CCState objects already carry this information in their isVarArg() method.
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6084
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223045
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 16:33:17 +0000 (16:33 +0000)]
Merged from r221463:
[mips] Removed IsSoftFloat from MipsISelLowering::analyzeCallOperands(). NFC
Summary:
It isn't used anymore.
Reviewers: vmedic
Reviewed By: vmedic
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6083
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223044
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 16:32:03 +0000 (16:32 +0000)]
Merged from r221461:
[mips] Removed MipsISelLowering::analyzeFormalArguments() in favour of CCState::AnalyzeFormalArguments()
Summary:
As with returns, we must be able to identify f128 arguments despite them
being lowered away. We do this with a pre-analyze step that builds a
vector and then we use this vector from the tablegen-erated code.
Reviewers: vmedic
Reviewed By: vmedic
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6081
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223042
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 16:30:07 +0000 (16:30 +0000)]
Merged from r221146:
[mips] Remove unused prototype and variable. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223041
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 16:26:48 +0000 (16:26 +0000)]
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
Daniel Sanders [Mon, 1 Dec 2014 16:05:07 +0000 (16:05 +0000)]
Merged from r221061:
Renamed CCState members that appear to misspell
'Processed' as 'Proceed'. NFC.
Reviewers: rnk
Reviewed By: rnk
Subscribers: rnk, llvm-commits
Differential Revision: http://reviews.llvm.org/D5978
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223039
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 15:50:46 +0000 (15:50 +0000)]
Merged from r221059:
[mips] Move all ByVal handling into CCState and tablegen-erated code. NFC.
Summary:
CCState already contains a byval implementation that is very similar to the
Mips custom code. This patch merges the custom code into the existing
common code and tablegen-erated code.
Reviewers: vmedic
Reviewed By: vmedic
Subscribers: rnk, llvm-commits
Differential Revision: http://reviews.llvm.org/D5977
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223037
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 15:37:28 +0000 (15:37 +0000)]
Merged from r221058:
[mips] Fix unused variable warning introduced in r221056
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223036
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 15:28:54 +0000 (15:28 +0000)]
Merged from r221057:
[mips] Remove ByValArgInfo::Address in favour of CCValAssign::getMemLocOffset(). NFC.
Summary: ByValArgInfo is practically the same as CCState::ByValInfo now.
Reviewers: vmedic
Reviewed By: vmedic
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5976
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223035
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 15:24:14 +0000 (15:24 +0000)]
Merged from r221056:
[mips] Move F128 argument handling into MipsCCState as we did for returns. NFC.
Summary:
There are a couple more changes to make before analyzeFormalArguments can
be merged into the standard AnalyzeFormalArguments. I've had to temporarily
poke a couple holes in MipsCCState's encapsulation to save having to make
all the required changes for this merge all at once*. These will be removed
shortly.
* We must merge our ByVal argument handling with the implementation in CCState.
This will be done over the next three patches, then the fourth will merge
analyzeFormalArguments with AnalyzeFormalArguments.
Reviewers: vmedic
Reviewed By: vmedic
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5969
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223034
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 15:15:59 +0000 (15:15 +0000)]
Merged from r221054:
[mips] Remove MipsCC::CCInfo. NFC.
Summary:
It's now passed in as an argument to functions that need it. Eventually
this argument will be replaced by the 'this' pointer for a MipsCCState
object.
Reviewers: vmedic
Reviewed By: vmedic
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5967
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223033
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 15:14:34 +0000 (15:14 +0000)]
Merged from r221053:
[mips] Removed MipsCC::fixedArgFn(). NFC
Summary:
There is one remaining trace of it in MipsCC::analyzeCallOperands() where
Mips16 might override the calling convention. This will moved into
tablegen-erated code later.
Reviewers: vmedic
Reviewed By: vmedic
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5966
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223032
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 15:13:16 +0000 (15:13 +0000)]
[tablegen] Add CustomCallingConv and use it to tablegen-erate the outermost parts of the Mips O32 implementation
Summary:
CustomCallingConv is simply a CallingConv that tablegen should not generate the
implementation for. It allows regular CallingConv's to delegate to these custom
functions. This is (currently) necessary for Mips and we cannot use CCCustom
without having to adapt to the different API that CCCustom uses.
This brings us a bit closer to being able to remove
MipsCC::analyzeCallOperands and MipsCC::analyzeFormalArguments in favour of
the common implementation.
No functional change to the targets.
Reviewers: vmedic
Reviewed By: vmedic
Subscribers: vmedic, llvm-commits
Differential Revision: http://reviews.llvm.org/D5965
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223031
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 15:10:11 +0000 (15:10 +0000)]
Added file that should have been in r223022.
I forgot to 'svn add' it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223030
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 14:43:25 +0000 (14:43 +0000)]
Add file that should have been in r223027
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223028
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 14:30:22 +0000 (14:30 +0000)]
Merged from r220568:
[mips] Replace MipsABIEnum with a MipsABIInfo class.
Summary:
No functional change yet, it's just an object replacement for an enum.
It will allow us to gather ABI information in a single place so that we can
start testing for properties of the ABI's instead of the ABI itself.
For example we will eventually be able to use:
ABI.MinStackAlignmentInBytes()
instead of:
(isABI_N32() || isABI_N64()) ? 16 : 8
which is clearer and more maintainable.
Reviewers: matheusalmeida
Reviewed By: matheusalmeida
Differential Revision: http://reviews.llvm.org/D3341
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223027
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 14:28:19 +0000 (14:28 +0000)]
Merged from r220564:
[mips] Fix >80-column line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223026
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 14:26:43 +0000 (14:26 +0000)]
Merged from r220561:
[mips] Remove redundant code in RetCC_MipsN. NFC.
Summary:
i32 is always promoted to i64 so it no longer makes sense to assign i32 to
registers.
Reviewers: vmedic
Reviewed By: vmedic
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5964
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223025
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 14:17:47 +0000 (14:17 +0000)]
Merged from r220556:
[mips] For N32/N64, structs must be passed in the upper bits of a register.
Summary:
Most structs were fixed by r218451 but those of between >32-bits and
<64-bits remained broken since they were not marked with [ASZ]ExtUpper.
This patch fixes the remaining cases by using
CCPromoteToUpperBitsInType<i64> on i64's in addition to i32 and smaller.
Reviewers: vmedic
Reviewed By: vmedic
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5963
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223024
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 14:16:14 +0000 (14:16 +0000)]
Merged from r219931:
[mips] Account for endianess when expanding BuildPairF64/ExtractElementF64 nodes.
Summary:
In order to support big endian targets for the BuildPairF64 nodes we
just need to swap the low/high pair registers. Additionally, for the
ExtractElementF64 nodes we have to calculate the correct stack offset
with respect to the node's register/operand that we want to extract.
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5753
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223023
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 14:15:05 +0000 (14:15 +0000)]
Merged from r219196:
[mips] Return {f128} correctly for N32/N64.
Summary:
According to the ABI documentation, f128 and {f128} should both be returned
in $f0 and $f2. However, this doesn't match GCC's behaviour which is to
return f128 in $f0 and $f2, but {f128} in $f0 and $f1.
Reviewers: vmedic
Reviewed By: vmedic
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5578
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223022
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 14:10:48 +0000 (14:10 +0000)]
Merging r218452:
------------------------------------------------------------------------
r218452 | dsanders | 2014-09-25 14:08:51 +0100 (Thu, 25 Sep 2014) | 3 lines
Add llvm_unreachables() for [ASZ]ExtUpper to X86FastISel.cpp to appease the buildbots.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223021
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 13:58:19 +0000 (13:58 +0000)]
Merged from r218510:
Fix unused variable warning added in r218509
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223020
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 13:55:59 +0000 (13:55 +0000)]
Merged from r218509:
[mips] Generalize the handling of f128 return values to support f128 arguments.
Summary:
This will allow us to handle f128 arguments without duplicating code from
CCState::AnalyzeFormalArguments() or CCState::AnalyzeCallOperands().
No functional change.
Reviewers: vmedic
Reviewed By: vmedic
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5292
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223019
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 13:46:55 +0000 (13:46 +0000)]
Merged from r218451:
[mips] Add CCValAssign::[ASZ]ExtUpper and CCPromoteToUpperBitsInType and handle struct's correctly on big-endian N32/N64 return values.
Summary:
The N32/N64 ABI's require that structs passed in registers are laid out
such that spilling the register with 'sd' places the struct at the lowest
address. For little endian this is trivial but for big-endian it requires
that structs are shifted into the upper bits of the register.
We also require that structs passed in registers have the 'inreg'
attribute for big-endian N32/N64 to work correctly. This is because the
tablegen-erated calling convention implementation only has access to the
lowered form of struct arguments (one or more integers of up to 64-bits
each) and is unable to determine the original type.
Reviewers: vmedic
Reviewed By: vmedic
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5286
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223018
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 13:34:51 +0000 (13:34 +0000)]
Merged from r218036:
[mips] Remove custom versions of CCState::AnalyzeReturn() and CCState::AnalyzeCallReturn().
Summary:
The N32/N64 ABI's return f128 values in $f0 and $f2 for hard-float and $v0 and
$a0 for soft-float. The registers used in the soft-float case differ from the
usual $v0, and $v1 specified for return values.
Both cases were previously handled by duplicating the CCState::AnalyzeReturn()
and CCState::AnalyzeCallReturn() functions and modifying them to delegate to
a different assignment function for f128 and further replace the register type
for the hard-float case. There is a simpler way to do both of these.
We now use the common functions and select an initial assignment function based
on whether the original type is f128 or not. We then handle the hard-float case
using CCBitConvertToType<>.
No functional change.
Reviewers: vmedic
Reviewed By: vmedic
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5269
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223017
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 13:25:44 +0000 (13:25 +0000)]
Merged from r217494:
[mips] Remove inverted predicates from MipsSubtarget that were only used by MipsCallingConv.td
Summary: No functional change
Reviewers: echristo, vmedic
Reviewed By: echristo, vmedic
Subscribers: echristo, llvm-commits
Differential Revision: http://reviews.llvm.org/D5266
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223016
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 1 Dec 2014 13:18:25 +0000 (13:18 +0000)]
Merged from r217485:
[mips] Return an ArrayRef from MipsCC::intArgRegs() and remove MipsCC::numIntArgRegs()
Summary: No functional change.
Reviewers: vmedic
Reviewed By: vmedic
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5265
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223015
91177308-0d34-0410-b5e6-
96231b3b80d8