Commit Graph

119775 Commits

Author SHA1 Message Date
David Blaikie
2f6af0e277 Add some utilities to iterator_range for trimming a range and constructing one from a container.
To be used in clang in a follow-up commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242823 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 18:37:12 +00:00
Rafael Espindola
d8a62d931e Remove getDynamicSymbolName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242821 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 18:20:17 +00:00
Rafael Espindola
9ed0d629ce Remove getStaticSymbolName.
Every user now keeps track of the correct string table to use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242818 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 18:04:29 +00:00
Chad Rosier
d0a4c8888f Follow up to r242810. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242812 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 17:47:56 +00:00
Chad Rosier
6d235f7be0 [AArch64] Simplify the passing of arguments. NFC.
This is setup for future work planned for the AArch64 Load/Store Opt pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242810 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 17:42:04 +00:00
Reid Kleckner
90a1b93e9f Re-land 242726 to use RAII to do cleanup
The LooksLikeCodeInBug11395() codepath was returning without clearing
the ProcessedAllocas cache.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242809 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 17:40:14 +00:00
Philip Reames
d0db907e73 [RewriteStatepointsForGC] Hoist some code out of a loop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242808 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 17:18:03 +00:00
Arnold Schwaighofer
a5aae48d17 MergeFunc: Transfer the callee's attributes when replacing a direct caller
We insert a bitcast which obfuscates the getCalledFunction for the utility
function which looks up attributes from the called function. Loosing ABI
changing parameter attributes is a bad thing.

rdar://21516488

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242807 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 17:07:07 +00:00
Alex Lorenz
65671bf628 MIR Serialization: Serialize the external symbol machine operands.
Reviewers: Duncan P. N. Exon Smith


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242806 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 16:59:53 +00:00
Philip Reames
5769e19790 [RewriteStatepointsForGC] Delete trivial code
A bit more code cleanup: delete some a trivial true assertion and supporting code, remove a redundant cast, and use count in assertions where feasible.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242805 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 16:51:17 +00:00
Rafael Espindola
746609067c Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242804 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 16:50:57 +00:00
Alex Lorenz
476706ed94 IR: Extract a function 'printLLVMNameWithoutPrefix' from 'PrintLLVMName'. NFC.
This commit extracts the code that prints out a name of an LLVM value without a
prefix from a function 'PrintLLVMName' into a publicly accessible function named
'printLLVMNameWithoutPrefix'.

This change would be useful for MIR serialization, as it would allow the MIR
printer to reuse this function to print out the names of the external symbol
machine operands.

Reviewers: Duncan P. N. Exon Smith


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242803 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 16:50:35 +00:00
Rafael Espindola
a33feabe7a Remove always false parameter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242802 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 16:42:01 +00:00
Rafael Espindola
51ac821430 Use range loop. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242801 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 16:40:14 +00:00
Rafael Espindola
7eeb71ddc3 Replace the last uses of ELF::getSymbolName in llvm-readobj.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242798 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 16:26:21 +00:00
Sanjay Patel
cc3246a567 fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242796 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 16:09:58 +00:00
Rafael Espindola
9ea117379c Use helper function. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242795 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 16:05:53 +00:00
Rafael Espindola
fcadda639e llvm-readobj: use the associated string table to print symbols. NFI.
This just removes some cases that require ELFFile to eagerly parse the ELF
file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242794 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 16:02:10 +00:00
Chris Bieneman
791500fa0d [CMake] Projects supported via LLVM_EXTERNAL_*_SOURCE_DIR need to be explicitly specified.
One part of my refactoring from r242705 is untenable due to how CMake caches variables. There is no way other than caching to allow variables to be set in one directory and globally readable, but we really don't want to cache the temporary value marking that a directory has already been included.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242793 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 15:53:09 +00:00
Nico Weber
4a3c9fcd83 Revert 242726, it broke ASan on OS X.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242792 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 15:48:53 +00:00
Rafael Espindola
ab466de617 Remove unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242789 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 14:45:56 +00:00
Rafael Espindola
71e35258cb Simplify printing the soname. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242786 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 13:48:41 +00:00
Rafael Espindola
ed3c543ddb Add missing c++ marker to .h file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242784 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 13:42:38 +00:00
Karthik Bhat
c721349466 Constfold trunc,rint,nearbyint,ceil and floor using APFloat
A patch by Chakshu Grover!
This patch allows constfolding of trunc,rint,nearbyint,ceil and floor intrinsics using APFloat class.
Differential Revision: http://reviews.llvm.org/D11144


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242763 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 08:52:23 +00:00
Igor Breger
7d40c4215d AVX512 : Implemented VPMADDUBSW and VPMADDWD instruction ,
Added tests for intrinsics and encoding.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242761 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 07:11:28 +00:00
Eric Fiselier
40e186ac0e [LIT] Fix discovery.py test once again
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242758 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 04:25:13 +00:00
Akira Hatanaka
27ac0fae47 [ARM] Define subtarget feature "reserve-r9", which is used to decide
whether register r9 should be reserved.

