139163 Commits

Author SHA1 Message Date
Simon Dardis
20d3d702f5 Revert "[mips] Add rsqrt, recip for MIPS"
This reverts commit r282485 which contain two patches instead of
one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283327 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 15:28:33 +00:00
Douglas Katzman
8bebbdc0d0 [X86] Don't randomly encode %rip where illegal
Differential Revision: https://reviews.llvm.org/D25112

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283326 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 15:23:35 +00:00
James Molloy
71beb002a1 [Thumb] Don't try and emit LDRH/LDRB from the constant pool
This is not a valid encoding - these instructions cannot do PC-relative addressing.

The underlying problem here is of whitelist in ARMISelDAGToDAG that unwraps ARMISD::Wrappers during addressing-mode selection. This didn't realise TargetConstantPool was actually possible, so didn't handle it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283323 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 14:52:13 +00:00
Douglas Katzman
471e2909de [X86] Fix some tests that didn't assert anything
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283322 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 14:46:14 +00:00
Oren Ben Simhon
83acfbfcaf Test commit permission
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283319 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 14:12:41 +00:00
Oren Ben Simhon
464fb841a0 Test commit permission
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283318 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 13:48:33 +00:00
Dylan McKay
3beccae0ab [AVR] Don't select 'MOVW' instructions when they are not supported
We have a subtarget feature which we were ignoring, which was causing us
to generate unsupported instructions for some older chips.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283317 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 13:38:29 +00:00
Dylan McKay
3d6fe50568 [AVR] Add AVRRegisterInfo::splitReg function
No tests are included just yet - this is used from the pseudo
instruction expander pass, which hasn't been pulled in-tree yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283316 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 13:27:30 +00:00
Krzysztof Parzyszek
c29dc70bea Fix machine operand traversal in ScheduleDAGInstrs::fixupKills
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283315 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 13:15:06 +00:00
Dylan McKay
27025b7f3c [AVR] Update return type of dynamic alloca pass
It was recently changed from 'const char*' to StringRef

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283312 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 12:32:24 +00:00
Dylan McKay
3aff1d4e47 [AVR] Add the AVR frame lowering code
Summary: This allows AVR to lower frames into assembly code.

Reviewers: arsenm, kparzysz

Subscribers: japaric, wdng, beanz, mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283311 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 11:48:56 +00:00
Dylan McKay
83aed6980d [AVR] Split all of the AVR device definitions into a separate file
We have ~500 lines of subtarget feature definitions, they don't belong
in our main TableGen file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283310 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 10:28:45 +00:00
Dylan McKay
fac3438f5e [AVR] Enable the instruction printer in the target definition
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283309 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 10:23:38 +00:00
Dylan McKay
59cb8c3411 [AVR] Add definitions for the ATTiny102 and ATtiny104 chips
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283308 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 10:20:33 +00:00
Mehdi Amini
f9bb6bcf37 Re-commit "Use StringRef in Support/Darf APIs (NFC)"
This reverts commit r283285 and re-commit r283275 with
a fix for format("%s", Str); where Str is a StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283298 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 05:59:29 +00:00
Dylan McKay
bad1f71e1f [AVR] Add the machine code backend
Summary:
This adds the AVR machine code backend (`AVRAsmBackend.cpp`). This will
allow us to generate machine code from assembled AVR instructions.

Reviewers: arsenm, kparzysz

Subscribers: modocache, japaric, wdng, beanz, mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283297 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 05:30:19 +00:00
Dean Michael Berris
f6b865d41a [Support][CommandLine] Add cl::getRegisteredSubcommands()
This should allow users of the library to get a range to iterate through
all the subcommands that are registered to the global parser. This
allows users to define subcommands in libraries that self-register to
have dispatch done at a different stage (like main). It allows for
writing code like the following:

    for (auto *S : cl::getRegisteredSubcommands()) {
      if (*S) {
	// Dispatch on S->getName().
      }
    }

This change also contains tests that show this usage pattern.

