OSDN Git Service

android-x86/external-llvm.git
6 years ago[Local] Fix a bug in the domtree update logic for MergeBasicBlockIntoOnlyPred.
Balaram Makam [Wed, 25 Oct 2017 14:55:48 +0000 (14:55 +0000)]
[Local] Fix a bug in the domtree update logic for MergeBasicBlockIntoOnlyPred.

Summary: For some irreducible CFG the domtree nodes might be dead, do not update domtree for dead nodes.

Reviewers: kuhar, dberlin, hfinkel

Reviewed By: kuhar

Subscribers: llvm-commits, mcrosier

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316582 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoDon't try to use a non-existent header on FreeBSD/mips.
John Baldwin [Wed, 25 Oct 2017 14:53:16 +0000 (14:53 +0000)]
Don't try to use a non-existent header on FreeBSD/mips.

Reviewers: dim

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316581 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd CalledValuePropagation pass
Matthew Simpson [Wed, 25 Oct 2017 13:40:08 +0000 (13:40 +0000)]
Add CalledValuePropagation pass

This patch adds a new pass for attaching !callees metadata to indirect call
sites. The pass propagates values to call sites by performing an IPSCCP-like
analysis using the generic sparse propagation solver. For indirect call sites
having a small set of possible callees, the attached metadata indicates what
those callees are. The metadata can be used to facilitate optimizations like
intersecting the function attributes of the possible callees, refining the call
graph, performing indirect call promotion, etc.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316576 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[mips] Clean up some whitespace (NFC).
Simon Dardis [Wed, 25 Oct 2017 13:35:53 +0000 (13:35 +0000)]
[mips] Clean up some whitespace (NFC).

Also test that my email address was updated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316575 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[inlineasm] Fix crash when number of matched input constraint operands overflows...
Daniil Fukalov [Wed, 25 Oct 2017 12:51:32 +0000 (12:51 +0000)]
[inlineasm] Fix crash when number of matched input constraint operands overflows signed char

In a case when number of output constraint operands that has matched input operands
doesn't fit to signed char, TargetLowering::ParseConstraints() can try to access
ConstraintOperands (that is std::vector) with negative index.

Reviewers: rampitec, arsenm

Differential Review: https://reviews.llvm.org/D39125

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316574 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM GlobalISel] Remove redundant testcases. NFC
Diana Picus [Wed, 25 Oct 2017 12:22:21 +0000 (12:22 +0000)]
[ARM GlobalISel] Remove redundant testcases. NFC

Remove the G_FADD testcases from arm-legalizer.mir, they are covered by
arm-legalizer-fp.mir (I probably forgot to delete them when I created
that test).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316573 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM GlobalISel] Update test after r316479. NFC
Diana Picus [Wed, 25 Oct 2017 12:22:16 +0000 (12:22 +0000)]
[ARM GlobalISel] Update test after r316479. NFC

No need to check register classes in the register block anymore, since
we can now much more conveniently check them at their def.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316572 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM GlobalISel] Fix call opcodes
Diana Picus [Wed, 25 Oct 2017 11:42:40 +0000 (11:42 +0000)]
[ARM GlobalISel] Fix call opcodes

We were generating BLX for all the calls, which was incorrect in most
cases. Update ARMCallLowering to generate BL for direct calls, and BLX,
BX_CALL or BMOVPCRX_CALL for indirect calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316570 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM GlobalISel] Split test into 3. NFC
Diana Picus [Wed, 25 Oct 2017 11:21:15 +0000 (11:21 +0000)]
[ARM GlobalISel] Split test into 3. NFC

Separate the test cases that deal with calls from the rest of the IR
Translator tests.

We split into 2 different files, one for testing parameter and result
lowering, and one for testing the various different kinds of calls that
can occur (BL, BLX, BX_CALL etc).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316569 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SCEV] Enhance SCEVFindUnsafe for division
Max Kazantsev [Wed, 25 Oct 2017 11:07:43 +0000 (11:07 +0000)]
[SCEV] Enhance SCEVFindUnsafe for division

This patch allows SCEVFindUnsafe algorithm to tread division by any non-positive
value as safe. Previously, it could only recognize non-zero constants.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316568 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRe-land "[CodeGen][ExpandMemcmp][NFC] Allow memcmp to expand to vector loads (1)"
Clement Courbet [Wed, 25 Oct 2017 11:02:09 +0000 (11:02 +0000)]
Re-land "[CodeGen][ExpandMemcmp][NFC] Allow memcmp to expand to vector loads (1)"

Compute the actual decomposition only after deciding whether to expand
of not. Else, it's easy to make the compiler OOM with:
`memcpy(dst, src, 0xffffffffffffffff);`, which typically happens if
someone mistakenly passes a negative value. Add a test.

This reverts commit f8fc02fbd4ab33383c010d33675acf9763d0bd44.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316567 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-dwarfdump] - Fix array out of bounds access crash.
George Rimar [Wed, 25 Oct 2017 10:23:49 +0000 (10:23 +0000)]
[llvm-dwarfdump] - Fix array out of bounds access crash.

This fixes possible out of bound access in
DWARFDie::getFirstChild()
which might happen when .debug_info section is corrupted,
like shown in testcase.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316566 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM] OrCombineToBFI function
Sam Parker [Wed, 25 Oct 2017 08:37:33 +0000 (08:37 +0000)]
[ARM] OrCombineToBFI function

