37939 Commits

Author SHA1 Message Date
Daniel Sanders
43d2886cca [mips][micromips] Make getPointerRegClass() result depend on the instruction.
Summary:
Previously, it returned the GPR16MMRegClass for all instructions which was
incorrect for instructions like lwsp/lwgp and unnecesarily restricted the
permitted registers for instructions like lw32.

This fixes quite a few of the -verify-machineinstrs errors reported in PR27458.
I've only added -verify-machineinstrs to one test in this change since I
understand there is a plan to enable the verifier by default.

Reviewers: hvarga, zbuljan, zoran.jovanovic, sdardis

Subscribers: dsanders, llvm-commits, sdardis

Differential Revision: http://reviews.llvm.org/D19873

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268918 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 13:38:25 +00:00
Simon Pilgrim
0f420ada79 [X86][SSE] Added TODO comment to add support for AVX512 mask registers to shuffle comments
This came up in discussion on D19198

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268915 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 13:30:16 +00:00
Daniel Sanders
b2292f8443 [mips] Fix use after free and an unnecessary copy introduced in r268896.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268913 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 13:10:57 +00:00
Strahinja Petrovic
a16fdea51a [PowerPC] fix register alignment for long double type
This patch fixes register alignment for long double type in
soft float mode. Before this patch alignment was 8 and this
patch changes it to 4.
Differential Revision: http://reviews.llvm.org/D18034



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268909 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 12:27:39 +00:00
Chris Dewhurst
e06fb6bce7 [Sparc][LEON] Add UMAC and SMAC instruction support for Sparc LEON subtargets
This change adds SMAC (signed multiply-accumulate) and UMAC (unsigned multiply-accumulate) for LEON subtargets of the Sparc processor.

The new files LeonFeatures.td and leon-instructions.ll will both be expanded in future, so I want to leave them separate as small files for this review, to be expanded in future check-ins.

Note: The functions are provided only for inline-assembly provision. No DAG selection is provided.

Differential Revision: http://reviews.llvm.org/D19911

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268908 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 11:55:15 +00:00
Silviu Baranga
784cb3fef6 [AArch64] Implement lowering of the X constraint on AArch64
Summary:
This implements the lowering of the X constraint on
AArch64.

The default behaviour of the X constraint lowering is to
restrict it to "f". This is a problem because the "f"
constraint is not implemented on AArch64 and would be too
restrictive anyway. Therefore, the AArch64 hook will
lower this to "w" (if the operand is a floating point or
vector) or "r" otherwise.

The implementation is similar with the one added for
ARM (r267411).

This is the AArch64 side of the fix for http://llvm.org/PR26493

Reviewers: rengolin

Subscribers: aemerson, rengolin, llvm-commits, t.p.northover

Differential Revision: http://reviews.llvm.org/D19967

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268907 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 11:10:44 +00:00
Benjamin Kramer
bc38c49428 Revert "[Mips] Fix use after free."
Fixes use after free but breaks tests.

This reverts commit r268901.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268902 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 10:31:17 +00:00
Benjamin Kramer
04c6ebbe71 [Mips] Fix use after free.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268901 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 10:21:56 +00:00
Daniel Sanders
0b6e0490cf [mips][ias] R_MIPS_(GOT|HI|LO|PC)16 and R_MIPS_GPREL32 do not need symbols.
Summary:
In theory, care must be taken to ensure that pairs of R_MIPS_(GOT|HI|LO)16
make the same decision on both relocs in the reloc pair but in practice
this isn't as hard as it sounds and only limits the complexity of the
predicate used. We handle all three with the same code to ensure their
decisions always agree with each other.

Reviewers: sdardis

Subscribers: rafael, dsanders, sdardis, llvm-commits

