153392 Commits

Author SHA1 Message Date
Justin Bogner
b251a7588a IR: Make stripDebugInfo robust against (invalid) empty basic blocks
Since stripDebugInfo runs before the verifier when reading IR, we can
end up in a situation where we read some invalid IR but don't know its
invalid yet. Before this patch we would crash in stripDebugInfo when
given IR with a completely empty basic block, and after we get a nice
error from the verifier instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311202 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 21:38:03 +00:00
Jonas Devlieghere
15ccbc58e5 [llvm-dwarfdump] Hide .debug_str and DIE reference offsets in brief mode
This patch hides the .debug_str offset and DIE reference offsets into
the CU when llvm-dwarfdump is invoked with -brief.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311201 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 21:35:44 +00:00
Simon Pilgrim
2bd18ec173 [X86][ADX] Regenerate ADX intrinsics tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311198 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 21:21:14 +00:00
Sanjay Patel
47b90a07c7 fix typos in comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311193 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 20:27:47 +00:00
Ana Pazos
3686d78a5c [PGO] Fixed assertion due to mismatched memcpy size type.
Summary:
Memcpy intrinsics have size argument of any integer type, like i32 or i64.
Fixed size type along with its value when cloning the intrinsic.

Reviewers: davidxl, xur

Reviewed By: davidxl

Subscribers: mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311188 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 19:17:08 +00:00
Tim Northover
9b4ee7baf4 ARM: use an external relocation for calls from MachO ARM mode.
The internal (__text-relative) relocation risks the offset not being encodable
if the destination is Thumb.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311187 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 19:13:56 +00:00
Matt Morehouse
6dcfafe8ab [SanitizerCoverage] Add stack depth tracing instrumentation.
Summary:
Augment SanitizerCoverage to insert maximum stack depth tracing for
use by libFuzzer.  The new instrumentation is enabled by the flag
-fsanitize-coverage=stack-depth and is compatible with the existing
trace-pc-guard coverage.  The user must also declare the following
global variable in their code:
  thread_local uintptr_t __sancov_lowest_stack

https://bugs.llvm.org/show_bug.cgi?id=33857

Reviewers: vitalybuka, kcc

Reviewed By: vitalybuka

Subscribers: kubamracek, hiraditya, cfe-commits, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311186 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 18:43:30 +00:00
Marek Sokolowski
0b33df9bb6 Reapply: [llvm-rc] Add basic RC scripts parsing ability.
As for now, the parser supports a limited set of statements and
resources. This will be extended in the following patches.

Thanks to Nico Weber (thakis) for his original work in this area.

This patch was originally submitted as r311175 and got reverted
in r311177 because of the problems with compilation under gcc.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311184 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 18:24:17 +00:00
Jonas Devlieghere
86286f91c5 [Debug info] Transfer DI to fragment expressions for split integer values.
This patch teaches the SDag type legalizer how to split up debug info for
integer values that are split into a hi and lo part.

(re-commit)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311181 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 18:07:00 +00:00
Ben Dunbobbin
a74a4df4d5 [lit] support unsetting env variables (again!)
This is an updated version of https://reviews.llvm.org/D22144 by @jlpeyton.

The patch was accepted but not landed.

This is useful functionality and I would like to use this to enable lit tests for environment variable behaviour.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311180 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 17:32:57 +00:00
Konstantin Zhuravlyov
230b5542e4 AMDGPU/NFC: Rename few things in SIMemoryLegalizer:
- AtomicInfo -> MemOpInfo
  - getAtomicLoadInfo -> getLoadInfo
  - getAtomicStoreInfo -> getStoreInfo
  - expandAtomicLoad -> expandLoad
  - expandAtomicStore -> expandStore

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311179 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 17:30:02 +00:00
Marek Sokolowski
43ca59772e Revert "[llvm-rc] Add basic RC scripts parsing ability."
This reverts commit r311175.

