Commit Graph

129807 Commits

Author SHA1 Message Date
Matthias Braun
1685c6f7ca LivePhysRegs: Remove redundant check
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265509 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-06 02:46:04 +00:00
Duncan P. N. Exon Smith
15709846d4 ValueMapper: Fix delayed blockaddress handling after r265273
r265273 added Mapper::mapBlockAddress, which delays mapping a
blockaddress value until the function has a body.  The condition was
backwards, and should be checking Function::empty instead of
GlobalValue::isDeclaration.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265508 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-06 02:25:12 +00:00
Duncan P. N. Exon Smith
13d5c58951 AsmParser: Don't crash on unresolved !tbaa
Instead of crashing, give a nice error.  As a drive-by, fix the location
associated with the errors for unresolved metadata (the location was off
by one token).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265507 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-06 02:06:40 +00:00
Chuang-Yu Cheng
4f461cab38 [ppc64] Enable sibling call optimization on ppc64 ELFv1/ELFv2 abi
This patch enable sibling call optimization on ppc64 ELFv1/ELFv2 abi, and
add a couple of test cases. This patch also passed llvm/clang bootstrap
test, and spec2006 build/run/result validation.

Original issue: https://llvm.org/bugs/show_bug.cgi?id=25617

Great thanks to Tom's (tjablin) help, he contributed a lot to this patch.
Thanks Hal and Kit's invaluable opinions!

Reviewers: hfinkel kbarton

http://reviews.llvm.org/D16315

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265506 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-06 02:04:38 +00:00
Chuang-Yu Cheng
ff2190e04a [Power9] Implement add-pc, multiply-add, modulo, extend-sign-shift, random number, set bool, and dfp test significance
This patch implement the following instructions:
- addpcis subpcis
- maddhd maddhdu maddld
- modsw moduw modsd modud
- darn
- extswsli extswsli.
- setb
- dtstsfi dtstsfiq

Total 15 instructions

Reviewers: nemanjai hfinkel tjablin amehsan kbarton

http://reviews.llvm.org/D17885

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265505 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-06 01:47:02 +00:00
Chuang-Yu Cheng
c77546e444 [Power9] Implement copy-paste, msgsync, slb, and stop instructions
This patch implements the following BookII and Book III instructions:
- copy copy_first cp_abort paste paste. paste_last
- msgsync
- slbieg slbsync
- stop

Total 10 instructions

Reviewers: nemanjai hfinkel tjablin amehsan kbarton

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265504 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-06 01:46:45 +00:00
Sanjoy Das
376f5bad7b [RS4GC] Add a comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265503 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-06 01:33:54 +00:00
Sanjoy Das
6dd7334ee8 Lower @llvm.experimental.deoptimize as a noreturn call
While preserving the return value for @llvm.experimental.deoptimize at
the IR level is useful during mid-level optimization, doing so at the
machine instruction level requires generating some extra code and a
return that is non-ideal.  This change has LLVM lower

```
  %val = call @llvm.experimental.deoptimize
  ret %val
```

to effectively

```
  call @__llvm_deoptimize()
  unreachable
```

instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265502 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-06 01:33:49 +00:00
Tom Stellard
43f537f492 AMDGPU: Document address space mapping
Summary:
Address space mapping is described in lib/Target/AMDGPU/AMDGPU.h in
Doxygen comments. This patch adds the description to user guide for
AMDGPU back-end.

Patch By: Vedran Miletić