Differential Revision: http://reviews.llvm.org/D19016


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268900 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 10:21:14 +00:00
Zlatko Buljan
dc02050702 [mips][microMIPS] Implement LWP and SWP instructions
Differential Revision: http://reviews.llvm.org/D10640


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268896 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 08:07:28 +00:00
Craig Topper
3c29a695f2 [X86] Strengthen some type contraints for floating point round and extend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268892 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 05:34:14 +00:00
Craig Topper
63eccc2eca [AVX512] Fix up types for arguments of int_x86_avx512_mask_cvtsd2ss_round and int_x86_avx512_mask_cvtss2sd_round. Only the argument being converted should be a different type. The other 2 argument should have the same type as the result.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268891 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 05:34:12 +00:00
Craig Topper
84a0ca551e [AVX512] Add non-temporal store patterns for v16i32/v32i16/v64i8.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268889 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-08 23:43:17 +00:00
Craig Topper
f453dfba6f [AVX512] Add missing patterns for non-temporal stores of 128/256-bit vXi8/vXi16/vXi32 when VLX is enabled. The equivalent AVX1/2 patterns are disabled by VLX.
This caused regular stores to be emitted instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268886 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-08 23:08:45 +00:00
Craig Topper
5cb772fb8a [AVX512] Change predicates on some vXi16/vXi8 AVX store patterns so they stay enabled unless VLX and BWI instructions are supported."
Without this we could fail instruction selection if VLX was enabled, but BWI wasn't.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268885 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-08 23:08:40 +00:00
Craig Topper
dba67a4fdb [AVX512] Add VLX 128/256-bit SET0 operations that encode to 128/256-bit EVEX encoded VPXORD so all 32 registers can be used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268884 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-08 21:33:53 +00:00
Craig Topper
ba458cf29f [X86] Remove extra patterns that check for BUILD_VECTOR of all 0s. These are always canonicalized to v4i32/v8i32/v16i32 except for in SSE1 only when only v4f32 is supported.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268880 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-08 20:10:20 +00:00
David Majnemer
aa09aeb5c0 [X86] Promote several single precision FP libcalls on Windows
A number of libcalls don't exist in any particular lib but are, instead,
defined in math.h as inline functions (even in C mode!).  Don't rely on
their existence when lowering @llvm.{cos,sin,floor,..}.f32, promote them
instead.

N.B. We had logic to handle FREM but were missing out on a number of
others.  This change generalizes the FREM handling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268875 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-08 08:15:50 +00:00
Craig Topper
82b3d2dd64 [X86] Lower 256-bit vector all-zero constants to v8i32 even with AVX1 only. Either way a 256-bit VXORPS will be used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268873 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-08 07:10:54 +00:00
Craig Topper
7e89a31db3 [X86] Add patterns for 256-bit non-temporal stores when only AVX1 is supported. While there, add a predicate to the SSE2 patterns to avoid an ordering dependency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268872 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-08 07:10:50 +00:00
Craig Topper
16942ada10 [X86] No need to avoid selecting AVX_SET0 for 256-bit integer types when only AVX1 is supported. AVX_SET0 just expands to 256-bit VXORPS which is legal in AVX1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268871 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-08 07:10:47 +00:00
Weiming Zhao
a9ffc49ea9 [ARM] Fix Scavenger assert due to underestimated stack size
(re-apply r268810 as it exposed an uninitialized variable in ARM MFI.
 Patch 268868 should fix that.)

Summary:
Currently, when checking if a stack is "BigStack" or not, it doesn't count into spills and arguments. Therefore, LLVM won't reserve spill slot for this actually "BigStack". This may cause scavenger failure.

Reviewers: rengolin

Subscribers: vitalybuka, aemerson, rengolin, tberghammer, danalbert, srhines, llvm-commits

Differential Revision: http://reviews.llvm.org/D19896

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268869 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-08 05:11:54 +00:00
Weiming Zhao
4e54474603 Fix use-of-uninitialized-value of ARMMachineFunctionInfo
Summary: Explicitly initialize ArgumentStackSize to prevent the msan failure.

Reviewers: rengolin

Subscribers: aemerson, rengolin, llvm-commits