This recommits r242737, which broke bots because the number of subtarget
features went over the limit of 64.

This change is needed because we cannot use a backend option to set
cl::opt "arm-reserve-r9" when doing LTO.

Out-of-tree projects currently using cl::opt option "-arm-reserve-r9" to
reserve r9 should make changes to add subtarget feature "reserve-r9" to
the IR.

rdar://problem/21529937

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242756 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 01:42:02 +00:00
Akira Hatanaka
16cb7fc21c Bump the size of FeatureBitset up to 96-bits.
This should avoid exceeding the maximum size when I add another subtarget
feature to ARM's subtarget.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242754 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 01:39:22 +00:00
Rafael Espindola
04d208815c Don't do a walk over the dynamic table just to find DT_SONAME.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242752 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 01:01:29 +00:00
Philip Reames
052b66199d [RewriteStatepointsForGC] Minor code cleanup [NFC]
We can use builders to simplify part of the code and we only check for the existance of the metadata value; this enables us to delete some redundant code.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242751 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 00:49:55 +00:00
Andrew Wilkins
a571970098 [cmake] pass GO_EXECUTABLE to llgo-go
Summary:
When calling llgo-go from the llvm_add_go_executable
cmake function, specify $GO_EXECUTABLE as the go
command to call. Without this, llgo-go searches $PATH
which may be inconsistent with $GO_EXECUTABLE.

Reviewers: pcc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242749 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 00:46:23 +00:00
Chris Bieneman
5bce8dfa26 [CMake] Fixing inconsistency caused by copy-pasta.
This will actually fix the PR 24194.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242748 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 00:44:47 +00:00
Matt Arsenault
1cd0962919 AMDGPU: Set isMoveImm on s_movk_i32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242747 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 00:40:08 +00:00
Chris Bieneman
2794e0c7cb [CMake] Fixing a problem with external projects that aren't getting enabled properly.
This should address PR 24194, and some builedbot failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242746 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 00:39:53 +00:00
Matthias Braun
573a81b6bf ARMLoadStoreOpt: Merge subs/adds into LDRD/STRD; Factor out common code
Re-apply of r241928 which had to be reverted because of the r241926
revert.

This commit factors out common code from MergeBaseUpdateLoadStore() and
MergeBaseUpdateLSMultiple() and introduces a new function
MergeBaseUpdateLSDouble() which merges adds/subs preceding/following a
strd/ldrd instruction into an strd/ldrd instruction with writeback where
possible.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242743 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 00:19:01 +00:00
Matthias Braun
361054b1fa ARMLoadStoreOptimizer: Create LDRD/STRD on thumb2
Re-apply r241926 with an additional check that r13 and r15 are not used
for LDRD/STRD. See http://llvm.org/PR24190. This also already includes
the fix from r241951.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242742 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 00:18:59 +00:00
Akira Hatanaka
4f50f9eba4 Revert r242737.
This caused builds to fail with the following error message:

error:Too many subtarget features! Bump MAX_SUBTARGET_FEATURES.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242740 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 23:51:12 +00:00
Akira Hatanaka
a22e4b71f4 [ARM] Define subtarget feature "reserve-r9", which is used to decide
whether register r9 should be reserved.

This change is needed because we cannot use a backend option to set
cl::opt "arm-reserve-r9" when doing LTO.

Out-of-tree projects currently using cl::opt option "-arm-reserve-r9" to
reserve r9 should make changes to add subtarget feature "reserve-r9" to
the IR.

