Commit Graph

165938 Commits

Author SHA1 Message Date
Jonas Devlieghere fb0b759b0a [llvm-mt] Use WithColor for printing errors.
Use the WithColor helper from support to print errors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335416 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-23 16:49:07 +00:00
Jonas Devlieghere 9fa78621e7 [TableGen] Use WithColor for printing errors/warnings
Use the WithColor helper from support to print errors and warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335415 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-23 16:48:03 +00:00
Craig Topper b457430300 [X86] Make %eiz usage in 64-bit mode, force a 0x67 address size prefix. Fix some test CHECK lines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335414 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-23 06:15:04 +00:00
Craig Topper 4fc14da1fc [X86] Teach disassembler to use %eip instead of %rip when 0x67 prefix is used on a rip-relative address.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335413 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-23 06:03:48 +00:00
Craig Topper af8308f06a [X86][AsmParser] Improve base/index register checks.
-Ensure EIP isn't used with an index reigster.
-Ensure EIP isn't used as index register.
-Ensure base register isn't a vector register.
-Ensure eiz/riz usage matches the size of their base register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335412 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-23 05:53:00 +00:00
Stanislav Mekhanoshin 17957ec5e5 Fix invariant fdiv hoisting in LICM
FDiv is replaced with multiplication by reciprocal and invariant
reciprocal is hoisted out of the loop, while multiplication remains
even if invariant.

Switch checks for all invariant operands and only invariant
denominator to fix the issue.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335411 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-23 04:01:28 +00:00
Reid Kleckner 00f00bab00 [AMDGPU] Update includes for intrinsic changes :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335409 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-23 03:05:39 +00:00
Lang Hames adc5f0ab25 [ORC] Fix formatting and list pending queries in VSO::dump.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335408 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-23 02:22:10 +00:00
Reid Kleckner af7c445dfa [IR] Split Intrinsics.inc into enums and implementations
Implements PR34259

Intrinsics.h is a very popular header. Most LLVM TUs care about things
like dbg_value, but they don't care how they are implemented. After I
split these out, IntrinsicImpl.inc is 1.7 MB, so this saves each LLVM TU
from scanning 1.7 MB of source that gets pre-processed away.

It also means we can modify intrinsic properties without triggering a
full rebuild, but that's probably less of a win.

I think the next best thing to do would be to split out the target
intrinsics into their own header. Very, very few TUs care about
target-specific intrinsics. It's very hard to split up the target
independent intrinsics like llvm.expect, assume, and dbg.value, though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335407 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-23 02:02:38 +00:00
Reid Kleckner dc14c20b63 Avoid including intrin.h from MathExtras.h
This is repeatably worth 0.3s compile time on MathExtras.cpp. This is a
very popular header, and it basically pulls all Intel intrinsics into
every LLVM TU. Let's not do that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335406 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-23 01:19:49 +00:00
Fangrui Song 98ae3708b4 [ELF] Change isSectionData to exclude SHF_EXECINSTR
Summary:
This affects what sections are displayed as "DATA" in llvm-objdump.
The other user llvm-size is unaffected.

Before, a "TEXT" section is also "DATA", which seems weird.
The sh_flags condition matches that of bfd's SEC_DATA but the sh_type
condition uses (== SHF_PROGBITS) instead of bfd's (!= SHT_NOBITS).
bfd's SEC_DATA is not appealing as so many sections will be shown as DATA.

Reviewers: jyknight, Bigcheese

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335405 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-23 00:15:33 +00:00
Craig Topper ba5eea7881 [X86][AsmParser] Rework that allows (%dx) to be used in place of %dx with in/out instructions.
Previously, to support (%dx) we left a wide open hole in our 16-bit memory address checking. This let this address value be used with any instruction without error in the parser. It would later fail in the encoder with an assertion failure on debug builds and who knows what on release builds.