This failed some buildbots compilation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311177 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 17:25:55 +00:00
Jakub Kuderski
a8f3cf28e0 [Dominators] Don't print the whole tree when running with -debug
As the incremental API is now used in several transforms, printing
the whole dominator tree creates a lot of noise when running with
the `-debug` flag. This patch fixes that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311176 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 17:06:37 +00:00
Marek Sokolowski
c05432ec0f [llvm-rc] Add basic RC scripts parsing ability.
As for now, the parser supports a limited set of statements and
resources. This will be extended in the following patches.

Thanks to Nico Weber (thakis) for his original work in this area.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311175 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 17:05:47 +00:00
Ben Dunbobbin
4c0c77a59c [Support] env vars with empty values on windows
An environment variable can be in one of three states:

1. undefined.
2. defined with a non-empty value.
3. defined but with an empty value.

The windows implementation did not support case 3
(it was not handling errors). The Linux implementation
is already correct.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311174 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 16:55:44 +00:00
Simon Pilgrim
5b56d19e34 [X86][BMI2] Added scheduling test for RORX/SARX/SHLX/SHRX instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311171 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 16:26:39 +00:00
Brian Gesiak
0d642908ab [Lexicon] Add "GEP"
Summary:
`getelementptr` is frequently abbreviated as "GEP", often in source files that
do not ever reference the full name of the instruction. Add it to the Lexicon,
in case readers go to look for what it means there.

Test plan:
1. `ninja sphinx`
2. Confirm that the rendered docs HTML contains the new "GEP" entry



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311168 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 15:35:53 +00:00
Simon Pilgrim
6d77959242 [X86][AES] Add scheduling latency/throughput tests for AES instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311167 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 15:26:51 +00:00
Simon Pilgrim
8b577a139a [X86][PCLMUL] Add scheduling latency/throughput test for PCLMULQDQ instruction
Added it to the SSE42 tests as targets seem to always have both

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311166 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 15:08:30 +00:00
Simon Pilgrim
b29118b50c [X86][SHA] Add scheduling latency/throughput tests for SHA instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311164 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 14:55:50 +00:00
Simon Pilgrim
0fec92d0a3 [X86][MOVBE] Add scheduling latency/throughput tests for MOVBE instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311163 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 14:44:31 +00:00
Sam Parker
58c7d529d3 [ARM] Add PostRAScheduler option
This patch adds the option to allow also using the PostRA scheduler,
which brings the ARM backend inline with AArch64 targets. The
SchedModel can also set 'PostRAScheduler', as the R52 does, so also
query this property in the overridden function.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311162 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 14:27:51 +00:00
Simon Dardis
b639d360e3 [mips] Follow up comments on r310460
Use dblaikie's suggestion of cast<> instead of a seperate assert.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311160 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 13:27:02 +00:00
Simon Pilgrim
3362574348 [X86][BMI2] Added scheduling test for MULX instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311159 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 13:22:18 +00:00
Sjoerd Meijer
3d8decf651 [AArch64] Do not promote f16 when subtarget HasFullFP16
Armv8.2-A adds FP16 support, i.e. f16 is not only a storage-only type, but it
also supports performing data processing on 16-bit floating-point quantities.
All the necessary (tablegen) groundwork of adding the ARMv8.2-A FP16 (scalar)
instructions was done in D15014. To take advantage of this, this patch avoids
promotion of f16 to f32 types when the subtarget supports FullFP16, which
enables instruction selection of these FP16 instructions.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311154 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 10:51:14 +00:00
Renato Golin
aea1537f4d [Triple] Define OS Check for Haiku
This adds the OS check for the Haiku operating system, as it was
missing in the Triple class. Tests for x86_64-unknown-haiku and
i586-pc-haiku were also added.

These patches only affect Haiku and are completely harmless for
other platforms.

Patch by Calvin Hill <calvin@hakobaito.co.uk>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311153 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 10:35:42 +00:00
Ilya Biryukov
9ad46603e4 Addressed some security issues in Dockerfiles.
Summary:
- Removed --trust-server-cert from `svn checkout` invocations.
  Installing 'ca-certificates' package on ubuntu adds required CAs to
  the system and svn can do proper checkout using https.

- Added checksum verification when installing cmake from cmake.org.

Reviewers: mehdi_amini, klimek

