Commit Graph

138720 Commits

Author SHA1 Message Date
Nikolay Haustov
2a3c739021 AMDGPU: Improve documentation.
Summary:
Add links to ISA manuals and ABI.
Add text about assembler syntax.
Add info about instructions operands.
Add instruction examples for each encoding.
Update directives section, add missing .amdgpu_hsa_kernel.

Reviewers: tstellarAMD, SamWot, vpykhtin

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, tony-tye, artem.tamazov, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281962 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 09:04:51 +00:00
Dorit Nuzman
42ea17a3ac Reverting revision 281960 due to test failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281961 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 08:27:48 +00:00
Dorit Nuzman
8e817265bd [SROA] Preserve llvm.mem.parallel_loop_access metadata.
SROA doesn't preserve the llvm.mem.parallel_loop_access metadata when it
transforms loads/stores. This patch fixes a couple occurences of this
issue.

(Partially addresses PR28981).

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281960 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 07:50:49 +00:00
Craig Topper
0acae1f681 [AVX-512] Teach X86InstrInfo::copyPhysReg to use a 512-bit move if XMM16-XMM31 or YMM16-YMM31 are the source or dest of the copy and VLX is not supported.
This can happen with SUBREG_TO_REG of ZMM16-ZMM31. Fixes PR30430.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281959 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 06:49:17 +00:00
Craig Topper
fd8c733710 [AVX-512] Use 512-bit vcvtps2ph/vcvtph2ps to implement fp_to_f16/f16_to_fp when F16C and VLX are not supported.
Fixes PR23941.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281958 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 05:44:47 +00:00
Matthias Braun
b72235f318 BranchFolder: Fix invalid undef flags after merge.
It is legal to merge instructions with different undef flags; However we
must drop the undef flag from the merged instruction if it isn't present
everywhere.

This fixes http://llvm.org/PR30199

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281957 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 01:14:42 +00:00
Matthias Braun
34c557c690 Machine{Instr|Operand}: Clarify some isIdenticalTo() subtleties.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281956 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 01:14:39 +00:00
Quentin Colombet
879da284b5 [RegisterBankInfo] Avoid heap allocation in InstructionMapping.
Use SmallVector instead of dynamically allocated arrays for the mapping of the
operands in the InstructionMapping. That way we avoid heap allocation for most
of the cases. Ultimately, we should not have to rely on such tricky, the
instances of InstructionMapping would be TableGen'ed.

This improves the compilation time of the RegBankSelect pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281955 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 00:48:44 +00:00
Sanjay Patel
ef83519d80 [x86] fix variable names; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281953 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 00:27:22 +00:00
Kostya Serebryany
18f63e47d8 [sanitizer-coverage] add comdat to coverage guards if needed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281952 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 00:16:54 +00:00
Sanjay Patel
f8408ab22c [x86] auto-generate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281950 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 23:44:50 +00:00
Philip Reames
67197eeb7d [LCSSA] Cache LoopExits to avoid wasted work
When looking at the scribus_1.3 example from https://llvm.org/bugs/show_bug.cgi?id=10584, I noticed that we were spending a large amount of time computing loop exits in LCSSA. This code appears to be written with the assumption that LoopExits are stored in the Loop and thus cheap to query. This is not true, so we should cache the result across the potentially long running loop which tends to visit a small handful of Loops.