Extract the functionality to combine OR to BFI into its own function.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316563 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM] Swap cmp operands for automatic shifts
Sam Parker [Wed, 25 Oct 2017 08:33:06 +0000 (08:33 +0000)]
[ARM] Swap cmp operands for automatic shifts

Swap the compare operands if the lhs is a shift and the rhs isn't,
as in arm and T2 the shift can be performed by the compare for its
second operand.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316562 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MachineScheduler] Minor refactoring.
Jonas Paulsson [Wed, 25 Oct 2017 08:23:33 +0000 (08:23 +0000)]
[MachineScheduler]  Minor refactoring.

Duplicated code found in three places put into a new static function:

/// Given a Count of resource usage and a Latency value, return true if a
/// SchedBoundary becomes resource limited.
static bool checkResourceLimit(unsigned LFactor, unsigned Count,
                               unsigned Latency) {
  return (int)(Count - (Latency * LFactor)) > (int)LFactor;
}

Review: Florian Hahn, Matthias Braun
https://reviews.llvm.org/D39235

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316560 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AArch64] Add support for dllimport of values and functions
Martin Storsjo [Wed, 25 Oct 2017 07:25:18 +0000 (07:25 +0000)]
[AArch64] Add support for dllimport of values and functions

Previously, the dllimport attribute did the right thing in terms
of treating it as a pointer to a value, but this makes sure the
names get mangled properly, and calls to such functions load the
function from the __imp_ pointer.

This is based on SVN r212431 and r212430 where the same was
implemented for ARM.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316555 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoDAG: Fix creating select with wrong condition type
Matt Arsenault [Wed, 25 Oct 2017 07:14:07 +0000 (07:14 +0000)]
DAG: Fix creating select with wrong condition type

This code added in r297930 assumed that it could create
a select with a condition type that is just an integer
bitcast of the selected type. For AMDGPU any vselect is
going to be scalarized (although the vector types are legal),
and all select conditions must be i1 (the same as getSetCCResultType).

This logic doesn't really make sense to me, but there's
never really been a consistent policy in what the select
condition mask type is supposed to be. Try to extend
the logic for skipping the transform for condition types
that aren't setccs. It doesn't seem quite right to me though,
but checking conditions that seem more sensible (like whether the
vselect is going to be expanded) doesn't work since this
seems to depend on that also.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316554 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Add max-mix-insts subtarget feature
Matt Arsenault [Wed, 25 Oct 2017 07:00:51 +0000 (07:00 +0000)]
AMDGPU: Add max-mix-insts subtarget feature

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316553 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[IRCE] Fix intersection between signed and unsigned ranges
Max Kazantsev [Wed, 25 Oct 2017 06:47:39 +0000 (06:47 +0000)]
[IRCE] Fix intersection between signed and unsigned ranges

IRCE for unsigned latch conditions was temporarily disabled by rL314881. The motivating
example contained an unsigned latch condition and a signed range check. One of the safe
iteration ranges was `[1, SINT_MAX + 1]`. Its right border was incorrectly interpreted as a negative
value in `IntersectRange` function, this lead to a miscompile under which we deleted a range check
without inserting a postloop where it was needed.

This patch brings back IRCE for unsigned latch conditions. Now we treat range intersection more
carefully. If the latch condition was unsigned, we only try to consider a range check for deletion if:
1. The range check is also unsigned, or
2. Safe iteration range of the range check lies within `[0, SINT_MAX]`.
The same is done for signed latch.

Values from `[0, SINT_MAX]` are unambiguous, these values are non-negative under any interpretation,
and all values of a range intersected with such range are also non-negative.

We also use signed/unsigned min/max functions for range intersection depending on type of the
latch condition.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316552 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MemDep] DBG intrinsics don't impact abort limit for call site dependence analysis
Mikael Holmen [Wed, 25 Oct 2017 06:15:32 +0000 (06:15 +0000)]
[MemDep] DBG intrinsics don't impact abort limit for call site dependence analysis

Summary:
Memory dependence analysis no longer counts DbgInfoIntrinsics towards the
limit where to abort the analysis. Before, a bunch of calls to dbg.value
could affect the generated code, meaning that with -g we could generate
different code than without.

Reviewers: chandlerc, Prazek, davide, efriedma

Reviewed By: efriedma

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316551 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[IRCE] Smarter detection of empty ranges using SCEV
Max Kazantsev [Wed, 25 Oct 2017 06:10:02 +0000 (06:10 +0000)]
[IRCE] Smarter detection of empty ranges using SCEV

For a SCEV range, this patch replaces the naive emptiness check for SCEV ranges
which looks like `Begin == End` with a SCEV check. The range is guaranteed to be
empty of `Begin >= End`. We should filter such ranges out and do not try to perform
IRCE for them.

For example, we can get such range when intersecting range `[A, B)` and `[C, D)`
where `A < B < C < D`. The resulting range is `[max(A, C), min(B, D)) = [C, B)`.
This range is empty, but its `Begin` does not match with `End`.

Making IRCE for an empty range is basically safe but unprofitable because we
never actually get into the main loop where the range checks are supposed to
be eliminated. This patch uses SCEV mechanisms to treat loops with proved
`Begin >= End` as empty.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316550 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAssembly tests require x86 target.
Peter Collingbourne [Wed, 25 Oct 2017 04:24:20 +0000 (04:24 +0000)]
Assembly tests require x86 target.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316546 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ThinLTO] Make test for promoted names more specific
Teresa Johnson [Wed, 25 Oct 2017 03:41:31 +0000 (03:41 +0000)]
[ThinLTO] Make test for promoted names more specific

