143267 Commits

Author SHA1 Message Date
David Blaikie
28fbf6cb4a Fix some -Wsign-compare warnings by making some integer literals explicitly unsigned
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291776 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 17:44:32 +00:00
Chad Rosier
4afed5d5d2 TTI: Add comment clarifying the meaning of MemIntrinsicInfo::PtrVal.
Patch by Tom Stellard.
Differential Revision: https://reviews.llvm.org/D27563

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291772 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 16:15:10 +00:00
Daniel Sanders
819f312880 [globalisel] Move as much RegisterBank initialization to the constructor as possible
Summary:
The register bank is now entirely initialized in the constructor. However,
we still have the hardcoded number of register classes which will be
dealt with in the TableGen patch (D27338) since we do not have access
to this information to resolve this at this stage. The number of register
classes is known to the TRI and to TableGen but the RegisterBank
constructor is too early for the former and too late for the latter.
This will be fixed when the data is tablegen-erated.

Reviewers: t.p.northover, ab, rovka, qcolombet

Subscribers: aditya_nandakumar, kristof.beyls, vkalintiris, llvm-commits, dberris

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291770 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 16:11:23 +00:00
Amjad Aboud
8c4ff10896 [DebugInfo] Added DI macro creation API to DIBuilder.
Differential Revision: https://reviews.llvm.org/D16077

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291769 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 15:49:46 +00:00
Daniel Sanders
6e712a22a6 [globalisel] Initialize RegisterBanks with static data.
Summary:
Refactor the RegisterBank initialization to use static data. This requires
GlobalISel implementations to rewrite calls to createRegisterBank() and
addRegBankCoverage() into a call to setRegBankData().