Reviewers: tstellarAMD, arsenm

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265500 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-06 01:29:19 +00:00
NAKAMURA Takumi
43e8875502 AArch64CodeGen: Make AArch64RegisterBankInfo.cpp optional along LLVM_BUILD_GLOBAL_ISEL.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265499 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-06 01:18:08 +00:00
David Majnemer
731666ee90 [SLPVectorizer] Vectorize libcalls of sqrt
We didn't realize that we could transform the libcall into a vectorized
intrinsic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265493 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-06 00:14:59 +00:00
Quentin Colombet
c37faf21d0 [RegisterBankInfo] Include RegisterBank.h.
We actually need the definition of a RegisterBank to be able to inline
the implementation of the subscript operator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265492 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 23:57:25 +00:00
Quentin Colombet
717601810e [RegisterBankInfo] Add missing include for assert.
This should appease the linux bot.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265491 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 23:43:58 +00:00
Davide Italiano
fe735e5923 [DebugInfo] Fix tests so that each subprogram belongs to a CU.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265490 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 23:37:08 +00:00
Quentin Colombet
9c7eb243ef [AArch64] Initial implementation of the targeting of the register bank information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265489 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 23:34:59 +00:00
Quentin Colombet
6443af0d08 [RegisterBankInfo] Simplify the API for build a register bank.
As part of the TRI argument of addRegBankCoverage we already have access to
the TargetRegisterClass through the ID of that register class.
Therefore, there is no point in needing a TargetRegisterClass instance,
the ID is enough to get to it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265487 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 23:26:39 +00:00
Sanjoy Das
8e366b3614 [RS4GC] NFC cleanup of the DeferredReplacement class
Instead of constructors use clearly named factory methods.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265486 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 23:18:53 +00:00
Sanjoy Das
0ed4be724f [RS4GC] Better codegen for deoptimize calls
Don't emit a gc.result for a statepoint lowered from
@llvm.experimental.deoptimize since the call into __llvm_deoptimize is
effectively noreturn.  Instead follow the corresponding gc.statepoint
with an "unreachable".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265485 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 23:18:35 +00:00
Quentin Colombet
5a3e3ec846 [Target] Remove a deprecated comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265484 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 23:04:54 +00:00
Quentin Colombet
ca7369ade3 [Target] Add an accessor to the register bank information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265483 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 22:50:40 +00:00
Manman Ren
cf18232c49 Swift Calling Convention: swiftcc for ARM.
Differential Revision: http://reviews.llvm.org/D18769


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265482 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 22:44:44 +00:00
Evgeniy Stepanov
9c4431f3cb Faster stack-protector for Android/AArch64.
Bionic has a defined thread-local location for the stack protector
cookie. Emit a direct load instead of going through __stack_chk_guard.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265481 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 22:41:50 +00:00
Manman Ren
1f7638e1cb Swift Calling Convention: add swiftcc.
Differential Revision: http://reviews.llvm.org/D17863


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265480 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 22:41:47 +00:00
Quentin Colombet
2b1f04632c [RegisterBank] Implement the verify method to check for the obvious mistakes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265479 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 22:34:01 +00:00
Quentin Colombet
1f2bf92c75 [RegisterBankInfo] Add debug print to check how the initialization is going.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265475 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 21:47:56 +00:00
George Burgess IV
a8ddf55110 [CFLAA] Fix PR27213; incorrect tagging of args/globals
Prior to this patch, CFLAA wouldn't tag arguments/globals properly if
it didn't find any "interesting" edges on them. This means that, if all
you do is store constants to a global or argument, we would never
actually treat it as a global/argument.

Test case:

define void @foo(i32* %A, i32* %B) #0 {
entry:
  store i32 0, i32* %A, align 4
  store i32 0, i32* %B, align 4
  ret void
}

CFLAA would say that %A can't alias %B, because neither pointer was
used in an interesting way. This patch makes us note whether something
is an argument, global, ... regardless of how interesting CFLAA thinks
its uses are.

(For the record, using a value in an interesting way means loading
from it, using it in a GEP, ...)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265474 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 21:40:45 +00:00
Quentin Colombet
6077d14b60 [RegisterBank] Add printable capabilities for future debugging.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265473 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 21:40:43 +00:00
Duncan P. N. Exon Smith
ea1a7b0666 Try harder to appease MSVC after r265456
r265465 wasn't good enough.  I need to spell out all the moves.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265470 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 21:25:33 +00:00
Quentin Colombet
ccd741b08a [RegisterBankInfo] Make addRegBankCoverage more capable to ease
targeting jobs.
Now, addRegBankCoverage also adds the subreg-classes not just the
sub-classes of the given register class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265469 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 21:20:12 +00:00
Junmo Park
748423059f Minor code cleanups. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265468 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 21:14:31 +00:00
Duncan P. N. Exon Smith
d7773c0d39 IR: Introduce ConstantAggregate, NFC
Add a common parent class for ConstantArray, ConstantVector, and
ConstantStruct called ConstantAggregate.  These are the aggregate
subclasses of Constant that take operands.

This is mainly a cleanup, adding common `isa` target and removing
duplicated code.  However, it also simplifies caching which constants
point transitively at `GlobalValue` (a possible future direction).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265466 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 21:10:45 +00:00
Duncan P. N. Exon Smith
3444a406d3 Try to appease MSVC after r265456
I can't remember if adding `= default` will make MSVC happy, or if I
have to spell this out.  Let's try the cleaner version first.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265465 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 21:07:01 +00:00
Quentin Colombet
062bf7c9dd [RegisterBankInfo] Implement the methods to create register banks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265464 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 21:06:15 +00:00
Duncan P. N. Exon Smith
ef94029809 IR: Add missing assertion for ConstantVector::ConstantVector
Use the same assertion as ConstantArray.  Vectors should have the right
number of elements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265463 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 20:53:47 +00:00
Quentin Colombet
aa40fb64ae [RegisterBank] Provide a way to check if a register bank is valid.
Change the default constructor to create invalid object.
The target will have to properly initialize the register banks before
using them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265460 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 20:48:32 +00:00
Duncan P. N. Exon Smith
2707ee3256 Revert "Fix Clang-tidy modernize-deprecated-headers warnings in remaining files; other minor fixes."
This reverts commit r265454 since it broke the build.  E.g.:

  http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/22413/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265459 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 20:45:04 +00:00