With r314527, promoted values get a suffix that is a decimal value of
the module hash instead of hex. Change the regex to match only decimal
suffix values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316544 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agollvm-readobj: Add support for reading relocations in the Android packed format.
Peter Collingbourne [Wed, 25 Oct 2017 03:37:12 +0000 (03:37 +0000)]
llvm-readobj: Add support for reading relocations in the Android packed format.

This is in preparation for testing lld's upcoming relocation packing
feature (D39152). I have verified that this implementation correctly
unpacks the relocations from a Chromium DSO built with gold and the
Android relocation packer for ARM32 and ARM64.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316543 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoCheck special-case-list regex before insertion.
Mitch Phillips [Tue, 24 Oct 2017 23:56:12 +0000 (23:56 +0000)]
Check special-case-list regex before insertion.

Summary:
Checks that the supplied regex to SpecialCaseList::Matcher::insert(..) is non-empty.

Reported by OSS-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3688

Verified that this fixes the provided assertion failure (built with {asan, fuzzer}):
```
mitchp@mitchp2:~/llvm-build/git-fuzz$ ninja llvm-special-case-list-fuzzer[12/12] Linking CXX executable bin/llvm-special-case-list-fuzzer
mitchp@mitchp2:~/llvm-build/git-fuzz$ bin/llvm-special-case-list-fuzzer ~/Downloads/clusterfuzz-testcase-6748633157337088
INFO: Seed: 1697404507
INFO: Loaded 1 modules   (18581 inline 8-bit counters): 18581 [0x9e9f60, 0x9ee7f5),
INFO: Loaded 1 PC tables (18581 PCs): 18581 [0x9ee7f8,0xa37148),
bin/llvm-special-case-list-fuzzer: Running 1 inputs 1 time(s) each.
Running: /usr/local/google/home/mitchp/Downloads/clusterfuzz-testcase-6748633157337088
Executed /usr/local/google/home/mitchp/Downloads/clusterfuzz-testcase-6748633157337088 in 0 ms
***
*** NOTE: fuzzing was not performed, you have only
***       executed the target code on a fixed set of inputs.
***
mitchp@mitchp2:~/llvm-build/git-fuzz$

```

Reviewers: kcc, vsk

Reviewed By: vsk

Subscribers: vsk, llvm-commits, vlad.tsyrklevich

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316537 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoImplement salavageDebugInfo functionality for SelectionDAG.
Adrian Prantl [Tue, 24 Oct 2017 22:55:12 +0000 (22:55 +0000)]
Implement salavageDebugInfo functionality for SelectionDAG.

Similar to how llvm::salvagDebugInfo hooks into InstCombine, this adds
a hook that can be invoked before an SDNode that is associated with an
SDDbgValue is erased to capture the effect of the deleted node in a
DIExpression.

The motivating example is an SDDebugValue attached to an ADD operation
that gets folded into a LOAD+OFFSET operation.

rdar://problem/32121503

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316525 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd Triple::isOSUnknown
Sam Clegg [Tue, 24 Oct 2017 22:48:19 +0000 (22:48 +0000)]
Add Triple::isOSUnknown