Out of tree targets can use diff 4 of D27807
(https://reviews.llvm.org/D27807?id=84117) to have addRegBankCoverage() dump
the register classes and other data that needs to be provided to
setRegBankData(). This is the method that was used to generate the static data
in this patch.

Tablegen-eration of this static data will follow after some refactoring.

Reviewers: t.p.northover, ab, rovka, qcolombet

Subscribers: aditya_nandakumar, kristof.beyls, vkalintiris, llvm-commits, dberris

Differential Revision: https://reviews.llvm.org/D27807
Differential Revision: https://reviews.llvm.org/D27808



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291768 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 15:32:10 +00:00
Piotr Padlewski
4e1eef1855 [Devirtualization] MemDep returns non-local !invariant.group dependencies
Summary:
Memory Dependence Analysis was limited to return only local dependencies
for invariant.group handling. Now it returns NonLocal when it finds it
and then by asking getNonLocalPointerDependency we get found dep.

Thanks to this we are able to devirtualize loops!

    void indirect(A &a, int n) {
      for (int i = 0 ; i < n; i++)
        a.foo();

    }
    void test(int n) {
      A a;
      indirect(a);
    }

After inlining a.foo() will be changed to direct call, even if foo and A::A()
is external (but only if vtable definition is be available).

Reviewers: nlewycky, dberlin, chandlerc, rsmith

Subscribers: mehdi_amini, davide, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291762 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 11:33:58 +00:00
Simon Pilgrim
dfe0691ff4 Wdocumentation fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291761 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 11:21:56 +00:00
Simon Pilgrim
e821446fbc Fix windows buildbots building llvm-xray
2 issues:
1 - replaced unix-style pid_t with cross-platform llvm::sys::ProcessInfo::ProcessId 
2 - fixed shadow variable warning in lambda expression

Reviewed by @filcab

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291760 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 11:13:51 +00:00
Dean Michael Berris
182166ec7e [XRay] Include <numeric> for std::accumulate.
Fix-up following D24377.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291750 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 07:43:54 +00:00
Dean Michael Berris
c4416a6dc0 [XRay] Implement the llvm-xray account subcommand
Summary:
This is the third of a multi-part change to implement subcommands for
the `llvm-xray` tool.

Here we define the `account` subcommand which does simple function call
accounting, generating basic statistics on function calls we find in an
XRay log/trace. We support text output and csv output for this
subcommand.

This change also supports sorting, summing, and filtering the top N
results.

Part of this tool will later be turned into a library that could be used
for basic function call accounting.

Depends on D24376.

Reviewers: dblaikie, echristo

Subscribers: mehdi_amini, dberris, beanz, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291749 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 07:38:13 +00:00
Matt Arsenault
3517370c4d AMDGPU: Fix sub_oneuse being marked commutative
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291748 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 07:17:28 +00:00
Craig Topper
4a4c1fcaaa [AVX-512] Improve lowering of zero_extend of v4i1 to v4i32 and v2i1 to v2i64 with VLX, but no DQ or BW support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291747 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 06:49:12 +00:00
Craig Topper
49cfd1ffd8 [AVX-512] Improve lowering of sign_extend of v4i1 to v4i32 and v2i1 to v2i64 when avx512vl is available, but not avx512dq.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291746 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 06:49:08 +00:00
Elad Cohen
f160ecc799 [X86][AVX512] Fix PR31515 - Do not flip vselect condition if it's not a vXi1 mask
r289653 added a case where `vselect <cond> <vector1> <all-zeros>`
is transformed to:
`vselect xor(cond, DAG.getConstant(1, DL, CondVT) <all-zeros> <vector1>`
This was not aimed to catch cases where Cond is not a vXi1
mask but it does. Moreover, when Cond type is VxiN (N > 1)
then xor(cond, DAG.getConstant(1, DL, CondVT) != NOT(cond).
This patch changes the above to xor with allones, and avoids
entering the case for non-mask Conds.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291745 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 06:49:03 +00:00
Craig Topper
ea5c0e9cfe [AVX-512] Add more varied avx512 feature command lines to the avx512-cvt.ll test to show some poor codegen examples.
We're definitely doing bad things when avx512vl is enabled without avx512dq. It looks like avx512vl/dq without avx512bw may also have some issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291744 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 06:49:03 +00:00
Chandler Carruth
5bd1c1d8c0 Make a test actually test what it set out to test.
This test seems to have largely been relying on asserts being tripped.
It had a very specific and somewhat uninteresting grep of the output,
but it never really did anything to cause SCEV to be preserved across
loop simplify, certainly not explicitly. And a later addition to it
actually added CHECK lines despite the test never running FileCheck.

Now we actually print SCEV before and after loop simplify to make sure
it is *changing* and being *updated*. Which seems to be much more likely
the point of the test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291740 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 03:49:07 +00:00
Matt Arsenault
94bf68d551 AMDGPU: Fold fneg into fma or fmad
Patch mostly by Fiona Glaser

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291733 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 00:32:16 +00:00
Matt Arsenault
ef33822be5 AMDGPU: Fold fneg into fmul
Patch mostly by Fiona Glaser

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291732 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 00:23:20 +00:00
Matt Arsenault
bcf34bbbdd AMDGPU: Fold fneg into fadd
Patch mostly by Fiona Glaser

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291731 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 00:09:34 +00:00
Matt Arsenault
8694e2f853 AMDGPU: Pull fneg/fabs out of a select
Allows better source modifier usage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291729 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 23:57:38 +00:00
Davide Italiano
c082fcc6ff [NewGVN] Fixup store count for the initial congruency class.
It was always zero. When we move a store from `initial` to its
own congruency class, we end up with a negative store count, which
is obviously wrong.
Also, while here, change StoreCount to be signed so that the assertions
actually fire.

Ack'ed by Daniel Berlin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291725 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 23:41:24 +00:00
Zachary Turner
4509ae413a [CodeView] Finish decoupling TypeDatabase from TypeDumper.
Previously the type dumper itself was passed around to a lot of different
places and manipulated in ways that were more appropriate on the type
database. For example, the entire TypeDumper was passed into the symbol
dumper, when all the symbol dumper wanted to do was lookup the name of a
TypeIndex so it could print it. That's what the TypeDatabase is for --
mapping type indices to names.

Another example is how if the user runs llvm-pdbdump with the option to
dump symbols but not types, we still have to visit all types so that we
can print minimal information about the type of a symbol, but just without
dumping full symbol records. The way we did this before is by hacking it
up so that we run everything through the type dumper with a null printer,
so that the output goes to /dev/null. But really, we don't need to dump
anything, all we want to do is build the type database. Since
TypeDatabaseVisitor now exists independently of TypeDumper, we can do
this. We just build a custom visitor callback pipeline that includes a
database visitor but not a dumper.

All the hackery around printers etc goes away. After this patch, we could
probably even delete the entire CVTypeDumper class since really all it is
at this point is a thin wrapper that hides the details of how to build a
useful visitation pipeline. It's not a priority though, so CVTypeDumper
remains for now.

After this patch we will be able to easily plug in a different style of
type dumper by only implementing the proper visitation methods to dump
one-line output and then sticking it on the pipeline.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291724 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 23:24:22 +00:00
Peter Collingbourne
7371eca308 X86: Remove dead code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291721 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 23:00:28 +00:00
Matt Arsenault
f1e95d3604 AMDGPU: Fix shrinking of addc/subb.
To shrink to VOP2 the input carry must also be VCC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291720 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 22:58:12 +00:00
Rui Ueyama
bdb13d2c7c Add -Wl,-color-diagnostics if a linker supports the option.
Differential Revision: https://reviews.llvm.org/D28046

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291719 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 22:55:35 +00:00
Matt Arsenault
fac51240d9 AMDGPU: Fix sext_inreg for i1 in i16
This produces worse code when i16 is legal, mostly
due to combines getting confused by conversions inserted
for uniform 16-bit operations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291717 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 22:35:22 +00:00
Matt Arsenault
8c7e9845cf AMDGPU: Fix breaking VOP3 v_add_i32s
This was shrinking the instruction even though the carry output
register was a virtual register, not known VCC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291716 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 22:35:17 +00:00
Kuba Mracek
cfd8739946 [asan] Set alignment of __asan_global_* globals to sizeof(GlobalStruct)
When using profiling and ASan together (-fprofile-instr-generate -fcoverage-mapping -fsanitize=address), at least on Darwin, the section of globals that ASan emits (__asan_globals) is misaligned and starts at an odd offset. This really doesn't have anything to do with profiling, but it triggers the issue because profiling emits a string section, which can have arbitrary size.  This patch changes the alignment to sizeof(GlobalStruct).

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291715 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 22:26:10 +00:00
Rui Ueyama
8181d203b2 Use EXPECT_EQ instead of ASSERT_EQ in a unit test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291713 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 22:02:51 +00:00
Davide Italiano
c38c1351bc Revert "[NewGVN] Strengthen a couple of assertions."
It's breaking some bots. Will investigate and recommit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291712 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 22:00:29 +00:00
Matt Arsenault
c6b1aed80d AMDGPU: Fix folding immediates into mac src2
Whether it is legal or not needs to check for the instruction
it will be replaced with.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291711 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 22:00:02 +00:00
Davide Italiano
4214b4143a [NewGVN] Parenthesise assertion condition (-Wparenthesis).
Format an assertion message while I'm here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291710 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 21:58:42 +00:00
Davide Italiano
459fcccb97 [NewGVN] Strengthen a couple of assertions.
StoreCount >= 0 on `unsigned` is always true, otherwise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291709 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 21:49:00 +00:00
Michael Kuperstein
5c32548237 Add test that verifies we don't peel loops in optsize functions. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291708 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 21:42:51 +00:00
Peter Collingbourne
799d7f0370 LowerTypeTests: Represent the memory region size with the constant size-1.
This means that we can use a shorter instruction sequence in the case where
the size is a power of two and on the boundary between two representations.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291706 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 21:32:10 +00:00
Eli Friedman
1404fc08fc [SCEV] Make howFarToZero max backedge-taken count check for precondition.
Refines max backedge-taken count if a loop like
"for (int i = 0; i != n; ++i) { /* body */ }" is rotated.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291704 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 21:07:15 +00:00
Eli Friedman
08108a29e3 [SCEV] Make howFarToZero use a simpler formula for max backedge-taken count.
This is both easier to understand, and produces a tighter bound in certain
cases.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291701 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 20:55:48 +00:00
Peter Collingbourne
1d8008b2d3 Re-apply r291205, "LowerTypeTests: Split the pass in two: a resolution phase and a lowering phase.", with a fix for an off-by-one error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291699 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 20:28:46 +00:00
Daniel Berlin
42f1f6e771 NewGVN: Fix PR31594, by tracking the store count of congruence
classes, and updating checking to allow for equivalence through
reachability.

(Sadly, the checking here is not perfect, and can't be made perfect,
so we'll have to disable it after we are satisfied with correctness.
Right now it is just "very unlikely" to happen.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291698 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 20:22:36 +00:00
Daniel Berlin
06963901ef NewGVN: Refactor performCongruenceFinding and split out congruence class moving
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291697 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 20:22:05 +00:00
Rong Xu
6d80fe73c6 Resubmit "[PGO] Turn off comdat renaming in IR PGO by default"
This patch resubmits the changes in r291588.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291696 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 20:19:41 +00:00
Kyle Butt
0aa7497cd7 Revert "CodeGen: Allow small copyable blocks to "break" the CFG."
This reverts commit ada6595a526d71df04988eb0a4b4fe84df398ded.

This needs a simple probability check because there are some cases where it is
not profitable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291695 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 19:55:19 +00:00
David Blaikie
ae69f7de68 Make some operator bools explicit for sanity/safety.
There are a couple left in bool-like containers (BitVector, etc) where
the implicit conversions seem more suitable - though it might be worth
considering explicitifying those too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291694 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 19:47:16 +00:00
Eli Friedman
1f1e5c29c3 [ARM] More aggressive matching for vpadd and vpaddl.
The new matchers work after legalization to make them simpler, and to avoid
blocking other optimizations.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291693 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 19:33:38 +00:00
Michael Kuperstein
8672808b6b [SLP] Remove bogus assert.
The removed assert seems bogus - it's perfectly legal for the roots of the
vectorized subtrees to be equal even if the original scalar values aren't,
if the original scalars happen to be equivalent.

This fixes PR31599.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291692 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 19:23:57 +00:00
Davide Italiano
83229eeee3 [lib/Object] Unbreak build with -Werror (unused variable). NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291691 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 19:05:27 +00:00
Simon Pilgrim
9056d415cb [X86][XOP] Add vpermil2ps target shuffle -> insertps combine test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291690 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 18:48:00 +00:00
Greg Clayton
a9a480efd1 Remove all variants of DWARFDie::getAttributeValueAs...() that had parameters that specified default values.
Now we only support returning Optional<> values and have changed all clients over to use Optional::getValueOr().

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291686 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 17:43:37 +00:00
Tim Northover
8ae3333f34 GlobalISel: only print debug info with -debug. NFC.
Turns out DEBUG(...) has uses even inside NDEBUG checks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291685 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 17:33:37 +00:00
Ivan Krasin
52a39de25f Revert rL291205 because it breaks Chrome tests under CFI.
Summary:
Revert LowerTypeTests: Split the pass in two: a resolution phase and a lowering phase.

This change separates how type identifiers are resolved from how intrinsic
calls are lowered. All information required to lower an intrinsic call
is stored in a new TypeIdLowering data structure. The idea is that this
data structure can either be initialized using the module itself during
regular LTO, or using the module summary in ThinLTO backends.

Original URL: https://reviews.llvm.org/D28341

Reviewers: pcc

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291684 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 16:54:04 +00:00