On the particular example from 10584, this change drops the time spent in LCSSA computation by about 80%.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281949 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 23:30:23 +00:00
Quentin Colombet
3d21d847db [RegisterBankInfo] Adapt call to std::fill due to use of SmallVector.
This was meant to be commited with my previous commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281948 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 23:18:47 +00:00
David Callahan
15afb79976 Merge branch 'ADCE5'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281947 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 23:17:58 +00:00
Lang Hames
4cd6605af1 [Kaleidoscope] Make Chapter 2 use llvm::make_unique, rather than a helper.
This essentially reverts r251936, minimizing the difference between Chapter2
and Chapter 3, and making Chapter 2's code match the tutorial text.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281945 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 23:00:27 +00:00
Sanjay Patel
10b68a36b4 [x86] use getSignBit() to simplify code; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281944 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 22:07:27 +00:00
Eric Christopher
f1212b9bfc Move the armv8.1-a ras test to a negative with noras test as ras is
included in armv8.1-a by default and so we weren't testing anything.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281941 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 21:55:04 +00:00
Mehdi Amini
a2d3e0354c BitcodeWriter: fix emission of invoke when calling a var-arg function with operand bundles
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281940 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 21:27:04 +00:00
Evgeniy Stepanov
050e90399c Misleading comments of SplitBlockAndInsertIfThenElse in BasicBlockUtils.h
The comments of SplitBlockAndInsertIfThenElse say the SplitBefore instruction will stay in the old block.
But according to the implementation(split the block at SplitBefore by using splitBasicBlock), the SplitBefore will be moved to the new block.

This patch fixes the comments.

Patch by Zhe Yu Wu.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281939 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 21:26:05 +00:00
Simon Pilgrim
4f6fc26807 [X86][SSE] Updated vector abs tests
Renamed and added v2i64 / v4i64 tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281937 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 20:50:35 +00:00
Kostya Serebryany
b3d4112198 [libFuzzer] use sleep() instead of std::this_thread::sleep_for to avoid coverage from instrumented libc++
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281933 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 20:32:34 +00:00
Dehao Chen
ddeacc711a Handle early inline for hot callsites that reside in the same basic block.
Summary: Callsites in the same basic block should share the same hotness. This patch checks for the hottest callsite in the same basic block, and use the hotness for all callsites in that basic block for early inline decisions. It also fixes the test to add "-S" so theat the "CHECK-NOT" is actually checking the content.

Reviewers: dnovillo

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281927 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 18:38:14 +00:00
Quentin Colombet
d809745696 [RegisterBankInfo] Avoid heap allocation in most cases.
The OperandsMapper class is used heavy in RegBankSelect and each
instantiation triggered a heap allocation for the array of operands.
Instead, use a SmallVector with a big enough size such that most of the
cases do not have to use dynamically allocated memory.

This improves the compile time of the RegBankSelect pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281916 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 17:33:55 +00:00
Matthias Braun
b0731963da LiveRangeCalc: Fix reporting of invalid vreg usage in liveness calculation
Machine programs need a definition of each vreg before reaching a use
(the definition may come from an IMPLICIT_DEF instruction). This class
of errors is not detected by the MachineVerifier because of efficiency
concerns. LiveRangeCalc used to report these problems, make it do that
again (followup to r279625).

Also use report_fatal_error() instead of llvm_unreachable() as the error
reporting is only present in asserts build anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281914 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 16:49:45 +00:00
Dehao Chen
ba3d957955 Only set branch weight during sample pgo annotation when max_weight of the branch is non-zero. Otherwise use default static profile to set branch probability.
Summary: It does not make sense to set equal weights for all unkown branches as we have static branch prediction available.

Reviewers: dnovillo

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281912 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 16:33:41 +00:00
Dehao Chen
625183db5a Use call target count to derive the call instruction weight
Summary: The call target count profile is directly derived from LBR branch->target data. This is more reliable than instruction frequency profiles that could be moved across basic block boundaries. This patches uses call target count profile to annotate call instructions.

Reviewers: davidxl, dnovillo

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281911 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 16:06:37 +00:00
Etienne Bergeron
b87b0d3795 [asan] Support dynamic shadow address instrumentation
Summary:
This patch is adding the support for a shadow memory with
dynamically allocated address range.

The compiler-rt needs to export a symbol containing the shadow
memory range.

This is required to support ASAN on windows 64-bits.

Reviewers: kcc, rnk, vitalybuka