Subscribers: aheejin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316524 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Coverage] Provide a stable order for getInstantiationGroups
Vedant Kumar [Tue, 24 Oct 2017 22:35:29 +0000 (22:35 +0000)]
[Coverage] Provide a stable order for getInstantiationGroups

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316523 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agobpf: fix an uninitialized variable issue
Yonghong Song [Tue, 24 Oct 2017 21:36:33 +0000 (21:36 +0000)]
bpf: fix an uninitialized variable issue

Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316519 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoARMAddressingModes.h: Don't mark header functions as file local
David Blaikie [Tue, 24 Oct 2017 21:29:21 +0000 (21:29 +0000)]
ARMAddressingModes.h: Don't mark header functions as file local

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316517 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoValueMapper.h: Don't mark header functions as file local
David Blaikie [Tue, 24 Oct 2017 21:29:21 +0000 (21:29 +0000)]
ValueMapper.h: Don't mark header functions as file local

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316516 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoTransforms/Utils/Local.h: Don't mark header functions as file local
David Blaikie [Tue, 24 Oct 2017 21:29:20 +0000 (21:29 +0000)]
Transforms/Utils/Local.h: Don't mark header functions as file local

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316515 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoTargetOpcodes.h: Don't mark header functions as file local
David Blaikie [Tue, 24 Oct 2017 21:29:19 +0000 (21:29 +0000)]
TargetOpcodes.h: Don't mark header functions as file local

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316514 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoPrintable.h: Don't mark header functions as file local
David Blaikie [Tue, 24 Oct 2017 21:29:19 +0000 (21:29 +0000)]
Printable.h: Don't mark header functions as file local

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316513 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoConvertUTF.h: Don't mark header functions as file local
David Blaikie [Tue, 24 Oct 2017 21:29:18 +0000 (21:29 +0000)]
ConvertUTF.h: Don't mark header functions as file local

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316512 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAtomicOrdering.h: Don't mark header functions as file local
David Blaikie [Tue, 24 Oct 2017 21:29:18 +0000 (21:29 +0000)]
AtomicOrdering.h: Don't mark header functions as file local

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316511 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoLaneBitmask.h: Don't mark header functions as file local
David Blaikie [Tue, 24 Oct 2017 21:29:17 +0000 (21:29 +0000)]
LaneBitmask.h: Don't mark header functions as file local

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316510 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoType.h: Don't mark header functions as file local
David Blaikie [Tue, 24 Oct 2017 21:29:16 +0000 (21:29 +0000)]
Type.h: Don't mark header functions as file local

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316509 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoHexagonDepTimingClasses.h: Don't mark header functions as file local
David Blaikie [Tue, 24 Oct 2017 21:29:16 +0000 (21:29 +0000)]
HexagonDepTimingClasses.h: Don't mark header functions as file local

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316508 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoWebassemblyAsmPrinter.h: Include WebAssemblyMachineFunctionInfo for use with MachineF...
David Blaikie [Tue, 24 Oct 2017 21:29:15 +0000 (21:29 +0000)]
WebassemblyAsmPrinter.h: Include WebAssemblyMachineFunctionInfo for use with MachineFunction::getInfo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316507 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoX86Operand.h: Include X86MCTargetDesc.h for SSE register enum/names
David Blaikie [Tue, 24 Oct 2017 21:29:15 +0000 (21:29 +0000)]
X86Operand.h: Include X86MCTargetDesc.h for SSE register enum/names

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316506 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoX86AsmPrinter.h: Add missing header for complete type needed for MCCodeEmitter dtor.
David Blaikie [Tue, 24 Oct 2017 21:29:14 +0000 (21:29 +0000)]
X86AsmPrinter.h: Add missing header for complete type needed for MCCodeEmitter dtor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316505 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRegisterUsageInfo.h: Add missing header for complete type needed for DenseMap traits
David Blaikie [Tue, 24 Oct 2017 21:29:10 +0000 (21:29 +0000)]
RegisterUsageInfo.h: Add missing header for complete type needed for DenseMap traits

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316504 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other...
Eugene Zelenko [Tue, 24 Oct 2017 21:24:53 +0000 (21:24 +0000)]
[Transforms] 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@316503 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix Wdocumentation warning. NFCI.
Simon Pilgrim [Tue, 24 Oct 2017 20:56:09 +0000 (20:56 +0000)]
Fix Wdocumentation warning. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316498 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "[CodeGen][ExpandMemcmp][NFC] Allow memcmp to expand to vector loads (1)"
Martin Bohme [Tue, 24 Oct 2017 20:40:02 +0000 (20:40 +0000)]
Revert "[CodeGen][ExpandMemcmp][NFC] Allow memcmp to expand to vector loads (1)"

This reverts commit r316417, which causes internal compiles to OOM.
I don't unfortunately have a self-contained test case but will follow up
with courbet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316497 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoUse range-based for loop. NFC
Adrian Prantl [Tue, 24 Oct 2017 20:38:00 +0000 (20:38 +0000)]
Use range-based for loop. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316496 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[NVPTX] allow address space inference for volatile loads/stores.
Artem Belevich [Tue, 24 Oct 2017 20:31:44 +0000 (20:31 +0000)]
[NVPTX] allow address space inference for volatile loads/stores.

If particular target supports volatile memory access operations, we can
avoid AS casting to generic AS. Currently it's only enabled in NVPTX for
loads and stores that access global & shared AS.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316495 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoDelete unused instantiations of DIBuilder. NFC
Adrian Prantl [Tue, 24 Oct 2017 20:26:17 +0000 (20:26 +0000)]
Delete unused instantiations of DIBuilder. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316494 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix LLVM_LINK_LLVM_DYLIB=On build of llvm-cfi-verify
Sam Clegg [Tue, 24 Oct 2017 20:21:15 +0000 (20:21 +0000)]
Fix LLVM_LINK_LLVM_DYLIB=On build of llvm-cfi-verify

Subscribers: mgorny, aheejin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316493 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][Broadwell] Added the instruction scheduling information for the Broadwell CPU.
Gadi Haber [Tue, 24 Oct 2017 20:19:47 +0000 (20:19 +0000)]
[X86][Broadwell] Added the instruction scheduling information for the Broadwell CPU.

Adding the scheduling information for the Browadwell (BDW) CPU target.

This patch adds the instruction scheduling information for the Broadwell (BDW) architecture target by adding the file X86SchedBroadwell.td located under the X86 Target.
We used the scheduling information retrieved from the Broadwell architects in order to create the file.
The scheduling information includes latency, number of micro-Ops and used ports by each BDW instruction.

The patch continues the scheduling replacement and insertion effort started with the SandyBridge (SNB) target in r310792, the Haswell (HSW) target in r311879, the SkylakeClient (SKL) target in rL313613 + rL315978 and the SkylakeServer (SKX) in rL315175.

Performance fluctuations may be expected due to code alignment effects.

Reviewers: zvi, RKSimon, craig.topper
Differential Revision: https://reviews.llvm.org/D39054

Change-Id: If6f799e5ff60e1091c8d43b05ea78c53581bae01

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316492 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-cov] Use a stable sort on sub-views
Vedant Kumar [Tue, 24 Oct 2017 20:03:37 +0000 (20:03 +0000)]
[llvm-cov] Use a stable sort on sub-views

We need to use a stable sort on instantiation and expansion sub-views to
produce consistent output. Fortunately, we've gotten lucky and the tests
have checks for the stable order.