This patch passes the mnemonic down to the memory operand parsing function so we can allow the (%dx) form only on specific instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335403 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-23 00:03:20 +00:00
Reid Kleckner 10fa02975b [RuntimeDyld] Implement the ELF PIC large code model relocations
Prerequisite for https://reviews.llvm.org/D47211 which improves our ELF
large PIC codegen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335402 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 23:53:22 +00:00
Eli Friedman ea67fb768b [LoopReroll] Rewrite induction variable rewriting.
This gets rid of a bunch of weird special cases; instead, just use SCEV
rewriting for everything.  In addition to being simpler, this fixes a
bug where we would use the wrong stride in certain edge cases.

The one bit I'm not quite sure about is the trip count handling,
specifically the FIXME about overflow.  In general, I think we need to
widen the exit condition, but that's probably not profitable if the new
type isn't legal, so we probably need a check somewhere.  That said, I
don't think I'm making the existing problem any worse.

As a followup to this, a bunch of IV-related code in root-finding could
be cleaned up; with SCEV-based rewriting, there isn't any reason to
assume a loop will have exactly one or two PHI nodes.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335400 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 22:58:55 +00:00
George Burgess IV 78cd292954 [MSSA] Remove incorrect comment + autoify dyn_cast results; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335399 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 22:34:07 +00:00
Craig Topper 61a101317c [X86][AsmParser] Keep track of whether an explicit scale was specified while parsing an address in Intel syntax. Use it for improved error checking.
This allows us to check these:
-16-bit addressing doesn't support scale so we should error if we find one there.
-Multiplying ESP/RSP by a scale even if the scale is 1 should be an error because ESP/RSP can't be an index.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335398 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 22:28:39 +00:00
Fangrui Song a64c3aa1f5 [llvm-size] Make global variables static
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335397 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 22:20:10 +00:00
Sanjay Patel 3d59bc0342 [x86] add more tests for bit hacking opportunities with setcc; NFC
Missed cases where the input and output are the same size in rL335391.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335396 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 22:07:26 +00:00
Sanjay Patel 31d9a1568a [PowerPC] add more tests for bit hacking opportunities with setcc; NFC
Missed cases where the input and output are the same size in rL335390.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335395 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 22:06:33 +00:00
Craig Topper 7259aa5c9b [X86][AsmParser] In Intel syntax make sure we support ESP/RSP being the second register in memory expressions like [EAX+ESP].
By default, the second register gets assigned to the index register slot. But ESP can't be an index register so we need to swap it with the other register.

There's still a slight bug that we allow [EAX+ESP*1]. The existence of the multiply even though its with 1 should force ESP to the index register and trigger an error, but it doesn't currently.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335394 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 21:57:24 +00:00
Matt Davis 5db13ccfe9 [llvm-mca] Remove unnecessary include and forward decl in RCU. NFC.
The DispatchUnit is no longer a dependency of RCU, so this patch removes a
stale include and forward decl.  This patch also cleans up some comments.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335392 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 21:35:26 +00:00
Sanjay Patel 3a06bb23c2 [x86] add tests for bit hacking opportunities with setcc; NFC
We likely gave up on folding some select-of-constants patterns in 
IR with rL331486, and we need to recover those in the DAG.

The tests without select are based on our current DAGCombiner 
optimizations for select-of-constants.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335391 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 21:16:54 +00:00
Sanjay Patel 5fd79cfd40 [PowerPC] add tests for bit hacking opportunities with setcc; NFC
We likely gave up on folding some select-of-constants patterns in 
IR with rL331486, and we need to recover those in the DAG.

The tests without select are based on our current DAGCombiner 
optimizations for select-of-constants.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335390 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 21:16:29 +00:00
Craig Topper 3d48ff1d0a [X86] Add test cases showing missed select simplifcation for MCU when icmp is in a slightly different form.
These test cases show that the "(select (and (x , 0x1) == 0), y, (z ^ y) ) -> (-(and (x , 0x1)) & z ) ^ y" doesn't work if the select condition is changed to (and (x, 0x1) != 1)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335389 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 21:09:31 +00:00
Aditya Nandakumar d327d4b2a8 [GISel]: Add G_ADDRSPACE_CAST Opcode
Added IRTranslator support for addrspacecast.