Differential Revision: http://reviews.llvm.org/D20051

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268868 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-08 05:04:47 +00:00
Craig Topper
fe2a4e4f58 [X86] Fix InstAliases to not allow FARCALL32i/FARCALL16i/FARJMP32i/FARJMP16i in 64-bit mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268863 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-07 19:25:56 +00:00
Simon Pilgrim
d2bfb61994 [X86] Pulled out duplicate mask width calculation. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268861 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-07 18:04:24 +00:00
Sanjay Patel
2f183e0a89 [x86, BMI] add TLI hook for 'andn' and use it to simplify comparisons
For the sake of minimalism, this patch is x86 only, but I think that at least
PPC, ARM, AArch64, and Sparc probably want to do this too.

We might want to generalize the hook and pattern recognition for a target like
PPC that has a full assortment of negated logic ops (orc, nand).

Note that http://reviews.llvm.org/D18842 will cause this transform to trigger
more often.

For reference, this relates to:
https://llvm.org/bugs/show_bug.cgi?id=27105
https://llvm.org/bugs/show_bug.cgi?id=27202
https://llvm.org/bugs/show_bug.cgi?id=27203
https://llvm.org/bugs/show_bug.cgi?id=27328

Differential Revision: http://reviews.llvm.org/D19087



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268858 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-07 15:03:40 +00:00
NAKAMURA Takumi
2dea119616 MipsELFObjectWriter.cpp: Activate debug printer just for +Asserts. [-Wunused-function]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268848 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-07 04:51:51 +00:00
Vitaly Buka
8c0a5acc5f Revert r268810 becase it brakes msan bot.
16802==WARNING: MemorySanitizer: use-of-uninitialized-value
    lib/Target/ARM/ARMFrameLowering.cpp:1632

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268833 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-07 01:54:00 +00:00
Ahmed Bougacha
4c690f3954 [X86] Teach X86FixupBWInsts to promote MOV8rr/MOV16rr to MOV32rr.
This re-applies r268760, reverted in r268794.
Fixes http://llvm.org/PR27670

The original imp-defs assertion was way overzealous: forward all
implicit operands, except imp-defs of the new super-reg def (r268787
for GR64, but also possible for GR16->GR32), or imp-uses of the new
super-reg use.
While there, mark the source use as Undef, and add an imp-use of the
old source reg: that should cover any case of dead super-regs.

At the stage the pass runs, flags are unlikely to matter anyway;
still, let's be as correct as possible.

Also add MIR tests for the various interesting cases.

Original commit message:
Codesize is less (16) or equal (8), and we avoid partial
dependencies.

Differential Revision: http://reviews.llvm.org/D19999

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268831 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-07 01:11:17 +00:00
Ahmed Bougacha
9ea4c644e1 [X86] Register and initialize the FixupBW pass.
That lets us use it in MIR tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268830 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-07 01:11:10 +00:00
Weiming Zhao
73d21e430b [ARM] Fix Scavenger assert due to underestimated stack size
(this is resubmit of r268529 with minor refactoring. r268529 was reverted
 at r268536 due a memory sanitizer failure.  I have not been able to
 reproduce that failure and I checked all the variable used in my change
 but I could not spot an issue. I did some refactoring and see if it will
 give a clearer hint)

Summary:
Currently, when checking if a stack is "BigStack" or not, it doesn't count into spills and arguments. Therefore, LLVM won't reserve spill slot for this actually "BigStack". This may cause scavenger failure.

Reviewers: rengolin

Subscribers: vitalybuka, aemerson, rengolin, tberghammer, danalbert, srhines, llvm-commits