This is needed to unblock D39245. Once that lands, we'll have better
test coverage for sort non-determinism.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316490 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoUse range-based-for. NFC
Adrian Prantl [Tue, 24 Oct 2017 19:32:59 +0000 (19:32 +0000)]
Use range-based-for. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316485 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agobpf: fix a bug in trunc-op optimization
Yonghong Song [Tue, 24 Oct 2017 18:21:10 +0000 (18:21 +0000)]
bpf: fix a bug in trunc-op optimization

Previous implementation for per-function scope
is incorrect and too conservative.

Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316481 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[globalisel][tablegen] Fix future undefined behaviour in r316463.
Daniel Sanders [Tue, 24 Oct 2017 18:11:54 +0000 (18:11 +0000)]
[globalisel][tablegen] Fix future undefined behaviour in r316463.

I missed a dereference of `Matched` that preceeded the new check. Thanks to
Justin Bogner for spotting it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316480 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMIR: Print the register class or bank in vreg defs
Justin Bogner [Tue, 24 Oct 2017 18:04:54 +0000 (18:04 +0000)]
MIR: Print the register class or bank in vreg defs

This updates the MIRPrinter to include the regclass when printing
virtual register defs, which is already valid syntax for the
parser. That is, given 64 bit %0 and %1 in a "gpr" regbank,

  %1(s64) = COPY %0(s64)

would now be written as

  %1:gpr(s64) = COPY %0(s64)

While this change alone introduces a bit of redundancy with the
registers block, it allows us to update the tests to be more concise
and understandable and brings us closer to being able to remove the
registers block completely.

Note: We generally only print the class in defs, but there is one
exception. If there are uses without any defs whatsoever, we'll print
the class on all uses. I'm not completely convinced this comes up in
meaningful machine IR, but for now the MIRParser and MachineVerifier
both accept that kind of stuff, so we don't want to have a situation
where we can print something we can't parse.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316479 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[PowerPC] Try to simplify a Swap if it feeds a Splat
Stefan Pintilie [Tue, 24 Oct 2017 17:44:27 +0000 (17:44 +0000)]
[PowerPC] Try to simplify a Swap if it feeds a Splat

If we have the situation where a Swap feeds a Splat we can sometimes change the
  index on the Splat and then remove the Swap instruction.

Fixed the test case that was failing and recommit after pulling the original
  commit.

  Original revision is here: https://reviews.llvm.org/D39009

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316478 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoBinaryFormat/MachO.h Don't mark header functions as file-scope static
David Blaikie [Tue, 24 Oct 2017 17:29:14 +0000 (17:29 +0000)]
BinaryFormat/MachO.h Don't mark header functions as file-scope static

This creates ODR violations if the function is called from another inline                                                                   function in a header and also creates binary bloat from duplicate definitions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316477 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoValueTracking.h Don't mark header functions as file-scope static
David Blaikie [Tue, 24 Oct 2017 17:29:14 +0000 (17:29 +0000)]
ValueTracking.h Don't mark header functions as file-scope static

This creates ODR violations if the function is called from another inline                                                                   function in a header and also creates binary bloat from duplicate definitions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316476 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMemoryBuiltins.h: Don't mark header functions as file-scope static
David Blaikie [Tue, 24 Oct 2017 17:29:13 +0000 (17:29 +0000)]
MemoryBuiltins.h: Don't mark header functions as file-scope static

This creates ODR violations if the function is called from another inline                                                                   function in a header and also creates binary bloat from duplicate definitions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316475 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoIndirectCallSiteVisitor.h:findIndirectCallSites Don't mark header functions as file...
David Blaikie [Tue, 24 Oct 2017 17:29:12 +0000 (17:29 +0000)]
IndirectCallSiteVisitor.h:findIndirectCallSites Don't mark header functions as file-scope static

This creates ODR violations if the function is called from another inline                                                                   function in a header and also creates binary bloat from duplicate definitions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316474 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoStringExtras.h Don't mark header functions as file-scope static
David Blaikie [Tue, 24 Oct 2017 17:29:12 +0000 (17:29 +0000)]
StringExtras.h Don't mark header functions as file-scope static

This creates ODR violations if the function is called from another inline                                                                   function in a header and also creates binary bloat from duplicate definitions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316473 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoSmallVector.h:capacity_in_bytes Don't mark header functions as file-scope static
David Blaikie [Tue, 24 Oct 2017 17:29:11 +0000 (17:29 +0000)]
SmallVector.h:capacity_in_bytes Don't mark header functions as file-scope static

This creates ODR violations if the function is called from another inline
function in a header and also creates binary bloat from duplicate definitions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316472 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoDenseMap.h:capacity_in_bytes Don't mark header functions as file-scope static
David Blaikie [Tue, 24 Oct 2017 17:29:11 +0000 (17:29 +0000)]
DenseMap.h:capacity_in_bytes Don't mark header functions as file-scope static

This creates ODR violations if the function is called from another inline
function in a header and also creates binary bloat from duplicate definitions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316471 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoBitVector.h:capacity_in_bytes Don't mark header functions as file-scope static
David Blaikie [Tue, 24 Oct 2017 17:29:08 +0000 (17:29 +0000)]
BitVector.h:capacity_in_bytes Don't mark header functions as file-scope static