https://reviews.llvm.org/D48469

reviewed by: volkan

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335388 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 20:58:51 +00:00
Fangrui Song c22e38d4bb [gdb] Use Latin-1 to decode StringRef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335387 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 20:29:42 +00:00
Tobias Edler von Koch aa1b399a8e Re-land "[LTO] Enable module summary emission by default for regular LTO"
Since we are now producing a summary also for regular LTO builds, we
need to run the NameAnonGlobals pass in those cases as well (the
summary cannot handle anonymous globals).

See https://reviews.llvm.org/D34156 for details on the original change.

This reverts commit 6c9ee4a4a438a8059aacc809b2dd57128fccd6b3.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335385 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 20:23:21 +00:00
Craig Topper 528e0780e7 [X86] Don't accept (%si,%bp) 16-bit address expressions.
The second register is the index register and should only be %si or %di if used with a base register. And in that case the base register should be %bp or %bx.

This makes us compatible with gas.

We do still need to support both orders with Intel syntax which uses [bp+si] and [si+bp]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335384 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 20:20:38 +00:00
Craig Topper 122aad957d [X86][AsmParser] Allow (%bp,%si) and (%bp,%di) to be encoded without using a zero displacement.
(%bp) can't be encoded without a displacement. The encoding is instead used for displacement alone. So a 1 byte displacement of 0 must be used. But if there is an index register we can encode without a displacement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335379 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 19:42:21 +00:00
Konstantin Zhuravlyov d6794f0ba7 AMDHSA: Put old assembler docs back
Until we switch to code object v3 by default.
Follow up for https://reviews.llvm.org/D47736.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335378 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 19:23:18 +00:00
Simon Pilgrim be92ae330e [X86][SSE] Add sdiv by (nonuniform) minus one tests (PR37119)
Test cases from D45806

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335376 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 18:31:57 +00:00
Craig Topper b6b723f1bf [X86][AsmParser] Check for invalid 16-bit base register in Intel syntax.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335373 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 17:50:40 +00:00
Craig Topper 8a152c54c4 [X86] Don't allow ESP/RSP to be used as an index register in assembly.
Fixes PR37892

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335370 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 17:15:58 +00:00
Alina Sbirlea 53f3ded93d [LoopUnswitch]Fix comparison for DomTree updates.
Summary:
In LoopUnswitch when replacing a branch Parent -> Succ with a conditional
branch Parent -> True & Parent->False, the DomTree updates should insert an edge for
each of True/False if True/False are different than Succ, and delete Parent->Succ edge
if both are different. The comparison with Succ appears to be incorect,
it's comparing with Parent instead.
There is no test failing either before or after this change, but it seems to me this is
the right way to do the update.

Reviewers: chandlerc, kuhar

Subscribers: sanjoy, jlebar, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335369 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 17:14:35 +00:00
Andrea Di Biagio 18c02e94e5 [llvm-mca] Remove redundant call. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335368 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 17:03:40 +00:00
Easwaran Raman 2191fc0b67 [X86] Add a test to show missed opportunity to generate vfnmadd
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335367 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 17:01:13 +00:00
Krzysztof Parzyszek d407e550d9 Initialize LiveRegs once in BranchFolder::mergeCommonTails
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335365 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 16:38:38 +00:00
Simon Pilgrim 5a40cf8639 [SLPVectorizer] Support alternate opcodes in tryToVectorizeList
Enable tryToVectorizeList to support InstructionsState alternate opcode patterns at a root (build vector etc.) as well as further down the vectorization tree.