Reviewers: zturner, dblaikie, echristo

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283296 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 05:20:08 +00:00
Mehdi Amini
6f45c30387 Blind attempt to fix windows build after r283290 - Use StringRef in StringSaver API (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283294 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 01:41:11 +00:00
Mehdi Amini
33a6ab06c9 Use StringRef in ARMConstantPool APIs (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283293 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 01:41:06 +00:00
Kyle Butt
d03fefcc5e Revert "Codegen: Tail-duplicate during placement."
This reverts commit 062ace9764953e9769142c1099281a345f9b6bdc.

Issue with loop info and block removal revealed by polly.
I have a fix for this issue already in another patch, I'll re-roll this
together with that fix, and a test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283292 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 01:39:29 +00:00
Mehdi Amini
bc4286d9e7 Use StringRef in FastISel API (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283291 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 01:37:29 +00:00
Mehdi Amini
1455db37f5 Use StringRef in StringSaver API (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283290 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 01:32:41 +00:00
Mehdi Amini
ba066c0ba6 Use StringRef in ARCRuntimeEntryPoints APIs (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283288 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 01:15:04 +00:00
Kostya Serebryany
d4d50f6f47 [libFuzzer] add ShrinkValueProfileTest, move code around, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283286 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 01:09:40 +00:00
Mehdi Amini
ef350f2eb3 Revert "Re-commit "Use StringRef in Support/Darf APIs (NFC)""
One test seems randomly broken: DebugInfo/X86/gnu-public-names.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283285 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 01:04:02 +00:00
Mehdi Amini
3eff5cdfd3 Use StringRef in MCSectionMachO (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283284 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 01:02:34 +00:00
Mehdi Amini
280c2a6355 Use StringRef in DarwinAsmParser (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283283 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 01:02:22 +00:00
Michael Zolotukhin
c95d4ff692 [LoopDistribute] Fix a typo in the pass name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283282 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 00:44:52 +00:00
Mehdi Amini
a2df9c87e9 Re-commit "Use StringRef in Support/Darf APIs (NFC)"
This reverts commit r283278 and re-commit r283275 with
the update to fix the build on the LLDB side.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283281 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 00:37:18 +00:00
Kostya Serebryany
d277734b71 [libFuzzer] clear the corpus elements if they are evicted (i.e. smaller elements with proper coverage are found). Make sure we never try to mutate empty element. Print the corpus size in bytes in the status lines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283279 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 00:25:17 +00:00
Mehdi Amini
c441cc0af2 Revert "Use StringRef in Support/Darf APIs (NFC)"
This reverts commit r283275, it broke LLDB Android debug server.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283278 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 00:21:14 +00:00
Mehdi Amini
e57a377e09 Use StringRef instead of raw pointers in ARMBuildAttrs (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283277 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 00:15:18 +00:00
Mehdi Amini
ba4c13cb88 Use StringRef in Support/Darf APIs (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283275 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 23:55:40 +00:00
Kyle Butt
062ace9764 Codegen: Tail-duplicate during placement.
The tail duplication pass uses an assumed layout when making duplication
decisions. This is fine, but passes up duplication opportunities that
may arise when blocks are outlined. Because we want the updated CFG to
affect subsequent placement decisions, this change must occur during
placement.

In order to achieve this goal, TailDuplicationPass is split into a
utility class, TailDuplicator, and the pass itself. The pass delegates
nearly everything to the TailDuplicator object, except for looping over
the blocks in a function. This allows the same code to be used for tail
duplication in both places.

This change, in concert with outlining optional branches, allows
triangle shaped code to perform much better, esepecially when the
taken/untaken branches are correlated, as it creates a second spine when
the tests are small enough.

Issue from previous rollback fixed, and a new test was added for that
case as well.

Differential revision: https://reviews.llvm.org/D18226

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283274 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 23:54:18 +00:00
Mehdi Amini
d0bf4476a9 Use StringRef in TableGen (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283273 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 23:47:33 +00:00
Manuel Jacob
e1acf77d47 [C API] Add LLVMConstExactUDiv and LLVMBuildExactUDiv functions.
Summary:
These are analog to the existing LLVMConstExactSDiv and LLVMBuildExactSDiv
functions.

Reviewers: deadalnix, majnemer

Subscribers: majnemer, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283269 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 23:32:42 +00:00
Mehdi Amini
13e0592eaf Use StringRef in TableGen emitted API for attribute (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283268 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 23:31:39 +00:00
Rafael Espindola
2638e45e83 Misc improvements to StringTableBuilder.
This patch adds write methods to StringTableBuilder so that it is
easier to change the underlying implementation.

Using the write methods, avoid creating a temporary buffer when using
mmaped output.

It also uses a more compact key in the DenseMap. Overall this produces
a slightly faster lld:

firefox
  master 6.853419709
  patch  6.841968912 1.00167361138x faster
chromium
  master 4.297280174
  patch  4.298712163 1.00033323147x slower
chromium fast
  master 1.802335952
  patch  1.806872459 1.00251701521x slower
the gold plugin
  master 0.3247149
  patch  0.321971644 1.00852017888x faster
clang
  master 0.551279945
  patch  0.543733194 1.01387951128x faster
llvm-as
  master 0.032743458
  patch  0.032143478 1.01866568391x faster
the gold plugin fsds
  master 0.350814247
  patch  0.348571741 1.00643341309x faster
clang fsds
  master 0.6281672
  patch  0.621130222 1.01132931187x faster
llvm-as fsds
  master 0.030168899
  patch  0.029797155 1.01247582194x faster
scylla
  master 3.104222518
  patch  3.059590248 1.01458766252x faster

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283266 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 22:43:25 +00:00
Alina Sbirlea
296fa89982 [cpu-detection] Copy simplified version of get_cpuid_max to remove dependency to clang's implementation
Summary:
Attempting to fix PR30384.
Take the same approach as in compiler_rt and add a simplified version of __get_cpuid_max.
Including cpuid.h is no longer needed.

Reviewers: echristo, joerg

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283265 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 22:39:53 +00:00
David L Kreitzer
06c72d0928 Revert r283248. It caused failures in the hexagon buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283254 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 20:57:19 +00:00
Sanjay Patel
b60ab5d110 [Target] move reciprocal estimate settings from TargetOptions to TargetLowering
The motivation for the change is that we can't have pseudo-global settings for
codegen living in TargetOptions because that doesn't work with LTO.

Ideally, these reciprocal attributes will be moved to the instruction-level via
FMF, metadata, or something else. But making them function attributes is at least
an improvement over the current state.

The ingredients of this patch are:

    Remove the reciprocal estimate command-line debug option.
    Add TargetRecip to TargetLowering.
    Remove TargetRecip from TargetOptions.
    Clean up the TargetRecip implementation to work with this new scheme.
    Set the default reciprocal settings in TargetLoweringBase (everything is off).
    Update the PowerPC defaults, users, and tests.
    Update the x86 defaults, users, and tests.

Note that if this patch needs to be reverted, the related clang patch checked in
at r283251 should be reverted too.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283252 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 20:46:43 +00:00
Kevin Enderby
ec53f4b255 Next set of additional error checks for invalid Mach-O files for the
load commands that uses the MachO::encryption_info_command and
MachO::encryption_info_command types but not used in llvm libObject
code but used in llvm tool code.

This includes just LC_ENCRYPTION_INFO and
LC_ENCRYPTION_INFO_64 load commands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283250 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 20:37:43 +00:00
David L Kreitzer
ef20529727 [safestack] Requires a valid TargetMachine to be passed to the SafeStack pass.
Patch by Michael LeMay

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283248 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 20:31:32 +00:00
Michal Gorny
e8ae2230d2 [cmake] Make LIT_COMMAND configurable and improve fallback support
Make LIT_COMMAND configurable, use source tree only when actually
available and extend the default search to other common executable names
'lit.py' and 'lit', in order to increase uniformity between all LLVM
projects and support using installed lit.

Changing the conditional used to determine whether in-tree or external
lit is being used covers the case when LLVM_MAIN_SRC_DIR is defined but
does not exist (anymore). In this case, the functions falls back to
looking for installed lit rather than attempting to use a non-existing
path. The same conditional is used in clang already.

Making LIT_COMMAND a cache variable in case the source tree variant is
used serves two purposes. Firstly, it increases uniformity between
the two branches since find_program() implicitly makes LIT_COMMAND
a cache variable. Secondly, it allows overriding the lit executable used
to run the tests when the LLVM source tree is provided. Gentoo is
planning to use this to use installed (and byte-compiled) lit instead of
re-compiling it in every LLVM project.

Extending default search is meant to increase uniformity between
different LLVM projects. The 'lit.py' name is already used by a few of
them, and 'lit' is the name used by utils/lit/setup.py when installing.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283247 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 20:25:37 +00:00
Zachary Turner
0030b47dc1 [Support] Add case-insensitive versions of StringSwitch members.
This adds support for CaseLower, CasesLower, StartsWithLower, and
EndsWithLower.

Differential revision: https://reviews.llvm.org/D24686

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283244 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 19:33:13 +00:00
Matthias Braun
627f6167c2 AArch64: Macrofusion: Split features, add missing combinations.
AArch64InstrInfo::shouldScheduleAdjacent() determines whether two
instruction can benefit from macroop fusion on apple CPUs. The list
turned out to be incomplete:
- the "rr" variants of the instructions were missing
- even the "rs" variants can have shift value == 0 and behave like the
  "rr" variants

This also splits the MacropFusion target feature into
ArithmeticBccFusion and ArithmeticCbzFusion.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283243 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 19:28:21 +00:00
Mike Aizatsky
4c9998f283 [sancov] renamed symcov-report-server to coverage-report-server
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283241 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 19:18:23 +00:00
Anna Zaks
a8e8b59519 [asan] LLVM: Switch to using dynamic shadow offset on iOS
The VM layout is not stable between iOS version releases, so switch to dynamic shadow offset.

This is the LLVM counterpart of https://reviews.llvm.org/D25218

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283239 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 19:02:29 +00:00
Hal Finkel
b89fc685dd Don't filter diagnostics written as YAML to the output file
The purpose of the YAML diagnostic output file is to collect information on
optimizations performed, or not performed, for later processing by tools that
help users (and compiler developers) understand how code was optimized. As
such, the diagnostics that appear in the file should not be coupled to what a
user might want to see summarized for them as the compiler runs, and in fact,
because the user likely does not know what optimization diagnostics their tools
might want to use, the user cannot provide a useful filter regardless. As such,
we shouldn't filter the diagnostics going to the output file.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283236 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 18:13:45 +00:00
Chris Bieneman
d894e4df16 [CMake] Exclude intrinsics_gen from LLVM_COMMON_DEPENDS in LLVMConfig.cmake
CMake requires that all targets expressed as dependencies exist, so we can't have intrinsics_gen in LLVM_COMMON_DEPENDS when it is written out, otherwise projects building out of tree will have CMake errors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283234 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 17:44:28 +00:00