This creates ODR violations if the function is called from another
inline function in a header and also creates binary bloat from duplicate
definitions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316470 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agobpf: fix a bug in bpf-isel trunc-op optimization
Yonghong Song [Tue, 24 Oct 2017 17:29:03 +0000 (17:29 +0000)]
bpf: fix a bug in bpf-isel trunc-op optimization

In BPF backend, we try to optimize away redundant
trunc operations so that kernel verifier rewrite
remains valid. Previous implementation only works
for a single function.

This patch fixed the issue for multiple functions.
It clears internal map data structure before
performing optimization for each function.

Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316469 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdded instructions for obtaining clang-tools-extra to the Getting Started page.
Aaron Ballman [Tue, 24 Oct 2017 17:28:39 +0000 (17:28 +0000)]
Added instructions for obtaining clang-tools-extra to the Getting Started page.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316468 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoDoxygenify comments.
Adrian Prantl [Tue, 24 Oct 2017 17:23:40 +0000 (17:23 +0000)]
Doxygenify comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316466 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[opt] Initialize WriteBitcode pass.
Michael Kruse [Tue, 24 Oct 2017 17:17:27 +0000 (17:17 +0000)]
[opt] Initialize WriteBitcode pass.

Probably due to a change of how some pass initializes its dependencies,
the -write-bitcode pass (Bitcode/Writer/BitcodeWriterPass.cpp) is not
initialized in opt anymore and therefore not usable with

opt -write-bitcode

Explicitly call initializeWriteBitcodePassPass() to make it available
in opt again.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316464 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[globalisel][tablegen] Multi-insn emission requires that BuildMIAction support not...
Daniel Sanders [Tue, 24 Oct 2017 17:08:43 +0000 (17:08 +0000)]
[globalisel][tablegen] Multi-insn emission requires that BuildMIAction support not being linked to an InstructionMatcher. NFC

When multi-instruction emission is supported, it will no longer be guaranteed
that every BuildMIAction has a corresponding matched instruction. BuildMIAction
should support not having one to cover the case where a rule produces more
instructions than it matched.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316463 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][AVX] ComputeNumSignBitsForTargetNode - add support for X86ISD::VTRUNC
Simon Pilgrim [Tue, 24 Oct 2017 17:04:57 +0000 (17:04 +0000)]
[X86][AVX] ComputeNumSignBitsForTargetNode - add support for X86ISD::VTRUNC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316462 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[codeview] Fix handling of S_HEAPALLOCSITE
Reid Kleckner [Tue, 24 Oct 2017 17:02:40 +0000 (17:02 +0000)]
[codeview] Fix handling of S_HEAPALLOCSITE

The type index is from the TPI stream, not the IPI stream. Fix the
dumper, fix type index discovery, and add a test in LLD.

Also improve the log message we emit when we fail to rewrite type
indices in LLD. That's how I found this bug.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316461 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SelectionDAG] Add VSELECT support to ComputeNumSignBits
Simon Pilgrim [Tue, 24 Oct 2017 16:38:38 +0000 (16:38 +0000)]
[SelectionDAG] Add VSELECT support to ComputeNumSignBits

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316457 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoPowerPC: support the separator character in the IAS
Saleem Abdulrasool [Tue, 24 Oct 2017 16:19:56 +0000 (16:19 +0000)]
PowerPC: support the separator character in the IAS

PowerPC uses ; as a comment leader and the @ as a separator character.
Support this properly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316454 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[TableGen] Fix some formatting quirks in the subtarget output file.
Craig Topper [Tue, 24 Oct 2017 15:50:55 +0000 (15:50 +0000)]
[TableGen] Fix some formatting quirks in the subtarget output file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316450 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[TableGen] Simplify some of the subtarget emission by removing code that avoids print...
Craig Topper [Tue, 24 Oct 2017 15:50:53 +0000 (15:50 +0000)]
[TableGen] Simplify some of the subtarget emission by removing code that avoids printing commas at the end of arrays and enums.

The C++ standard allows for trailing commas. We already do this in many other emitters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316449 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] truncateVectorCompareWithPACKSS - use PACKSSDW/PACKSSWB instead of just PACKSSWB.
Simon Pilgrim [Tue, 24 Oct 2017 15:38:16 +0000 (15:38 +0000)]
[X86] truncateVectorCompareWithPACKSS - use PACKSSDW/PACKSSWB instead of just PACKSSWB.

By using the widest type possible for PACKSS truncation we have a better chance of being able to peek through bitcasts and improves other combines driven by ComputeNumSignBits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316448 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[x86] add more vector ISA variants for memcmp expansion; NFC
Sanjay Patel [Tue, 24 Oct 2017 15:27:47 +0000 (15:27 +0000)]
[x86] add more vector ISA variants for memcmp expansion; NFC

...because every swiss cheese has different holes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316446 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[utils] make retq/retl regex an option that is off by default
Sanjay Patel [Tue, 24 Oct 2017 14:32:52 +0000 (14:32 +0000)]
[utils] make retq/retl regex an option that is off by default

Ideally, we should compare 32- and 64-bit versions to see if the
ret line is the only difference and then insert the regex only
in that case. But this is a quick hack to avoid a bunch of noise
as existing tests are updated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316443 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM] Tighten up CHECK lines in a test
Oliver Stannard [Tue, 24 Oct 2017 14:20:13 +0000 (14:20 +0000)]
[ARM] Tighten up CHECK lines in a test