Differential Revision: http://reviews.llvm.org/D19896

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268810 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 22:20:13 +00:00
Quentin Colombet
5671ebed25 Revert "[X86] Add a new LOW32_ADDR_ACCESS_RBP register class."
This reverts commit r268796.
I believe it breaks test/CodeGen/X86/asm-mismatched-types.ll with:
Cannot emit physreg copy instruction

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268799 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 21:21:50 +00:00
Quentin Colombet
72d2da5ca3 [X86] Add a new LOW32_ADDR_ACCESS_RBP register class.
ABIs like NaCl uses 32-bit addresses but have 64-bit frame.
The new register class reflects those constraints when choosing a
register class for a address access.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268796 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 21:10:53 +00:00
Quentin Colombet
93cbe6ed35 [X86] Rename the X32_ADDR_ACCESS register class into LOW32_ADDR_ACCESS.
This register class may be used by any ABIs that uses x86_64 ISA while
using 32-bit addresses, not just in X32 cases. Make sure the name
reflects that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268795 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 21:10:43 +00:00
Nico Weber
a019a2c0f5 Revert r268760, it caused PR27670.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268794 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 21:07:02 +00:00
Ahmed Bougacha
9c0ef542c4 [X86] Accept imp-defs of GR64 super-registers in FixupBW MOVrr.
Testcase will follow shortly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268787 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 20:03:03 +00:00
Artem Tamazov
3b474d0d88 [AMDGPU][llvm-mc] Some refactoring of .td files
Some custom Operands and AsmOperandClasses moved to proper place.
No functional changes.

Differential Revision: http://reviews.llvm.org/D20012

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268780 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 19:32:38 +00:00
Krzysztof Parzyszek
687c1919cc [Hexagon] Be careful about anti-dependencies with a call in packetizer
In a case like
  J2_callr <ga:@foo>, %R0<imp-use>, ...
  R0<def> = ...
the anti-dependency on R0 cannot be ignored and the two instructions
cannot be packetized together, since if they were, the assignment to
R0 would take place before the call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268776 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 19:13:38 +00:00
Quentin Colombet
d26da6c773 [X86] Get rid of X32_NOREX_ADDR_ACCESS register class.
According to H.J. Lu <hjl.tools@gmail.com>, this register class is never
used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268771 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 18:22:48 +00:00
Artem Tamazov
ea912da38b [AMDGPU][llvm-mc] Add support for sendmsg(...) syntax.
Added support for sendmsg(MSG[, OP[, STREAM_ID]]) syntax
in s_sendmsg and s_sendmsghalt instructions.
The syntax matches the SP3 assembler/disassembler rules.
That is why implicit inputs (like M0 and EXEC) are not printed
to disassembly output anymore.

sendmsg(...) allows only known message types and attributes,
even if literals are used instead of symbolic names.
However, raw literal (without "sendmsg") still can be used,
and that allows for any 16-bit value.

Tests updated/added.

Differential Revision: http://reviews.llvm.org/D19596

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268762 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 17:48:48 +00:00
Ahmed Bougacha
292650f3ea [X86] Teach X86FixupBWInsts to promote MOV8rr/MOV16rr to MOV32rr.
Codesize is less (16) or equal (8), and we avoid partial dependencies.

Differential Revision: http://reviews.llvm.org/D19999

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268760 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 17:42:57 +00:00
Ahmed Bougacha
a2a67a1732 [X86] Remove \brief in FixupBW. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268754 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 17:28:47 +00:00
Ahmed Bougacha
0ebb0b2998 [X86] Simplify FixupBW sub_8bit_hi-related logic. NFC.
Instead of passing around sizes and asking for subregs, we can check
the subreg indices we care about: sub_8bit_hi and sub_8bit.

Differential Revision: http://reviews.llvm.org/D20006

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268753 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 17:28:42 +00:00
Geoff Berry
b3b95be2f2 [AArch64] Combine callee-save and local stack SP adjustment instructions.
Summary:
If a function needs to allocate both callee-save stack memory and local
stack memory, we currently decrement/increment the SP in two steps:
first for the callee-save area, and then for the local stack area.  This
changes the code to allocate them both at once at the very beginning/end
of the function.  This has two benefits:

1) there is one fewer sub/add micro-op in the prologue/epilogue

2) the stack adjustment instructions act as a scheduling barrier, so
moving them to the very beginning/end of the function increases post-RA
scheduler's ability to move instructions (that only depend on argument
registers) before any of the callee-save stores

This change can cause an increase in instructions if the original local
stack SP decrement could be folded into the first store to the stack.
This occurs when the first local stack store is to stack offset 0.  In
this case we are trading off one more sub instruction for one fewer sub
micro-op (along with benefits (2) and (3) above).