NOTE: This patch reduces some of the debug reporting if there are opcode mismatches - I can try to add it back if it proves a problem. But it could get rather messy trying to provide equivalent verbose debug strings via getSameOpcode etc.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335364 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 16:37:34 +00:00
Andrea Di Biagio e0f992ea7d [llvm-mca] Set the operand ID for implicit register reads/writes. NFC
Also, move the definition of InstRef at the end of Instruction.h to avoid a
forward declaration.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335363 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 16:37:05 +00:00
Matt Davis 6299c235bd [llvm-mca] Introduce a sequential container of Stages
Summary:
Remove explicit stages and introduce a list of stages.

A pipeline should be composed of an arbitrary list of stages, and not any
 predefined list of stages in the Backend.  The Backend should not know of any
 particular stage, rather it should only be concerned that it has a list of
 stages, and that those stages will fulfill the contract of what it means to be
 a Stage (namely pre/post/execute a given instruction).

For now, we leave the original set of stages defined in the Backend ctor;
however, I imagine these will be moved out at a later time.

This patch makes an adjustment to the semantics of Stage::isReady.
Specifically, what the Backend really needs to know is if a Stage has
unfinished work.  With that said, it is more appropriately renamed
Stage::hasWorkToComplete().  This change will clean up the check in
Backend::run(), allowing us to query each stage to see if there is unfinished
work, regardless of what subclass a stage might be.  I feel that this change
simplifies the semantics too, but that's a subjective statement.

Given how RetireStage and ExecuteStage handle data in their preExecute(), I've
had to change the order of Retire and Execute in our stage list.  Retire must
complete any of its preExecute actions before ExecuteStage's preExecute can
take control.  This is mainly because both stages utilize the RCU.  In the
meantime, I want to see if I can adjust that or remove that coupling.

Reviewers: andreadb, RKSimon, courbet

Reviewed By: andreadb

Subscribers: tschuett, gbedwell, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335361 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 16:17:26 +00:00
Simon Pilgrim 6c358ea817 [SLPVectorizer] reorderAltShuffleOperands should just take InstructionsState. NFCI.
All calls were extracting the InstructionsState Opcode/AltOpcode values so we might as well pass it directly

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335359 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 16:10:26 +00:00
Paul Robinson 2b353500d1 Fix test again, try to keep all targets happy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335356 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 15:19:45 +00:00
Paul Robinson ee3b840397 Fix test, nop is not always 1 byte
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335353 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 15:07:26 +00:00
Paul Robinson fe16001dba [DWARFv5] Allow ".loc 0" to refer to the root file.
DWARF v5 explicitly represents file #0 in the line table.  Prior
versions did not, so ".loc 0" is still an error in those cases.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335350 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 14:16:11 +00:00
Simon Pilgrim ae9a1a8ee7 [SLPVectorizer] Relax alternate opcodes to accept any BinaryOperator pair
SLP currently only accepts (F)Add/(F)Sub alternate counterpart ops to be merged into an alternate shuffle.

This patch relaxes this to accept any pair of BinaryOperator opcodes instead, assuming the target's cost model accepts the vectorization+shuffle.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335349 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 14:04:06 +00:00
Simon Pilgrim 1c5cdb19a6 [SLPVectorizer][X86] Add alternate opcode tests for simple build vector cases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335348 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 13:53:58 +00:00
Sanjay Patel bcfb546743 [InstCombine] add shuffle+binops test from PR37806; NFC
This one shows another pattern that we'll need to match
in some cases, but the current ordering of folds allows
us to match this as 2 binops before simplification takes
place.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335347 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 13:44:42 +00:00
Sanjay Patel a054f92cdc [InstCombine] add tests for shuffle-with-different-binops; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335345 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 13:19:25 +00:00
Sanjay Patel bbfb91da0d [InstCombine] rearrange shuffle-of-binops logic; NFC
The commutative matcher makes things more complicated
here, and I'm planning an enhancement where this 
form is more readable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335343 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 12:46:16 +00:00
Simon Pilgrim dce4487f88 [X86] Regenerate tests to include fma comments
Noticed in the review of D48467

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335342 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-22 12:41:48 +00:00