These tests checked for the line number without a leading ":", so for example,
a missed diagnostic on line 123 could match one on line 1123, 2123, etc,
desynchronising the test for hundreds of lines.

This couldn't cause it to incorrectly pass or fail, but made it hard to track
down test failures.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316442 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM] Error for invalid shift in memory operand
Oliver Stannard [Tue, 24 Oct 2017 14:19:08 +0000 (14:19 +0000)]
[ARM] Error for invalid shift in memory operand

Report a diagnostic when we fail to parse a shift in a memory operand because
the shift type is not an identifier. Without this, we were silently ignoring
the whole instruction.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316441 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] truncateVectorCompareWithPACKSS - remove duplicate variables. NFCI.
Simon Pilgrim [Tue, 24 Oct 2017 14:18:32 +0000 (14:18 +0000)]
[X86] truncateVectorCompareWithPACKSS - remove duplicate variables. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316440 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoUpdate f16c instruction scheduling on btver2.
Andrew V. Tischenko [Tue, 24 Oct 2017 13:38:30 +0000 (13:38 +0000)]
Update f16c instruction scheduling on btver2.
Differential Revision: https://reviews.llvm.org/D39051

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316435 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoX86CallFrameOptimization: Update comments and variable names. NFCI.
Zvi Rackover [Tue, 24 Oct 2017 13:24:26 +0000 (13:24 +0000)]
X86CallFrameOptimization: Update comments and variable names. NFCI.

Following up on D38738.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316434 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoX86CallFrameOptimization: Recognize 'store 0/-1 using and/or' idioms
Zvi Rackover [Tue, 24 Oct 2017 12:13:05 +0000 (12:13 +0000)]
X86CallFrameOptimization: Recognize 'store 0/-1 using and/or' idioms

Summary:
r264440 added or/and patterns for storing -1 or 0 with the intention of decreasing code size. However,
X86CallFrameOptimization does not recognize these memory accesses so it will not replace them with push's when profitable.

This patch fixes this problem by teaching X86CallFrameOptimization these store 0/-1 idioms.

An alternative fix would be to prevent the 'store 0/1 idioms' patterns from firing when accessing the stack. This would save
the need to teach the pass about these idioms. However, because X86CallFrameOptimization does not always fire we may result
in cases where neither X86CallFrameOptimization not the patterns for 'store 0/1 idioms' fire.

Fixes pr34863

Reviewers: DavidKreitzer, guyblank, aymanmus

Reviewed By: aymanmus

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316431 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ConstantFolding] Avoid assert when folding ptrtoint of vectorized GEP
Bjorn Pettersson [Tue, 24 Oct 2017 12:08:11 +0000 (12:08 +0000)]
[ConstantFolding] Avoid assert when folding ptrtoint of vectorized GEP