Subscribers: kubabrecka, dberris, llvm-commits, chrisha

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281908 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 15:58:38 +00:00
Zachary Turner
781fb6ecc8 [Support] Add StringRef::withNullAsEmpty()
When porting large bodies of code from using const char*
to StringRef, it is helpful to be able to treat nullptr
as an empty string, since that it is often what it is used
to indicate in C-style code.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281906 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 15:34:51 +00:00
Nico Weber
ebd2807ce8 Revert r281841, it does not work on Windows (PR30443).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281905 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 15:22:04 +00:00
Valery Pykhtin
d1be85dd3c [AMDGPU] Refactor VOPC instruction TD definitions
Differential Revision: https://reviews.llvm.org/D24546

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281903 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 14:39:49 +00:00
Diana Picus
1494db60ab [AArch64] Fix encoding for lsl #12 in add/sub immediates
Whenever an add/sub immediate needs a fixup, we set that immediate field to zero,
which is correct, but we also set the shift bits to zero, which is not true for
instructions that use lsl #12. This patch makes sure that if lsl #12 was used,
it will appear in the encoding of the instruction.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281898 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 11:10:18 +00:00
Sam Kolton
21fcdfd73b [AMDGPU] Fix s_branch with -1 offset
Summary:
In case s_branch instruction target is itself backend should emit offset -1 but instead it emit 0.
'''
label:
    s_branch label  // should emit [0xff,0xff,0x82,0xbf]
'''

Tom, Matt: why are we adjusting fixup values in applyFixup() method instead of processFixup()? processFixup() is calling adjustFixupValue() but does nothing with its result.

Reviewers: vpykhtin, artem.tamazov, tstellarAMD

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281896 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 10:20:55 +00:00
Keith Walker
383922dd5b Add @llvm.dbg.value entries for the phi node created by -mem2reg
When phi nodes are created in the -mem2reg phase, the @llvm.dbg.declare
entries are converted to @llvm.dbg.value entries at the place where the
store instructions existed. However no entry is created to describe
the resulting value of the phi node.

The effect of this is especially noticeable in for loops which have a
constant for the intial value; the loop control variable's location
would be described as the intial constant value in the loop body once
the -mem2reg optimization phase was run.

This change adds the creation of the @llvm.dbg.value entries to describe
variables whose location is the result of a phi node created in -mem2reg.

Also when the phi node is finally lowered to a machine instruction it
is important that the lowered "load" instruction is placed before the
associated DEBUG_VALUE entry describing the value loaded.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281895 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 09:49:30 +00:00
Oliver Stannard
8d46442503 [Thumb] Set correct initial mapping symbol for big-endian thumb
The initial mapping symbol state is set from the triple, but we only checked
for the little-endian thumb triple, so could end up with an ARM mapping symbol
for big-endian thumb.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281894 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 09:21:45 +00:00
Tim Northover
ab6de7f248 ARM: check alignment before transforming ldr -> ldm (or similar).
ldm and stm instructions always require 4-byte alignment on the pointer, but we
weren't checking this before trying to reduce code-size by replacing a
post-indexed load/store with them. Unfortunately, we were also dropping this
incormation in DAG ISel too, but that's easy enough to fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281893 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 09:11:09 +00:00
Elena Demikhovsky
01736613c2 [X86 Codegen Test] Divided masked_memop into several files. NFC.
The masked_memop.ll became huge. I extracted AVX-512 specific tests into separate files.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281892 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 08:58:43 +00:00
James Molloy
1a9f29f7eb [SimplifyCFG] Update (AND) IR flags when CSE'ing instructions
We were updating metadata but not IR flags. Because we pick an arbitrary instruction to be the CSE candidate, it comes down to luck (50% or less chance) if this results in broken codegen or not, which is why PR30373 which is actually not the fault of the commit it was bisected down to.