rdar://problem/21529937

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242737 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 23:21:30 +00:00
Matthias Braun
f87866e744 Revert "ARMLoadStoreOptimizer: Create LDRD/STRD on thumb2"
This reverts commit r241926. This caused http://llvm.org/PR24190

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242735 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 23:17:20 +00:00
Matthias Braun
8f41ef5e94 Revert "ARMLoadStoreOpt: Merge subs/adds into LDRD/STRD; Factor out common code"
This reverts commit r241928. This caused http://llvm.org/PR24190

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242734 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 23:17:16 +00:00
Matthias Braun
2271d686de Revert "ARM: Use SpecificBumpPtrAllocator to fix leak introduced in r241920"
This reverts commit r241951. It caused http://llvm.org/PR24190

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242733 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 23:17:14 +00:00
Matthias Braun
f4f0f405c8 AArch64: Restrict macroop fusion heuristics to cyclone.
Even though this is just some hinting for the scheduler it doesn't make
sense to do that unless you know the target can perform the fusion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242732 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 23:11:42 +00:00
JF Bastien
9994b911f4 Targets: commonize some stack realignment code
This patch does the following:
* Fix FIXME on `needsStackRealignment`: it is now shared between multiple targets, implemented in `TargetRegisterInfo`, and isn't `virtual` anymore. This will break out-of-tree targets, silently if they used `virtual` and with a build error if they used `override`.
* Factor out `canRealignStack` as a `virtual` function on `TargetRegisterInfo`, by default only looks for the `no-realign-stack` function attribute.

Multiple targets duplicated the same `needsStackRealignment` code:
 - Aarch64.
 - ARM.
 - Mips almost: had extra `DEBUG` diagnostic, which the default implementation now has.
 - PowerPC.
 - WebAssembly.
 - x86 almost: has an extra `-force-align-stack` option, which the default implementation now has.

The default implementation of `needsStackRealignment` used to just return `false`. My current patch changes the behavior by simply using the above shared behavior. This affects:
 - AMDGPU
 - BPF
 - CppBackend
 - MSP430
 - NVPTX
 - Sparc
 - SystemZ
 - XCore
 - Out-of-tree targets
This is a breaking change! `make check` passes.

The only implementation of the `virtual` function (besides the slight different in x86) was Hexagon (which did `MF.getFrameInfo()->getMaxAlignment() > 8`), and potentially some out-of-tree targets. Hexagon now uses the default implementation.

`needsStackRealignment` was being overwritten in `<Target>GenRegisterInfo.inc`, to return `false` as the default also did. That was odd and is now gone.

Reviewers: sunfish

Subscribers: aemerson, llvm-commits, jfb

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242727 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 22:51:32 +00:00
Reid Kleckner
dfc9688bd9 Don't try to instrument allocas used by outlined SEH funclets
Summary:
Arguments to llvm.localescape must be static allocas. They must be at
some statically known offset from the frame or stack pointer so that
other functions can access them with localrecover.

If we ever want to instrument these, we can use more indirection to
recover the addresses of these local variables. We can do it during
clang irgen or with the asan module pass.

Reviewers: eugenis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242726 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 22:49:44 +00:00
Rafael Espindola
bb418bc23b Remove duplicated code.
Both ELFObjectFile and ELFFile had an implementation of getLoadName.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242725 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 22:41:44 +00:00
Matthias Braun
d0d70e479a AArch64: Add aditional Cyclone macroop fusion opportunities
Related to rdar://19205407

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242724 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 22:34:47 +00:00
Matthias Braun
679d26ce56 MachineScheduler: Restrict macroop fusion to data-dependent instructions.
Before creating a schedule edge to encourage MacroOpFusion check that:
- The predecessor actually writes a register that the branch reads.
- The predecessor has no successors in the ScheduleDAG so we can
  schedule it in front of the branch.

This avoids skewing the scheduling heuristic in cases where macroop
fusion cannot happen.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242723 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 22:34:44 +00:00
Dimitry Andric
85e9772512 Avoid early pipefail exits due to grep failures in stage comparisons.
If objects or executables did not contain any RPATH, grep would return
nonzero, and the whole stage comparison loop would unexpectedly exit.
Fix this by checking the grep result explicitly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242722 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 22:24:40 +00:00
Dimitry Andric
186b3e7e9e Since BSD cmp(1) does not support the --ignore-initial option, use the
more portable 3rd and 4th arguments to skip the first 16 bytes during
the comparison of Phase2 and Phase3 objects.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242721 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 22:07:27 +00:00
Krzysztof Parzyszek
aebc086781 Add 'const' to a few more functions in MachineFrameInfo
Reviewer: Eric Christopher
http://reviews.llvm.org/D11372


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242720 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 22:05:38 +00:00