Reviewed By: mehdi_amini

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311152 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 09:37:23 +00:00
Diana Picus
f2ff8aa1cf Revert "GlobalISel (AArch64): fix ABI at border between GPRs and SP."
This reverts commit e8fd20964798ca6d46d2729dd3a789707a6416da in an
attempt to appease the GlobalISel buildbot, which fails in the
test-suite with errors like
fpcmp: files differ without tolerance allowance

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311151 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 09:31:21 +00:00
Sam Parker
76c3a69a38 [AArch64] Fix for buildbots, unused function
Removing function declaration, my previous commit broke the bots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311150 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 09:08:05 +00:00
Victor Leschuk
53cba36f61 Remove useless default case in switch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311149 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 09:02:06 +00:00
Sam Parker
4a6b362f2f [AArch64] Remove DecodeAuthLoadWriteback
The BaseAuthLoad instruction class was incorrectly passing an empty
constraint string to its parent, so I have corrected this. This makes
the DecodeAuthLoadWriteback function redundant, so I've also removed
it.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311148 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 08:39:54 +00:00
Alex Bradbury
b24452bf84 Refine report_fatal_error guidance after post-commit review
Use text suggested by Justin Bogner in post-commit review of r311146 
<http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20170814/479898.html>, 
which makes it clear that report_fatal_error shouldn't be used when there is a 
practicable alternative. Also make this clearer in CodingStandards.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311147 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 06:45:34 +00:00
Alex Bradbury
d8824ebc53 Give guidance on report_fatal_error in CodingStandards.rst and ProgrammersManual.rst
The current ProgrammersManual.rst document has a lot of well-written 
documentation on error handling thanks to @lhames. It suggests errors can be 
split cleanly into "programmatic" and "recoverable" errors. However, the 
reality in current LLVM seems to be there are a number of cases where a 
non-programmatic error is not easily recoverable. Therefore, add a note to 
indicate the existence of report_fatal_error for these cases. I've also added 
a reminder to CodingStandards.rst in the section on assertions, to indicate 
that llvm_unreachable and assertions should not be relied upon to report 
errors triggered by user input.

The ProgrammersManual is also silent on the use of LLVMContext::diagnose, 
which is used in BPF+WebAssembly+AMDGPU to report some errors during 
instruction selection. I don't address that in this patch, as it's not quite 
clear how to fit in to the current error handling story

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311146 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 05:29:21 +00:00
Craig Topper
bc3b8e99f1 [DAGCombiner] Fix bad comment that had immediate values swapped from the code and what they need to be to make sense. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311144 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 04:52:46 +00:00
Jatin Bhateja
cb8d6dea18 Test commit access
Summary: Adding a blank line.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311143 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 02:39:28 +00:00
Geoff Berry
6c9f36933c Revert "[MachineCopyPropagation] Extend pass to do COPY source forwarding" round 2
This reverts commit r311135.

sanitizer-x86_64-linux-android buildbot is timing out with just this
patch applied.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311142 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18 01:43:11 +00:00
Richard Smith
11110e1279 Increase tail dup threshold for -O3 from 3 to 4.
We see a modest performance improvement from this slightly higher tail dup threshold.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311139 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-17 23:38:41 +00:00
Craig Topper
1c92091839 [X86] Remove SSE/AVX patterns for AND/XOR/OR/ANDN that checked for the inputs being bitcasted from floating point types.
There's really no reason to do this we should just let isel pick the integer version and let the execution dependency fixing pass take care of moving to FP if necessary.