Reviewers: t.p.northover

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

Differential Revision: http://reviews.llvm.org/D18619

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268746 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 16:34:59 +00:00
Jun Bum Lim
bf20d51239 [AArch64] Decouple zero store promotion from narrow ld merge. NFC.
Summary: This change refactors to decouple the zero store promotion from the narrow ld merge and add a flag (enable-narrow-ld-merge=true) to control the narrow ld merge optimization.

Reviewers: jmolloy, t.p.northover, mcrosier

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

Differential Revision: http://reviews.llvm.org/D19885

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268744 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 15:08:57 +00:00
Nikolay Haustov
6bad5855c4 Revert "AMDGPU/SI: Add amdgpu_kernel calling convention. Part 2."
This reverts commit 47486d52454d60cdf6becc0b2efe533c73794380.

It broke calling OpenCL kernel from another kernel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268739 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 14:59:04 +00:00
Daniel Sanders
98bdc0b79f [mips] Fix inconsistent .cprestore behaviour between direct object emission and assembling.
Summary:
Direct object emission has an initialization order problem where an
InitMCObjectFile is called after MipsTargetELFStreamer determines whether
PIC is enabled by default or not. There doesn't seem to be point that
initializes all cases so split the responsibility between
MipsTargetELFStreamer and MipsAsmPrinter.

Reviewers: sdardis

Subscribers: dsanders, llvm-commits, sdardis

Differential Revision: http://reviews.llvm.org/D19728

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268737 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 14:37:24 +00:00
Daniel Sanders
134705a273 [mips] Correct the ordering of HI/LO pairs in the relocation table.
Summary:
There seems to have been a misunderstanding as to the meaning of 'offset' in
the rules laid down by our ABI. The previous code believed that 'offset' meant
the offset within the section that the relocation is applied to. However, it
should have meant the offset from the symbol used in the relocation expression.

This patch adds two fields to ELFRelocationEntry and uses them to correct the
order of relocations for MIPS. These fields contain:
* The original symbol before shouldRelocateWithSymbol() is considered. This
  ensures that R_MIPS_GOT16 is able to correctly distinguish between local and
  external symbols, allowing us to tell whether %got() requires a matching
  %lo() or not (local symbols require one, external symbols don't). It also
  prevents confusing cases where the fuzzy matching rules cause things like
  %hi(foo)/%lo(foo+3) and %hi(bar)/%lo(bar+1) to swap their %lo()'s.
* The original offset before shouldRelocateWithSymbol() is considered. The
  existing Addend field is always zero when the object uses in place addends
  (because it's already moved it to the encoding) but MIPS needs to use the
  original offset to ensure that the linker correctly calculates the carry-in
  bit for %hi() and %got().

IAS ensures that unmatchable %hi()/%got() relocations are placed at the end of
the table to ensure that the linker rejects the table (we're unable to report
such errors directly). The alternatives to this risk accidental matching
against inappropriate relocations which may silently compute incorrect values
due to an incorrect carry bit between the %lo() and %hi()/%got().

Reviewers: sdardis

Subscribers: dsanders, sdardis, rafael, llvm-commits

Differential Revision: http://reviews.llvm.org/D19718


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268733 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 13:49:25 +00:00
Daniel Sanders
70942f0271 [mips][mips16] Use isUnconditionalBranch() in AnalyzeBranch() and constant island pass.
Summary:
This stops it misidentifying unconditional branches as conditional branches
which fixes a -verify-machineinstrs error about exiting a function via fall through.

Reviewers: sdardis

Subscribers: dsanders, sdardis, llvm-commits

Differential Revision: http://reviews.llvm.org/D19864

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268731 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 13:23:51 +00:00
Daniel Sanders
062dfa5b22 [mips][fastisel] Conditional moves do not have implicit operands.
Reviewers: sdardis

Subscribers: dsanders, sdardis, llvm-commits

Differential Revision: http://reviews.llvm.org/D19862

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268730 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 12:57:26 +00:00