1658 Commits

Author SHA1 Message Date
Duncan P. N. Exon Smith
a354e21338 Target: Remove unused arguments from overrideSchedPolicy, NFC
TargetSubtargetInfo::overrideSchedPolicy takes two MachineInstr*
arguments (begin and end) that invite implicit conversions from
MachineInstrBundleIterator.  One option would be to change their type to
an iterator, but since they don't seem to have been used since the API
was added in 2010, I'm deleting the dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274304 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-01 00:23:27 +00:00
Duncan P. N. Exon Smith
a204da23db CodeGen: Use MachineInstr& in TargetLowering, NFC
This is a mechanical change to make TargetLowering API take MachineInstr&
(instead of MachineInstr*), since the argument is expected to be a valid
MachineInstr.  In one case, changed a parameter from MachineInstr* to
MachineBasicBlock::iterator, since it was used as an insertion point.

As a side effect, this removes a bunch of MachineInstr* to
MachineBasicBlock::iterator implicit conversions, a necessary step
toward fixing PR26753.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274287 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 22:52:52 +00:00
Rafael Espindola
9931d67967 Delete MCCodeGenInfo.
MC doesn't really care about CodeGen stuff, so this was just
complicating target initialization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274258 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 18:25:11 +00:00
Rafael Espindola
809018e56e Delete unused includes. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274225 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 12:19:16 +00:00
Pankaj Gode
a822c61ca7 [AArch64] Add Broadcom Vulcan scheduling model.
Adding scheduling model for new Broadcom Vulcan core (ARMv8.1A).

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274213 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 06:42:31 +00:00
Craig Topper
8c91459fa9 Use ShuffleVectorSDNode::isSplat member method instead of static method isSplatMask where the mask came directly from getMask() on a shuffle node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274208 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 04:38:51 +00:00
Duncan P. N. Exon Smith
567409db69 CodeGen: Use MachineInstr& in TargetInstrInfo, NFC
This is mostly a mechanical change to make TargetInstrInfo API take
MachineInstr& (instead of MachineInstr* or MachineBasicBlock::iterator)
when the argument is expected to be a valid MachineInstr.  This is a
general API improvement.

Although it would be possible to do this one function at a time, that
would demand a quadratic amount of churn since many of these functions
call each other.  Instead I've done everything as a block and just
updated what was necessary.

This is mostly mechanical fixes: adding and removing `*` and `&`
operators.  The only non-mechanical change is to split
ARMBaseInstrInfo::getOperandLatencyImpl out from
ARMBaseInstrInfo::getOperandLatency.  Previously, the latter took a
`MachineInstr*` which it updated to the instruction bundle leader; now,
the latter calls the former either with the same `MachineInstr&` or the
bundle leader.

As a side effect, this removes a bunch of MachineInstr* to
MachineBasicBlock::iterator implicit conversions, a necessary step
toward fixing PR26753.