It's not very reliable to look for bitcasts at the edges of patterns. If for some reason one input was bitcasted and the other wasn't, or if one was a v4f32 bitcast and one was a v2f64 bitcast, we would have fallen back to the integer pattern anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311138 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-17 23:20:57 +00:00
Tim Northover
e8fd209647 GlobalISel (AArch64): fix ABI at border between GPRs and SP.
If a struct would end up half in GPRs and half on SP the ABI says it should
actually go entirely on the stack. We were getting this wrong in GlobalISel
before, causing compatibility issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311137 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-17 23:14:01 +00:00
Geoff Berry
d93db263e5 Re-enable "[MachineCopyPropagation] Extend pass to do COPY source forwarding"
Two issues identified by buildbots were addressed:
    - The pass no longer forwards COPYs to physical register uses, since
      doing so can break code that implicitly relies on the physical
      register number of the use.
    - The pass no longer forwards COPYs to undef uses, since doing so
      can break the machine verifier by creating LiveRanges that don't
      end on a use (since the undef operand is not considered a use).

    [MachineCopyPropagation] Extend pass to do COPY source forwarding

    This change extends MachineCopyPropagation to do COPY source forwarding.

    This change also extends the MachineCopyPropagation pass to be able to
    be run during register allocation, after physical registers have been
    assigned, but before the virtual registers have been re-written, which
    allows it to remove virtual register COPY LiveIntervals that become dead
    through the forwarding of all of their uses.

    Reviewers: qcolombet, javed.absar, MatzeB, jonpa

    Subscribers: jyknight, nemanjai, llvm-commits, nhaehnle, mcrosier, mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311135 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-17 23:06:55 +00:00
Zachary Turner
b5c199a647 Fix warning about covered switch default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311129 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-17 22:20:15 +00:00
Tom Stellard
7dcd9e77f5 AMDGPU: Add R600InstPrinter class
Summary:
This is step towards separating the GCN and R600 tablegen'd code.

This is a little awkward for now, because the R600 functions won't have the
MCSubtargetInfo parameter, so we need to have AMDMGPUInstPrinter
delegate to R600InstPrinter, but once the tablegen'd code is split,
we will be able to drop the delegation and use R600InstPrinter directly.

Reviewers: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311128 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-17 22:20:04 +00:00
Jakub Kuderski
b878f814c6 [LoopRotate][Dominators] Use the incremental API to update DomTree
Summary: This patch teaches LoopRotate to use the new incremental API to update the DominatorTree.

Reviewers: dberlin, davide, grosser, sanjoy

Reviewed By: dberlin, davide

Subscribers: hiraditya, llvm-commits, mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311125 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-17 21:48:19 +00:00
Eugene Zelenko
ee8a71b734 [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311124 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-17 21:26:39 +00:00
Zachary Turner
295b95de34 Remove unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311119 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-17 20:18:36 +00:00
Zachary Turner
6035f1ffb5 [llvm-pdbutil] Fix some dumping issues.
When dumping, we were treating the S_INLINESITESYM as referring
to a type record, when it actually refers to an id record.  We
had this correct in TypeIndexDiscovery, so our merging algorithm
should be fine, but we had it wrong in the dumper, which means it
would appear to work most of the time, unless the index was out
of bounds in the type stream, when it would fail.  Fixed this, and
audited a few other cases to make them match the behavior in
TypeIndexDiscovery.

Also, I've now observed a new symbol record with kind 0x1168 which
I have no clue what it is, so to avoid crashing we have to just
print "Unknown Symbol Kind".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311117 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-17 20:04:51 +00:00
Zachary Turner
54e28fe2aa Fix a few minor issues when dumping symbols.
1) We weren't handling symbol types that weren't able to parse,
   even if we knew what the leaf type was.  This was triggering
   when trying to dump /DEBUG:FASTLINK PDBs, where we expect a
   certain symbol to show up, but we just don't know how to parse
   it.
2) We lost the code for dumping record bytes, so this was added
   back.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311116 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-17 20:04:31 +00:00
Lang Hames
35adac2ab6 [docs] Tweak phrasing of the varargs explanation in the command section of the
CMake primer.

This moves the introduction of the ARGV/ARGN variables up to immmediately follow
the introduction of the concept of variable argument functions, and explicitly
connects this concept to C varargs functions.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311113 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-17 18:21:53 +00:00
Lang Hames
d17c970ac7 [docs] Fix typo and tweak wording of special variable handling in CMake primer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311112 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-17 18:00:28 +00:00
Jonas Devlieghere
84dc1f35b1 Revert "[Debug info] Transfer DI to fragment expressions for split integer values."
This reverts commit r311102.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311111 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-17 17:58:33 +00:00