Duncan P. N. Exon Smith
f45d3278d3 Make constructors for final subclasses of Constant private, NFC
These were `protected` before, but might as well be `private`.  Also
marked the classes themselves `final`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265458 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 20:31:23 +00:00
David Blaikie
46c3acf600 llvm-dwp: Handle GCC's use of multiple debug_types.dwo sections in a single .dwo file
(also includes the .test file missing from my previous commit, r265452)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265457 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 20:26:50 +00:00
Duncan P. N. Exon Smith
15121b5f36 ValueMapper: Rewrite Mapper::mapMetadata without recursion
This commit completely rewrites Mapper::mapMetadata (the implementation
of llvm::MapMetadata) using an iterative algorithm.  The guts of the new
algorithm are in MDNodeMapper::map, the entry function in a new class.

Previously, Mapper::mapMetadata performed a recursive exploration of the
graph with eager "just in case there's a reason" malloc traffic.

The new algorithm has these benefits:

  - New nodes and temporaries are not created eagerly.
  - Uniquing cycles are not duplicated (see new unit test).
  - No recursion.

Given a node to map, it does this:

 1. Use a worklist to perform a post-order traversal of the transitively
    referenced unmapped nodes.

 2. Track which nodes will change operands, and which will have new
    addresses in the mapped scheme.  Propagate the changes through the
    POT until fixed point, to pick up uniquing cycles that need to
    change.

 3. Map all the distinct nodes without touching their operands.  If
    RF_MoveDistinctMetadata, they get mapped to themselves; otherwise,
    they get mapped to clones.

 4. Map the uniqued nodes (bottom-up), lazily creating temporaries for
    forward references as needed.

 5. Remap the operands of the distinct nodes.

Mehdi helped me out by profiling this with -flto=thin.  On his workload
(importing/etc. for opt.cpp), MapMetadata sped up by 15%, contributed
about 50% less to persistent memory, and made about 100x fewer calls to
malloc.  The speedup is less than I'd hoped.  The profile mainly blames
DenseMap lookups; perhaps there's a way to reduce them (e.g., by
disallowing remapping of MDString).

It would be nice to break the strange remaining recursion on the Value
side: MapValue => materializeInitFor => RemapInstruction => MapValue.  I
think we could do this by having materializeInitFor return a worklist of
things to be remapped.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265456 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 20:23:21 +00:00
Quentin Colombet
cdf87d0168 [TargetRegisterClass] Improve the comment for how to use getSubClassMask.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265455 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 20:21:53 +00:00
Eugene Zelenko
9a7a3bcf29 Fix Clang-tidy modernize-deprecated-headers warnings in remaining files; other minor fixes.
Some Include What You Use suggestions were used too.

Use anonymous namespaces in source files.

Differential revision: http://reviews.llvm.org/D18778


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265454 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 20:19:49 +00:00
David Blaikie
fe34a372e1 llvm-dwp: Handle dwo files produced by GCC
To start with, handle DW_FORM_string names. Follow up commit will handle
the interesting quirk with type units I was originally aiming for here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265452 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 20:16:38 +00:00
Lang Hames
cb6a5650f3 [llvm-rtdyld] Fix the return type on ErrorAndExit.
As suggested by Rafael - this function no longer returns a value as of r264425.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265451 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 20:11:24 +00:00
Ahmed Bougacha
db4b54ff8f [X86] Reuse EFLAGS and form LOCKed ops when only user is SETCC.
We only generate LOCKed versions of add/sub when the result is unused.
It often happens that the result is used, but only by a comparison. We
can optimize those out by reusing EFLAGS, which lets us use the proper
instructions, instead of having to fallback to LXADD.

Instead of doing this as an MI peephole (as we do for the other
non-LOCKed (really, non-MR) forms), do it in ISel. It becomes quite
tricky later.

This also makes it eventually possible to stop expanding and/or/xor
if the only user is an icmp (also see D18141).

This uses the LOCK ISD opcodes added by r262244.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265450 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 20:02:57 +00:00
Quentin Colombet
baea9b2a9a [GlobalISel] Add the RegisterBankInfo class for the handling of register banks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265449 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 20:02:47 +00:00
Ahmed Bougacha
a4e82226ec [X86] Add tests for ATOMIC_LOAD_OP EFLAGS reuse. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265448 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 20:02:44 +00:00
Ahmed Bougacha
90af9e7014 [X86] Simplify early-exit check. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265447 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 20:02:22 +00:00
Lang Hames
c224d81083 [Support] Add a checked flag to Expected<T>, require checks before access or
destruction.

This makes the Expected<T> class behave like Error, even when in success mode.
Expected<T> values must be checked to see whether they contain an error prior
to being dereferenced, assigned to, or destructed.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265446 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 19:57:03 +00:00
Quentin Colombet
9b710764b9 [GlobalISel] Add a class, RegisterBank, to represent register banks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265445 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 19:54:44 +00:00
Sanjay Patel
3a27360c9d fixed to discard earlier advertising
Also, hardcode (there must be a better way...) the 'utils' dir in the 
advertisement, so it's easier to find.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265444 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 19:50:21 +00:00