Note: I updated WebAssembly, Lanai, and AVR (despite being
off-by-default) since it turned out to be easy.  I couldn't run tests
for AVR since llc doesn't link with it turned on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274189 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 00:01:54 +00:00
Matthias Braun
aa99e51240 AArch64: Remove unnecessary namespace llvm; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273975 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 00:54:33 +00:00
Rafael Espindola
d980ed0d00 Move shouldAssumeDSOLocal to Target.
Should fix the shared library build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273958 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 23:15:57 +00:00
Evandro Menezes
28ea97622f [AArch64] Adjust the model for the vector by element FP multiplies on Exynos M1. (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273708 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 18:58:54 +00:00
Evandro Menezes
ae6762ba78 [AArch64] Model the cost of vector by element FP multiplies on Exynos M1. (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273630 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-23 23:43:23 +00:00
Chad Rosier
577fa41d50 [AArch64] Remove an overly aggressive assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273458 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 19:18:52 +00:00
Krzysztof Parzyszek
d140aab2ca [SDAG] Remove FixedArgs parameter from CallLoweringInfo::setCallee
The setCallee function will set the number of fixed arguments based
on the size of the argument list. The FixedArgs parameter was often
explicitly set to 0, leading to a lack of consistent value for non-
vararg functions.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273403 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 12:54:25 +00:00
Rafael Espindola
117a36f8b1 Delete more dead code.
Found by gcc 6.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273402 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 12:44:16 +00:00
Haicheng Wu
1fb090e593 [Kryo] Enable loop prefetcher.
Differential Revision: http://reviews.llvm.org/D21535

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273329 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-21 22:47:56 +00:00
Evandro Menezes
86a9578e21 [AArch64] Change the preferred alignment for char and short to word alignment
Differential Revision: http://reviews.llvm.org/D21414

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273279 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-21 15:55:18 +00:00
Silviu Baranga
a992667d4c [AArch64] Restore codegen for AArch64 Cortex-A72/A73 after NFCI
Summary:
Code generation for Cortex-A72/Cortex-A73 was accidentally changed
by r271555, which was a NFCI. The isCortexA57() predicate was not true
for Cortex-A72/Cortex-A73 before r271555 (since it was checking the CPU
string). Because Cortex-A72/Cortex-A73 inherit all features from Cortex-A57,
all decisions previously guarded by isCortexA57() are now taken.

This change restores the behaviour before r271555 by adding separate
ProcA72/ProcA73, which have the required features to preserve code
generation.

Reviewers: kristof.beyls, aadg, mcrosier, rengolin

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273277 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-21 15:53:54 +00:00
David Majnemer
c1362817c9 Replace silly uses of 'signed' with 'int'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273244 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-21 05:10:24 +00:00
Evandro Menezes
8ff4f4ad5b [AArch64] Adjust the loop buffer size for Exynos M1 (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273185 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-20 18:39:41 +00:00
Pankaj Gode
eca908ec2f [AARCH64] Add support for Broadcom Vulcan
Adding core tuning support for new Broadcom Vulcan core (ARMv8.1A).

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273148 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-20 11:13:31 +00:00
NAKAMURA Takumi
82f8dab579 Untabify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273129 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-20 00:37:41 +00:00
Matt Arsenault
dc9478ac13 AArch64: Fix range loop contradicting comment above it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272959 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 21:21:49 +00:00
Tim Northover
bde073f537 AArch64: allow MOV (imm) alias to be printed
The backend has been around for years, it's pretty ridiculous that we can't
even use the preferred form for printing "MOV" aliases. Unfortunately, TableGen
can't handle the complex predicates when printing so it's a bunch of nasty C++.
Oh well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272865 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-16 01:42:25 +00:00
Tim Northover
4d6b849855 AArch64: stop trying to use 32-bit MOVZs when expanding patchpoints.
Of course the assembly was right but because the opcode was MOVZWi it was
encoded as "movz w16, #65535, lsl #32" which is an unallocated encoding and
would go horribly wrong on a CPU.

No idea how this bug survived this long. It seems nobody is using that aspect
of patchpoints.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272831 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 20:33:36 +00:00
Pankaj Gode
7d829a30aa Test commit after access grant. Modified comment by adding a period.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272808 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 17:24:52 +00:00
Kevin Enderby
f50be3faf2 Update the AArch64ExternalSymbolizer to print literal strings as escaped strings
so it is the same as the MCExternalSymbolizer.

rdar://17349181


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272588 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13 21:08:57 +00:00
Benjamin Kramer
af18e017d2 Pass DebugLoc and SDLoc by const ref.
This used to be free, copying and moving DebugLocs became expensive
after the metadata rewrite. Passing by reference eliminates a ton of
track/untrack operations. No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272512 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-12 15:39:02 +00:00
Chad Rosier
2f95796df1 [AArch64] Move comments closer to relevant check. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272430 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-10 20:49:18 +00:00
Chad Rosier
ecfe18a2b2 [AArch64] Refactor a check earlier. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272429 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-10 20:47:14 +00:00
Evandro Menezes
57e41973e8 [AArch64] Add preferred alignments for Exynos M1
Differential Revision: http://reviews.llvm.org/D21203

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272400 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-10 16:00:18 +00:00
Saleem Abdulrasool
d389f8dd86 AArch64: support the .arch directive in the IAS
Add support to the AArch64 IAS for the `.arch` directive.  This allows the
assembly input to use architectural functionality in part of a file.  This is
used in existing code like BoringSSL.

Resolves PR26016!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272241 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 02:56:40 +00:00
Benjamin Kramer
36538ffe93 Apply most suggestions of clang-tidy's performance-unnecessary-value-param
Avoids unnecessary copies. All changes audited & pass tests with asan.
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272190 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 19:09:22 +00:00
Quentin Colombet
792b56f6a7 [AArch64][RegisterBankInfo] G_OR are fine on either GPR or FPR.
Teach AArch64RegisterBankInfo that G_OR can be mapped on either GPR or
FPR for 64-bit or 32-bit values.

Add test cases demonstrating how this information is used to coalesce a
computation on a single register bank.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272170 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 16:53:32 +00:00
Benjamin Kramer
04a303b821 Avoid copies of std::strings and APInt/APFloats where we only read from it
As suggested by clang-tidy's performance-unnecessary-copy-initialization.
This can easily hit lifetime issues, so I audited every change and ran the
tests under asan, which came back clean.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272126 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 10:01:20 +00:00
Quentin Colombet
d292b5eaf2 [AArch64][RegisterBankInfo] Use the generic implementation of copyCost.
Long term we may want to give high cost at FPR to/from GPR copies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272086 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 01:24:00 +00:00
Quentin Colombet
edb4f7c12a [RegisterBankInfo] Add a size argument for the cost of copy.
The cost of a copy may be different based on how many bits we have to
copy around. E.g., a 8-bit copy may be different than a 32-bit copy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272084 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 01:11:03 +00:00
Geoff Berry
f323692d97 Reapply [AArch64] Fix isLegalAddImmediate() to return true for valid negative values.
Originally reviewed here: http://reviews.llvm.org/D17463

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272023 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-07 16:48:43 +00:00
Chad Rosier
2ef8a598eb [AArch64] Spot SBFX-compatible code expressed with sign_extend.
This is very similar to r271677, but for extracts from i32 with the SIGN_EXTEND
acting on a arithmetic shift.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271717 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-03 20:05:49 +00:00
Chad Rosier
ce31d93762 [AArch64] Spot SBFX-compatbile code expressed with sign_extend_inreg.
We were assuming all SBFX-like operations would have the shl/asr form, but often
when the field being extracted is an i8 or i16, we end up with a
SIGN_EXTEND_INREG acting on a shift instead.

This is a port of r213754 from ARM to AArch64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271677 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-03 15:00:09 +00:00
Sjoerd Meijer
2fca6568ee RAS extensions are part of ARMv8.2-A. This change enables them by introducing a
new instruction to ARM and AArch64 targets and several system registers.

Patch by: Roger Ferrer Ibanez and Oliver Stannard

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271670 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-03 14:03:27 +00:00
Sanjay Patel
a96468b9ad transform obscured FP sign bit ops into a fabs/fneg using TLI hook
This is effectively a revert of:
http://reviews.llvm.org/rL249702 - [InstCombine] transform masking off of an FP sign bit into a fabs() intrinsic call (PR24886)
and:
http://reviews.llvm.org/rL249701 - [ValueTracking] teach computeKnownBits that a fabs() clears sign bits
and a reimplementation as a DAG combine for targets that have IEEE754-compliant fabs/fneg instructions.

This is intended to resolve the objections raised on the dev list:
http://lists.llvm.org/pipermail/llvm-dev/2016-April/098154.html
and:
https://llvm.org/bugs/show_bug.cgi?id=24886#c4

In the interest of patch minimalism, I've only partly enabled AArch64. PowerPC, MIPS, x86 and others can enable later.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271573 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 20:01:37 +00:00
Matthias Braun
70f2292ce7 AArch64: Do not test for CPUs, use SubtargetFeatures
Testing for specific CPUs has a number of problems, better use subtarget
features:
- When some tweak is added for a specific CPU it is often desirable for
  the next version of that CPU as well, yet we often forget to add it.
- It is hard to keep track of checks scattered around the target code;
  Declaring all target specifics together with the CPU in the tablegen
  file is a clear representation.
- Subtarget features can be tweaked from the command line.

To discourage people from using CPU checks in the future I removed the
isCortexXX(), isCyclone(), ... functions. I added an getProcFamily()
function for exceptional circumstances but made it clear in the comment
that usage is discouraged.

Reformat feature list in AArch64.td to have 1 feature per line in
alphabetical order to simplify merging and sorting for out of tree
tweaks.

No functional change intended.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271555 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 18:03:53 +00:00
Geoff Berry
c22d8b1ed9 [PEI, AArch64] Use empty spaces in stack area for local stack slot allocation.
Summary:
If the target requests it, use emptry spaces in the fixed and
callee-save stack area to allocate local stack objects.

AArch64: Change last callee-save reg stack object alignment instead of
size to leave a gap to take advantage of above change.

Reviewers: t.p.northover, qcolombet, MatzeB

Subscribers: rengolin, mcrosier, llvm-commits, aemerson

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271527 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 16:22:07 +00:00
Sjoerd Meijer
feb0d0e38e This adds support for Cortex-A73 as an available target.
Differential Revision: http://reviews.llvm.org/D20865


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271508 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 10:48:52 +00:00
Rafael Espindola
f2b59e8119 Delete AArch64II::MO_CONSTPOOL.
A constant pool holding the address of a variable in equivalent to
a got entry. It produces exactly the same instruction sequence as a
got use and unlike a got use this is not uniqued by the linker.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271311 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-31 18:31:14 +00:00
Matthias Braun
8bcf561616 AArch64: Fix indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271084 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 01:06:51 +00:00
Matthias Braun
da265fc2fa AArch64Subtarget: Use default member initializers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271057 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 22:14:09 +00:00
Benjamin Kramer
0ad6107994 Apply clang-tidy's misc-static-assert where it makes sense.
Also fold conditions into assert(0) where it makes sense. No functional
change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270982 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 11:36:04 +00:00
Chad Rosier
6b9dd0cef1 [AArch64] Generate rev16/rev32 from bswap + srl when upper bits are known zero.
Canonicalize (srl (bswap i32 x), 16) to (rotr (bswap i32 x), 16), if the high
16-bits of x are zero. Similarly, canonicalize (srl (bswap i64 x), 32) to
(rotr (bswap i64 x), 32), if the high 32-bits of x are zero.

test_rev_w_srl16:            test_rev_w_srl16:
  and w8, w0, #0xffff          and     w8, w0, #0xffff
  rev w8, w8           --->    rev16   w0, w8
  lsr     w0, w8, #16

test_rev_x_srl32:            test_rev_x_srl32:
  rev x8, x8           --->    rev32   x0, x8
  lsr x0, x8, #32

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270896 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 19:41:33 +00:00
Chad Rosier
65074d6f38 [AArch64] Generate a BFI/BFXIL from 'or (and X, MaskImm), OrImm'.
If and only if the value being inserted sets only known zero bits.

This combine transforms things like

  and w8, w0, #0xfffffff0
  movz w9, #5
  orr w0, w8, w9

into

  movz w8, #5
  bfxil w0, w8, #0, #4

The combine is tuned to make sure we always reduce the number of instructions.
We avoid churning code for what is expected to be performance neutral changes
(e.g., converted AND+OR to OR+BFI).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270846 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 13:27:56 +00:00