Fixes PR30373.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281889 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 08:23:08 +00:00
Craig Topper
d854787edd [X86,AVX-512] Use INSERT_SUBREG instead of SUBREG_TO_REG when the input is not the output of an instruction.
SUBREG_TO_REG is supposed to indicate that the super register has been zeroed, but we can't prove that if we don't know where it came from.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281885 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 02:53:43 +00:00
Craig Topper
d5369d3bd4 [AVX-512] Add support for lowering fp_to_f16 and f16_to_fp when VLX is supported regardless of whether F16C is also supported.
Still need to add support for lowering using AVX512F when neither VLX or F16C is supported.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281884 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 02:53:37 +00:00
Vedant Kumar
764028eefa [llvm-cov] Emit a link to some documentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281883 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 02:15:59 +00:00
Vedant Kumar
1b70b5dcc9 [llvm-cov] Delete the NonCodeLines field, it was always dead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281882 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 01:46:01 +00:00
Dean Michael Berris
916b3667a3 [XRay] ARM 32-bit no-Thumb support in LLVM
This is a port of XRay to ARM 32-bit, without Thumb support yet. The XRay instrumentation support is moving up to AsmPrinter.
This is one of 3 commits to different repositories of XRay ARM port. The other 2 are:

https://reviews.llvm.org/D23932 (Clang test)
https://reviews.llvm.org/D23933 (compiler-rt)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281878 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 00:54:35 +00:00
Vedant Kumar
70b43c34b6 [llvm-cov] Teach the coverage exporter about instantiation coverage
While we're at it, re-use the logic from CoverageReport to compute
summaries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281877 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 00:38:29 +00:00
Vedant Kumar
a830753405 [llvm-cov] Make a helper method static for re-use (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281876 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 00:38:25 +00:00
Vedant Kumar
e17f26f066 [llvm-cov] Track function and instantiation coverage separately
These are distinct statistics which are useful to look at separately.

Example: say you have a template function "foo" with 5 instantiations
and only 3 of them are covered. Then this contributes (1/1) to the total
function coverage and (3/5) to the total instantiation coverage. I.e,
the old "Function Coverage" column has been renamed to "Instantiation
Coverage", and the new "Function Coverage" aggregates information from
the various instantiations of a function.

One benefit of making this switch is that the Line and Region coverage
columns will start making sense. Let's continue the example and assume
that the 5 instantiations of "foo" cover {2, 4, 6, 8, 10} out of 10
lines respectively. The new line coverage for "foo" is (10/10), not
(30/50).  The old scenario got confusing because we'd report that there
were more lines in a file than what was actually possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281875 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 00:38:23 +00:00
Vedant Kumar
40817d86f0 [llvm-cov] Don't recompute the 'Covered' field from *CoverageInfo (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281874 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 00:38:18 +00:00
Vedant Kumar
6360ab9da4 [llvm-cov] Make 'adjustColumnWidths' do less work
This drops some redundant calls to get{UniqueSourceFiles,
CoveredFunctions}. We can figure out the right column widths without
re-doing this expensive work.

This isn't NFC, but I don't want to check in another binary *.covmapping
file with long filenames in it. I tested this locally on a project with
some long filenames (FileCheck).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281873 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 00:38:16 +00:00
Vedant Kumar
c063c43a4e [llvm-cov] Drop another redundant 'No.' suffix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281872 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 00:38:14 +00:00
Vedant Kumar
7b1bb280cd [utils] Delete the 'check-coverage-regressions' script
In practice, it's way too noisy.

It's also a maintenance burden, since we apparently can't add tests for
it without breaking some Windows setups (see: D22692).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281871 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 00:38:11 +00:00
Dehao Chen
60489f476b Handle Invoke during sample profiler annotation: make it inlinable.
Summary: Previously we reline on inst-combine to remove inlinable invoke instructions. This causes trouble because a few extra optimizations are schedule early that could introduce too much CFG change (e.g. simplifycfg removes too much control flow). This patch handles invoke instruction in-place during sample profile annotation, so that we do not rely on instcombine to remove those invoke instructions.

Reviewers: davidxl, dnovillo

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281870 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-18 23:11:37 +00:00