Summary:
Got asserts in llvm::CastInst::getCastOpcode saying:
`DestBits == SrcBits && "Illegal cast to vector (wrong type or size)"' failed.

Problem seemed to be that llvm::ConstantFoldCastInstruction did
not handle ptrtoint cast of a getelementptr returning a vector
correctly. I assume such situations are quite rare, since the
GEP needs to be considered as a constant value (base pointer
being null).
The solution used here is to simply avoid the constant fold
of ptrtoint when the value is a vector. It is not supported,
and by bailing out we do not fail on assertions later on.

Reviewers: craig.topper, majnemer, davide, filcab, efriedma

Reviewed By: efriedma

Subscribers: efriedma, filcab, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316430 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LangRef] Update description of Constant Expressions
Bjorn Pettersson [Tue, 24 Oct 2017 11:59:20 +0000 (11:59 +0000)]
[LangRef] Update description of Constant Expressions

Summary:
When describing trunc/zext/sext/ptrtoint/inttoptr in the chapter
about Constant Expressions we now simply refer to the Instruction
Reference. As far as I know there are no difference when it comes
to the semantics and the argument constraints. The only difference
is that the syntax is slighly different for the constant expressions,
regarding the use of parenthesis in constant expressions.
Referring to the Instruction Reference is the same solution as
already used for several other operations, such as bitcast.

The main goal was to add information that vector types are allowed
also in trunc/zext/sext/ptrtoint/inttoptr constant expressions.
That was not explicitly mentioned earlier, and resulted in some
questions in the review of https://reviews.llvm.org/D38546

Reviewers: efriedma, majnemer

Reviewed By: efriedma

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316429 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-dwarfdump] - Cleanup of gnu_call_site.s. NFC.
George Rimar [Tue, 24 Oct 2017 11:44:19 +0000 (11:44 +0000)]
[llvm-dwarfdump] - Cleanup of gnu_call_site.s. NFC.

This change fixes values of test so that it passes
-verify without errors and also adds comments.
Test was introduced in D39119 and intention was to check
that tool is able to dump few
DW_*GNU_call_site* tags and attributes, so that
change is NFC cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316428 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Add new intrinsic llvm.amdgcn.kill(i1)
Marek Olsak [Tue, 24 Oct 2017 10:27:13 +0000 (10:27 +0000)]
AMDGPU: Add new intrinsic llvm.amdgcn.kill(i1)

Summary:
Kill the thread if operand 0 == false.
llvm.amdgcn.wqm.vote can be applied to the operand.

Also allow kill in all shader stages.

Reviewers: arsenm, nhaehnle

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316427 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Add llvm.amdgcn.wqm.vote intrinsic
Marek Olsak [Tue, 24 Oct 2017 10:26:59 +0000 (10:26 +0000)]
AMDGPU: Add llvm.amdgcn.wqm.vote intrinsic

Reviewers: arsenm, nhaehnle

Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316426 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[docs] Code example fix
Jan Korous [Tue, 24 Oct 2017 10:23:10 +0000 (10:23 +0000)]
[docs] Code example fix

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316425 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM] Replace development diagnostics with normal DEBUG macro
Oliver Stannard [Tue, 24 Oct 2017 09:46:56 +0000 (09:46 +0000)]
[ARM] Replace development diagnostics with normal DEBUG macro

* Remove the -arm-asm-parser-dev-diags option.
* Use normal DEBUG(dbgs()) printing for the extra development information about
  missing diagnostics.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316423 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRestore the fix rL316059 eliminated by rL316372
Serguei Katkov [Tue, 24 Oct 2017 09:42:55 +0000 (09:42 +0000)]
Restore the fix rL316059 eliminated by rL316372

rL316059 fixed the potential build failure when compiling
with -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON.

rL316372 just reverted the part of the fix, so restore it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316422 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM] tSETEND needs IsThumb
Oliver Stannard [Tue, 24 Oct 2017 09:03:33 +0000 (09:03 +0000)]
[ARM] tSETEND needs IsThumb

This is the Thumb encoding, so the Requires list must include IsThumb.

No test because we happen to select the ARM one first, but that's just luck.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316421 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM] Remove tCPS alias which just crashed
Oliver Stannard [Tue, 24 Oct 2017 08:55:36 +0000 (08:55 +0000)]
[ARM] Remove tCPS alias which just crashed

This alias caused a crash when trying to print the "cps #0" instruction in a
diagnostic for thumbv6 (which doesn't have that instruction).

The comment was incorrect, this instruction is UNPREDICTABLE if no flag bits
are set, so I don't think it's worth keeping.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316420 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoSupport formatv of TimePoint with strftime-style formats.
Sam McCall [Tue, 24 Oct 2017 08:30:19 +0000 (08:30 +0000)]
Support formatv of TimePoint with strftime-style formats.

Summary:
Support formatv of TimePoint with strftime-style formats.

Extensions for millis/micros/nanos are added.
Inital use case is HH:MM:SS.MMM timestamps in clangd logs.

Reviewers: bkramer, ilya-biryukov

Subscribers: labath, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316419 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CodeGen][ExpandMemcmp][NFC] Allow memcmp to expand to vector loads (1)
Clement Courbet [Tue, 24 Oct 2017 08:05:07 +0000 (08:05 +0000)]
[CodeGen][ExpandMemcmp][NFC] Allow memcmp to expand to vector loads (1)

Refactor ExpandMemcmp:

 - Stop duplicating the logic for computation of the sequence of loads to
   generate (thsi was done in three different places), this is now done
   only once in MemCmpExpansion::MemCmpExpansion().

 - Add a FIXME to expose a bug with the computation of the number of loads
   when not all sizes are loadable. For example, on X86-32 + SSE, possible
   loads are {16,4,2,1} bytes. The current code considers that all loads
   starting at MaxLoadSize are possible. This is not an issue right now as
   vector loads are not enabled, so I'm not fixing the issue here to keep
   the change as small as possible. I'm going to address this in a
   subsequent revision, where I enable vector loads.

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316417 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoX86: Fix X86CallFrameOptimization to search for the COPY StackPointer
Zvi Rackover [Tue, 24 Oct 2017 07:38:29 +0000 (07:38 +0000)]
X86: Fix X86CallFrameOptimization to search for the COPY StackPointer

SelectionDAG inserts a copy of ESP into a virtual register.
X86CallFrameOptimization assumed that the COPY, if present, is always
right after the call-frame setup instruction (ADJCALLSTACKDOWN). This was a
wrong assumption as the COPY can be located anywhere between the call-frame setup
instruction and its first use. If the COPY happened to be located in a different
location than what X86CallFrameOptimization assumed, visiting it while
processing the call chain would lead to a conservative bail-out.

The fix is quite straightfoward, scan ahead for the stack-pointer copy and make note
of it so it can be ignored while processing the call chain.

Fixes pr34903

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316416 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Modules] Add module for Config/llvm-config.h
Bruno Cardoso Lopes [Tue, 24 Oct 2017 06:18:52 +0000 (06:18 +0000)]
[Modules] Add module for Config/llvm-config.h

Besides all the goodness from modularizing a header, this is necessary
to compile ToT with modules with the clang host compiler from Xcode 9 in
macOS 10.13, which our bots don't use yet.

rdar://problem/35038151

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316414 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MC] Adding code padding for performance stability - infrastructure. NFC.
Omer Paparo Bivas [Tue, 24 Oct 2017 06:16:03 +0000 (06:16 +0000)]
[MC] Adding code padding for performance stability - infrastructure. NFC.

Infrastructure designed for padding code with nop instructions in key places such that preformance improvement will be achieved.
The infrastructure is implemented such that the padding is done in the Assembler after the layout is done and all IPs and alignments are known.
This patch by itself in a NFC. Future patches will make use of this infrastructure to implement required policies for code padding.

Reviewers:
aaboud
zvi
craig.topper
gadi.haber

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

Change-Id: I92110d0c0a757080a8405636914a93ef6f8ad00e

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316413 91177308-0d34-0410-b5e6-96231b3b80d8