]> granicus.if.org Git - llvm/log
llvm
7 years ago[X86] Use X86ISD::VBROADCAST in place of v2f64 X86ISD::MOVDDUP when AVX2 is available
Craig Topper [Fri, 13 Oct 2017 21:56:48 +0000 (21:56 +0000)]
[X86] Use X86ISD::VBROADCAST in place of v2f64 X86ISD::MOVDDUP when AVX2 is available

This is particularly important for AVX512VL where we are better able to recognize the VBROADCAST loads to fold with other operations.

For AVX512VL we now use X86ISD::VBROADCAST for all of the patterns and remove the 128-bit X86ISD::VMOVDDUP.

We may be able to use this for AVX1 as well which would allow us to remove more isel patterns.

I also had to add X86ISD::VBROADCAST as a node to call combineShuffle for so that we treat it similar to X86ISD::MOVDDUP.

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

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

7 years ago[X86] Use fsub in the movddup scheduling tests to prevent a future patch from folding...
Craig Topper [Fri, 13 Oct 2017 21:56:45 +0000 (21:56 +0000)]
[X86] Use fsub in the movddup scheduling tests to prevent a future patch from folding movddup as a broadcast load.

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

7 years ago[globalisel][tablegen] Fix a use-after free bug that manifests on non-macOS machines.
Daniel Sanders [Fri, 13 Oct 2017 21:51:20 +0000 (21:51 +0000)]
[globalisel][tablegen] Fix a use-after free bug that manifests on non-macOS machines.

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

7 years ago[Hexagon] Rangify some loops, NFC
Krzysztof Parzyszek [Fri, 13 Oct 2017 21:43:00 +0000 (21:43 +0000)]
[Hexagon] Rangify some loops, NFC

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

7 years ago[InstCombine] use m_Neg() to reduce code; NFCI
Sanjay Patel [Fri, 13 Oct 2017 21:28:50 +0000 (21:28 +0000)]
[InstCombine] use m_Neg() to reduce code; NFCI

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

7 years ago[globalisel][tablegen] Add support for fpimm and import of APInt/APFloat based ImmLeaf.
Daniel Sanders [Fri, 13 Oct 2017 21:28:03 +0000 (21:28 +0000)]
[globalisel][tablegen] Add support for fpimm and import of APInt/APFloat based ImmLeaf.

Summary:
There's only a tablegen testcase for IntImmLeaf and not a CodeGen one
because the relevant rules are rejected for other reasons at the moment.
On AArch64, it's because there's an SDNodeXForm attached to the operand.
On X86, it's because the rule either emits multiple instructions or has
another predicate using PatFrag which cannot easily be supported at the
same time.

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

Reviewed By: qcolombet

Subscribers: aemerson, javed.absar, igorb, llvm-commits, kristof.beyls

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

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

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

7 years ago[RegisterBankInfo] Cache the getMinimalPhysRegClass information
Quentin Colombet [Fri, 13 Oct 2017 21:16:15 +0000 (21:16 +0000)]
[RegisterBankInfo] Cache the getMinimalPhysRegClass information

TargetRegisterInfo::getMinimalPhysRegClass is actually pretty expensive
because it has to iterate over all the register classes.
Cache this information as we need and get it so that we limit its usage.
Right now, we heavily rely on it, because this is how we get the mapping
for vregs defined by copies from physreg (i.e., the one that are ABI
related).

Improve compile time by up to 10% for that pass.

NFC

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

7 years ago[Legalizer] Use SmallSetVector instead of SetVector.
Quentin Colombet [Fri, 13 Oct 2017 21:16:14 +0000 (21:16 +0000)]
[Legalizer] Use SmallSetVector instead of SetVector.

NFC

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

7 years ago[LegalizerInfo] Don't evaluate end boundary every time through the loop
Quentin Colombet [Fri, 13 Oct 2017 21:16:13 +0000 (21:16 +0000)]
[LegalizerInfo] Don't evaluate end boundary every time through the loop

Match the LLVM coding standard for loop conditions.

NFC.

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

7 years ago[Legalizer] Only allocate the SetVectors once per function.
Quentin Colombet [Fri, 13 Oct 2017 21:16:05 +0000 (21:16 +0000)]
[Legalizer] Only allocate the SetVectors once per function.

Prior to this patch we used to create SetVectors in temporaries that
were created and destroyed for each instruction. Now, instead we create
and destroyed them only once, but clear the content for each
instruction.
This speeds up the pass by ~25%.

NFC.

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

7 years agoAMDGPU: Implement hasBitPreservingFPLogic
Matt Arsenault [Fri, 13 Oct 2017 21:10:22 +0000 (21:10 +0000)]
AMDGPU: Implement hasBitPreservingFPLogic

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

7 years agoLowerTypeTests: Give imported symbols a type with size 0 so that they are not assumed...
Peter Collingbourne [Fri, 13 Oct 2017 21:02:16 +0000 (21:02 +0000)]
LowerTypeTests: Give imported symbols a type with size 0 so that they are not assumed not to alias.

It is possible for both a base and a derived class to be satisfied
with a unique vtable. If a program contains casts of the same pointer
to both of those types, the CFI checks will be lowered to this
(with ThinLTO):

if (p != &__typeid_base_global_addr)
  trap();
if (p != &__typeid_derived_global_addr)
  trap();

The optimizer may then use the first condition combined
with the assumption that __typeid_base_global_addr and
__typeid_derived_global_addr may not alias to optimize away the second
comparison, resulting in an unconditional trap.

This patch fixes the bug by giving imported globals the type [0 x i8]*,
which prevents the optimizer from assuming that they do not alias.

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

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

7 years ago[Reassociate] auto-generate better checks; NFC
Sanjay Patel [Fri, 13 Oct 2017 20:56:35 +0000 (20:56 +0000)]
[Reassociate] auto-generate better checks; NFC

These would fail if the created variable names changed.

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

7 years ago[Hexagon] Avoid unused variable warnings in release builds.
Benjamin Kramer [Fri, 13 Oct 2017 20:46:14 +0000 (20:46 +0000)]
[Hexagon] Avoid unused variable warnings in release builds.

No functionality change intended.

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

7 years agoAMDGPU: Look for src mods before fp_extend
Matt Arsenault [Fri, 13 Oct 2017 20:45:49 +0000 (20:45 +0000)]
AMDGPU: Look for src mods before fp_extend

When selecting modifiers for mad_mix instructions,
look at fneg/fabs that occur before the conversion.

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

7 years ago[aarch64] Support APInt and APFloat in ImmLeaf subclasses and make AArch64 use them.
Daniel Sanders [Fri, 13 Oct 2017 20:42:18 +0000 (20:42 +0000)]
[aarch64] Support APInt and APFloat in ImmLeaf subclasses and make AArch64 use them.

Summary:
The purpose of this patch is to expose more information about ImmLeaf-like
PatLeaf's so that GlobalISel can learn to import them. Previously, ImmLeaf
could only be used to test int64_t's produced by sign-extending an APInt.
Other tests on immediates had to use the generic PatLeaf and extract the
constant using C++.

With this patch, tablegen will know how to generate predicates for APInt,
and APFloat. This will allow it to 'do the right thing' for both SelectionDAG
and GlobalISel which require different methods of extracting the immediate
from the IR.

This is NFC for SelectionDAG since the new code is equivalent to the
previous code. It's also NFC for FastISel because FastIselShouldIgnore is 1
for the ImmLeaf subclasses. Enabling FastIselShouldIgnore == 0 for these new
subclasses will require a significant re-factor of FastISel.

For GlobalISel, it's currently NFC because the relevant code to import the
affected rules is not yet present. This will be added in a later patch.

Depends on D36086

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

Reviewed By: qcolombet

Subscribers: bjope, aemerson, rengolin, javed.absar, igorb, llvm-commits, kristof.beyls

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

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

7 years ago[SmallPtrSet] Add iterator epoch tracking.
Benjamin Kramer [Fri, 13 Oct 2017 20:37:52 +0000 (20:37 +0000)]
[SmallPtrSet] Add iterator epoch tracking.

This will detect invalid iterators when ABI breaking checks are enabled.

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

7 years ago[InstCombine] move code to remove repeated constant check; NFCI
Sanjay Patel [Fri, 13 Oct 2017 20:29:11 +0000 (20:29 +0000)]
[InstCombine] move code to remove repeated constant check; NFCI

Also, consolidate tests for this fold in one place.

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

7 years agoAMDGPU: Implement isFPExtFoldable
Matt Arsenault [Fri, 13 Oct 2017 20:18:59 +0000 (20:18 +0000)]
AMDGPU: Implement isFPExtFoldable

This helps match v_mad_mix* in some cases.

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

7 years ago[InstCombine] recycle adds for better efficiency
Sanjay Patel [Fri, 13 Oct 2017 20:12:21 +0000 (20:12 +0000)]
[InstCombine] recycle adds for better efficiency

Also, clean up unnecessary matcher capture variable initializations.

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

7 years agoDAG: Add opcode and source type to isFPExtFree
Matt Arsenault [Fri, 13 Oct 2017 19:55:45 +0000 (19:55 +0000)]
DAG: Add opcode and source type to isFPExtFree

This is only currently used for mad/fma transforms.
This is the only case where it should be used for AMDGPU,
so add an opcode to be sure.

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

7 years ago[Hexagon] Minimize number of repeated constant extenders
Krzysztof Parzyszek [Fri, 13 Oct 2017 19:02:59 +0000 (19:02 +0000)]
[Hexagon] Minimize number of repeated constant extenders

Each constant extender requires an extra instruction, which adds to the
code size and also reduces the number of available slots in an instruction
packet. In most cases, the value of a repeated constant extender could be
loaded into a register, and the instructions using the extender could be
replaced with their counterparts that use that register instead.

This patch adds a pass that tries to reduce the number of constant
extenders, including extenders which differ only in an immediate offset
known at compile time, e.g. @global and @global+12.

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

7 years agoRevert r315148 [TableGen] Avoid unnecessary std::string creations
Daniel Sanders [Fri, 13 Oct 2017 19:00:01 +0000 (19:00 +0000)]
Revert r315148 [TableGen] Avoid unnecessary std::string creations

I'm about to commit a patch that makes them necessary for getPredCode() and
it would be strange for getPredCode() and getImmCode() to require different
usage.

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

7 years ago[InstCombine] use local var to reduce code duplication; NFCI
Sanjay Patel [Fri, 13 Oct 2017 18:32:53 +0000 (18:32 +0000)]
[InstCombine] use local var to reduce code duplication; NFCI

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

7 years ago[LLVMCore] fix description for OverflowingBinaryOperator; NFC
Sanjay Patel [Fri, 13 Oct 2017 18:25:23 +0000 (18:25 +0000)]
[LLVMCore] fix description for OverflowingBinaryOperator; NFC

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

7 years ago[X86] Add initial skeleton support for knm cpu
Craig Topper [Fri, 13 Oct 2017 18:10:17 +0000 (18:10 +0000)]
[X86] Add initial skeleton support for knm cpu

This adds Intel's Knights Mill CPU to valid CPU names for the backend. For now its an alias of "knl", but ultimately we need to support AVX5124FMAPS and AVX5124VNNIW instruction sets for it.

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

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

7 years ago[IPSCCP] Move common functions to ValueLatticeUtils (NFC)
Matthew Simpson [Fri, 13 Oct 2017 17:53:44 +0000 (17:53 +0000)]
[IPSCCP] Move common functions to ValueLatticeUtils (NFC)

This patch moves some common utility functions out of IPSCCP and makes them
available globally. The functions determine if interprocedural data-flow
analyses can propagate information through function returns, arguments, and
global variables.

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

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

7 years ago[InstCombine] add hasOneUse check to add-zext-add fold to prevent increasing instructions
Sanjay Patel [Fri, 13 Oct 2017 17:47:25 +0000 (17:47 +0000)]
[InstCombine] add hasOneUse check to add-zext-add fold to prevent increasing instructions

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

7 years ago[InstCombine] add tests for add (zext (add nuw X, C2)), C --> zext (add nuw X, C2...
Sanjay Patel [Fri, 13 Oct 2017 17:42:12 +0000 (17:42 +0000)]
[InstCombine] add tests for add (zext (add nuw X, C2)), C --> zext (add nuw X, C2 + C); NFC

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

7 years ago[llvm-demangle-fuzzer] Add a fuzz target for ItaniumDemangler.
Matt Morehouse [Fri, 13 Oct 2017 17:35:37 +0000 (17:35 +0000)]
[llvm-demangle-fuzzer] Add a fuzz target for ItaniumDemangler.

Patch By: hctim

Reviewers: morehouse, bogner

Reviewed By: bogner

Subscribers: bogner, kcc, llvm-commits, mgorny

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

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

7 years ago[llvm-cov] Reland sources-specified.test with addition of "-path-equivalence".
Max Moroz [Fri, 13 Oct 2017 17:27:39 +0000 (17:27 +0000)]
[llvm-cov] Reland sources-specified.test with addition of "-path-equivalence".

Summary: This version of tests should be working properly.

Reviewers: vsk

Reviewed By: vsk

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

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

7 years ago[SCEV] Maintain and use a loop->loop invalidation dependency
Sanjoy Das [Fri, 13 Oct 2017 17:13:44 +0000 (17:13 +0000)]
[SCEV] Maintain and use a loop->loop invalidation dependency

Summary:
This change uses the loop use list added in the previous change to remember the
loops that appear in the trip count expressions of other loops; and uses it in
forgetLoop.  This lets us not scan every loop in the function on a forgetLoop
call.

With this change we no longer invalidate clear out backedge taken counts on
forgetValue.  I think this is fine -- the contract is that SCEV users must call
forgetLoop(L) if their change to the IR could have changed the trip count of L;
solely calling forgetValue on a value feeding into the backedge condition of L
is not enough.  Moreover, I don't think we can strengthen forgetValue to be
sufficient for invalidating trip counts without significantly re-architecting
SCEV.  For instance, if we have the loop:

  I = *Ptr;
  E = I + 10;
  do {
    // ...
  } while (++I != E);

then the backedge taken count of the loop is 9, and it has no reference to
either I or E, i.e. there is no way in SCEV today to re-discover the dependency
of the loop's trip count on E or I.  So a SCEV client cannot change E to (say)
"I + 20", call forgetValue(E) and expect the loop's trip count to be updated.

Reviewers: atrick, sunfish, mkazantsev

Subscribers: mcrosier, llvm-commits

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

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

7 years ago[X86] Test scalar integer absolutes on 32-bit targets with/without CMOV
Simon Pilgrim [Fri, 13 Oct 2017 17:09:20 +0000 (17:09 +0000)]
[X86] Test scalar integer absolutes on 32-bit targets with/without CMOV

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

7 years agoNot all buildbots seem to dump the nuw flag in SDAG
Reid Kleckner [Fri, 13 Oct 2017 17:00:49 +0000 (17:00 +0000)]
Not all buildbots seem to dump the nuw flag in SDAG

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

7 years ago[InstCombine] use AddOne helper to reduce code; NFC
Sanjay Patel [Fri, 13 Oct 2017 17:00:47 +0000 (17:00 +0000)]
[InstCombine] use AddOne helper to reduce code; NFC

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

7 years ago[X86] Updated scalar integer absolute tests to cover i8/i16/i32/i64
Simon Pilgrim [Fri, 13 Oct 2017 16:53:07 +0000 (16:53 +0000)]
[X86] Updated scalar integer absolute tests to cover i8/i16/i32/i64

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

7 years ago[InstCombine] rearrange code to remove repeated constant check; NFCI
Sanjay Patel [Fri, 13 Oct 2017 16:43:58 +0000 (16:43 +0000)]
[InstCombine] rearrange code to remove repeated constant check; NFCI

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

7 years ago[InstCombine] allow zext(bool) + C --> select bool, C+1, C for vector types
Sanjay Patel [Fri, 13 Oct 2017 16:29:38 +0000 (16:29 +0000)]
[InstCombine] allow zext(bool) + C --> select bool, C+1, C for vector types

The backend should be prepared for this transform after:
https://reviews.llvm.org/rL311731

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

7 years ago[TableGen] : Simplify RegisterInfoEmitter
Javed Absar [Fri, 13 Oct 2017 16:27:57 +0000 (16:27 +0000)]
[TableGen] : Simplify RegisterInfoEmitter

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

7 years agoUpdate test to expect nuw flag in SDAG dump, fixes test after r315690
Reid Kleckner [Fri, 13 Oct 2017 16:13:23 +0000 (16:13 +0000)]
Update test to expect nuw flag in SDAG dump, fixes test after r315690

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

7 years agolit.py: Add new %{shared_output(LABEL)} substitution
Jordan Rose [Fri, 13 Oct 2017 16:12:23 +0000 (16:12 +0000)]
lit.py: Add new %{shared_output(LABEL)} substitution

This refers to a temporary path that can be shared across all tests,
identified by a particular label. This can be used for things like
caches.

At the moment, the character set for the LABEL is limited to C
identifier characters, plus '-', '+', '=', and '.'. This is the same
set of characters currently allowed in REQUIRES clause identifiers.

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

7 years ago[X86] Fix some inconsistent formatting in the processor feature lists.
Craig Topper [Fri, 13 Oct 2017 16:06:06 +0000 (16:06 +0000)]
[X86] Fix some inconsistent formatting in the processor feature lists.

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

7 years ago[X86] Add ProcIntelBDW to BroadwellProc class not BDWFeatures class.
Craig Topper [Fri, 13 Oct 2017 16:04:08 +0000 (16:04 +0000)]
[X86] Add ProcIntelBDW to BroadwellProc class not BDWFeatures class.

This isn't a property we want inherited.

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

7 years ago[RS4GC] Look through vector bitcasts when looking for base pointer
Daniel Neilson [Fri, 13 Oct 2017 15:59:13 +0000 (15:59 +0000)]
[RS4GC] Look through vector bitcasts when looking for base pointer

Summary:
 In RS4GC it is possible that a base pointer is contained in a vector that
has undergone a bitcast from one element-pointertype to another. We teach
RS4GC how to look through bitcasts of vector types when looking for a base
pointer.

Reviewers: anna

Reviewed By: anna

Subscribers: llvm-commits

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

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

7 years ago[llvm-cov] Temporary delete sources-specified.test, it is failing on some bots.
Max Moroz [Fri, 13 Oct 2017 15:58:58 +0000 (15:58 +0000)]
[llvm-cov] Temporary delete sources-specified.test, it is failing on some bots.

Summary: http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/5950/steps/test-stage1-compiler/logs/stdio

Reviewers: vsk, Dor1s

Reviewed By: Dor1s

Subscribers: mehdi_amini

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

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

7 years ago[Hexagon] Add patterns for cmpb/cmph with immediate arguments
Krzysztof Parzyszek [Fri, 13 Oct 2017 15:43:12 +0000 (15:43 +0000)]
[Hexagon] Add patterns for cmpb/cmph with immediate arguments

Patch by Sumanth Gundapaneni.

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

7 years ago[llvm-cov] Fix sources-specified.test so it ignores the order of files printed.
Max Moroz [Fri, 13 Oct 2017 15:41:51 +0000 (15:41 +0000)]
[llvm-cov] Fix sources-specified.test so it ignores the order of files printed.

Summary: https://reviews.llvm.org/D38884#896964

Reviewers: vsk, Dor1s

Reviewed By: Dor1s

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

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

7 years agoDAG: Add flags to dumps
Matt Arsenault [Fri, 13 Oct 2017 15:41:40 +0000 (15:41 +0000)]
DAG: Add flags to dumps

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

7 years ago[llvm-cov] An attempt to fix sources_specified.test failing on some buildbots.
Max Moroz [Fri, 13 Oct 2017 15:30:24 +0000 (15:30 +0000)]
[llvm-cov] An attempt to fix sources_specified.test failing on some buildbots.

Summary: https://reviews.llvm.org/rL315685#115380

Reviewers: vsk, Dor1s

Reviewed By: Dor1s

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

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

7 years ago[X86] Stop creating CMOV nodes with a second MVT::Glue result
Craig Topper [Fri, 13 Oct 2017 15:28:35 +0000 (15:28 +0000)]
[X86] Stop creating CMOV nodes with a second MVT::Glue result

Summary: We seem to inconsistently create CMOV nodes some with a Glue result and some without. But I can't find any cases that use the Glue result. So I've tried to remove all the place that did this.

Reviewers: RKSimon, spatel, zvi

Reviewed By: RKSimon

Subscribers: llvm-commits

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

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

7 years ago[llvm-cov] Generate "report" for given source paths if sources are specified.
Max Moroz [Fri, 13 Oct 2017 14:44:51 +0000 (14:44 +0000)]
[llvm-cov] Generate "report" for given source paths if sources are specified.

Summary:
Documentation says that user can specify sources for both "show" and
"report" commands. "Show" command respects specified sources, but "report" does
not. It is useful to have both "show" and "report" generated for specified
sources. Also added tests to for both commands with sources specified.

Reviewers: vsk, kcc

Reviewed By: vsk

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

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

7 years agoRe-land "[dsymutil] Timestmap verification for __swift_ast"
Jonas Devlieghere [Fri, 13 Oct 2017 14:41:23 +0000 (14:41 +0000)]
Re-land "[dsymutil] Timestmap verification for __swift_ast"

This patch adds timestamp verification for swiftmodule files. A new flag
is provided to allows us to disable this check in order to allow testing
of this feature.

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

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

7 years ago[SCEV] Teach SCEV to find maxBECount when loop endbound is variant
Anna Thomas [Fri, 13 Oct 2017 14:30:43 +0000 (14:30 +0000)]
[SCEV] Teach SCEV to find maxBECount when loop endbound is variant

Summary:
This patch teaches SCEV to calculate the maxBECount when the end bound
of the loop can vary. Note that we cannot calculate the exactBECount.

This will only be done when both conditions are satisfied:
1. the loop termination condition is strictly LT.
2. the IV is proven to not overflow.

This provides more information to users of SCEV and can be used to
improve identification of finite loops.

Reviewers: sanjoy, mkazantsev, silviu.baranga, atrick

Reviewed by: mkazantsev

Subscribers: llvm-commits

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

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

7 years ago[InstCombine] add tests for boolean extend + add; NFC
Sanjay Patel [Fri, 13 Oct 2017 14:09:45 +0000 (14:09 +0000)]
[InstCombine] add tests for boolean extend + add; NFC

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

7 years agoRevert r314923: "Recommit : Use the basic cost if a GEP is not used as addressing...
Daniel Jasper [Fri, 13 Oct 2017 14:04:21 +0000 (14:04 +0000)]
Revert r314923: "Recommit : Use the basic cost if a GEP is not used as addressing mode"

Significantly reduces performancei (~30%) of gipfeli
(https://github.com/google/gipfeli)

I have not yet managed to reproduce this regression with the open-source
version of the benchmark on github, but will work with others to get a
reproducer to you later today.

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

7 years ago[FileCheck] regexp doc update/fix
Sjoerd Meijer [Fri, 13 Oct 2017 14:02:36 +0000 (14:02 +0000)]
[FileCheck] regexp doc update/fix

Minor doc update that the FileCheck matcher supports POSIX ERE.
It also fixes a minor issue in the regexp describing a variable
name: underscores are allowed too.

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

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

7 years agoDisable gcov instrumentation of functions using funclet-based exception handling
Marco Castelluccio [Fri, 13 Oct 2017 13:49:15 +0000 (13:49 +0000)]
Disable gcov instrumentation of functions using funclet-based exception handling

Summary: This patch fixes the crash from https://bugs.llvm.org/show_bug.cgi?id=34659 and https://bugs.llvm.org/show_bug.cgi?id=34833.

Reviewers: rnk, majnemer

Reviewed By: rnk, majnemer

Subscribers: majnemer, llvm-commits

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

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

7 years agodocs: Improve wording on building for fuzzing
Justin Bogner [Fri, 13 Oct 2017 06:29:09 +0000 (06:29 +0000)]
docs: Improve wording on building for fuzzing

The original sentence didn't really make sense.

Patch by Vedant Kumar. Thanks!

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

7 years ago[X86] Remove patterns that select unmasked vbroadcastf2x32/vbroadcasti2x32. Prefer...
Craig Topper [Fri, 13 Oct 2017 06:07:10 +0000 (06:07 +0000)]
[X86] Remove patterns that select unmasked vbroadcastf2x32/vbroadcasti2x32. Prefer vbroadcastsd/vpbroadcastq instead.

There's no advantage to using these instructions when they aren't masked. This enables some additional execution domain switching without needing to update the table.

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

7 years ago[SCEV] Maintain loop use lists, and use them in forgetLoop
Sanjoy Das [Fri, 13 Oct 2017 05:50:52 +0000 (05:50 +0000)]
[SCEV] Maintain loop use lists, and use them in forgetLoop

Summary:
Currently we do not correctly invalidate memoized results for add recurrences
that were created directly (i.e. they were not created from a `Value`).  This
change fixes this by keeping loop use lists and using the loop use lists to
determine which SCEV expressions to invalidate.

Here are some statistics on the number of uses of in the use lists of all loops
on a clang bootstrap (config: release, no asserts):

     Count: 731310
       Min: 1
      Mean: 8.555150
50th %time: 4
95th %tile: 25
99th %tile: 53
       Max: 433

Reviewers: atrick, sunfish, mkazantsev

Subscribers: mcrosier, llvm-commits

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

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

7 years ago[SelectionDAG] Cleanup the SIGN_EXTEND_INREG handling in computeKnownBits. NFCI
Craig Topper [Fri, 13 Oct 2017 05:35:35 +0000 (05:35 +0000)]
[SelectionDAG] Cleanup the SIGN_EXTEND_INREG handling in computeKnownBits. NFCI

Use less temporary APInts. Use bit counting more. Don't call getScalarSizeInBits so many places, just capture it once.

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

7 years ago[SelectionDAG] Fix typo in comment. NFC
Craig Topper [Fri, 13 Oct 2017 05:35:34 +0000 (05:35 +0000)]
[SelectionDAG] Fix typo in comment. NFC

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

7 years agodocs: Improve the docs about llvm-isel-fuzzer on OSS Fuzz
Justin Bogner [Fri, 13 Oct 2017 00:27:35 +0000 (00:27 +0000)]
docs: Improve the docs about llvm-isel-fuzzer on OSS Fuzz

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

7 years ago[X86] Add the test case for r315613 that I forgot to 'git add'.
Craig Topper [Fri, 13 Oct 2017 00:20:47 +0000 (00:20 +0000)]
[X86] Add the test case for r315613 that I forgot to 'git add'.

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

7 years ago[SelectionDAG] Correct the early out in SelectionDAG::getZeroExtendInReg to work...
Craig Topper [Fri, 13 Oct 2017 00:18:58 +0000 (00:18 +0000)]
[SelectionDAG] Correct the early out in SelectionDAG::getZeroExtendInReg to work properly for vector types.

I don't know if we ever hit this case or not. Turning it into an assert only fired on expanding some atomic operation in a SystemZ lit test.

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

7 years ago[llvm-isel-fuzzer] Use "--" as separator rather than '='.
Matt Morehouse [Fri, 13 Oct 2017 00:18:32 +0000 (00:18 +0000)]
[llvm-isel-fuzzer] Use "--" as separator rather than '='.

Summary: OSS-Fuzz doesn't support '=' in filenames.

Reviewers: bogner, kcc

Reviewed By: kcc

Subscribers: javed.absar, hiraditya, llvm-commits

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

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

7 years agollvm-isel-fuzzer: Use the right REQUIRES line for r315599
Justin Bogner [Fri, 13 Oct 2017 00:17:54 +0000 (00:17 +0000)]
llvm-isel-fuzzer: Use the right REQUIRES line for r315599

I'd mixed up ENABLE_SHARED and BUILD_SHARED_LIBS before, so these
tests were being disabled in too many places.

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

7 years agoRemoving default case statement from covered switch.
Keith Wyss [Fri, 13 Oct 2017 00:06:35 +0000 (00:06 +0000)]
Removing default case statement from covered switch.

Previous patch did not count on the llvm command line parser to restrict the
inputs, but it is safe to do so.

Fix forward for patch with details:
-- https://reviews.llvm.org/D38650 and
-- https://llvm.org/svn/llvm-project/llvm/trunk@315635 91177308-0d34-0410-b5e6-96231b3b80d8

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

7 years agoAdd DK_Remark to SMDiagnostic
Adam Nemet [Thu, 12 Oct 2017 23:56:02 +0000 (23:56 +0000)]
Add DK_Remark to SMDiagnostic

Swift uses SMDiagnostic for diagnostic messages. For
https://github.com/apple/swift/pull/12294, we need remark support.

I picked the color that clang uses to display them.

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

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

7 years ago[SelectionDAG] Const-correct the DemandedMask argument to one of the overloads of...
Craig Topper [Thu, 12 Oct 2017 23:46:05 +0000 (23:46 +0000)]
[SelectionDAG] Const-correct the DemandedMask argument to one of the overloads of SimplifyDemandedBits. NFC

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

7 years ago[Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other...
Eugene Zelenko [Thu, 12 Oct 2017 23:30:03 +0000 (23:30 +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@315640 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "TargetMachine: Merge TargetMachine and LLVMTargetMachine"
Matthias Braun [Thu, 12 Oct 2017 22:57:28 +0000 (22:57 +0000)]
Revert "TargetMachine: Merge TargetMachine and LLVMTargetMachine"

Reverting to investigate layering effects of MCJIT not linking
libCodeGen but using TargetMachine::getNameWithPrefix() breaking the
lldb bots.

This reverts commit r315633.

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

7 years agoDeprecate DwarfUnit::addBlockByrefAddress().
Adrian Prantl [Thu, 12 Oct 2017 22:54:36 +0000 (22:54 +0000)]
Deprecate DwarfUnit::addBlockByrefAddress().

The clang frontend already creates a DIExpression that replicates the
logic in addBlockByrefAddress() exactly, thus making this function
effectively unreachable. To guard against human error I'm hereby
marking the function with an assertion and let it hit the bots before
eventually removing it.

rdar://problem/31629055

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

7 years ago[XRay][tools] Updated stacks tool with flamegraph output.
Keith Wyss [Thu, 12 Oct 2017 22:47:42 +0000 (22:47 +0000)]
[XRay][tools] Updated stacks tool with flamegraph output.

Summary:
As the first step to allow analysis and visualization of xray collected data,
allow using the llvm-xray stacks tool to emit a complete listing of stacks in
the format consumable by a flamegraph tool.

Possible follow up formats include chrome trace viewer format and sql load
files.

As a POC, I'm able to generate flamegraphs of an xray instrumented llc compiling
hello world.

Reviewers: dberris, pelikan

Subscribers: llvm-commits

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

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

7 years ago[CVP] Process binary operations even when def is local
Anna Thomas [Thu, 12 Oct 2017 22:39:52 +0000 (22:39 +0000)]
[CVP] Process binary operations even when def is local

Summary:
This patch adds processing of binary operations when the def of operands are in
the same block (i.e. local processing).

Earlier we bailed out in such cases (the bail out was introduced in rL252032)
because LVI at that time was more precise about context at the end of basic
blocks, which implied local def and use analysis didn't benefit CVP.

Since then we've added support for LVI in presence of assumes and guards. The
test cases added show how local def processing in CVP helps adding more
information to the ashr, sdiv, srem and add operators.

Note: processCmp which suffers from the same problem will
be handled in a later patch.

Reviewers: philip, apilipenko, SjoerdMeijer, hfinkel

Subscribers: llvm-commits

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

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

7 years agoTargetMachine: Merge TargetMachine and LLVMTargetMachine
Matthias Braun [Thu, 12 Oct 2017 22:28:54 +0000 (22:28 +0000)]
TargetMachine: Merge TargetMachine and LLVMTargetMachine

Merge LLVMTargetMachine into TargetMachine.

- There is no in-tree target anymore that just implements TargetMachine
  but not LLVMTargetMachine.
- It should still be possible to stub out all the various functions in
  case a target does not want to use lib/CodeGen
- This simplifies the code and avoids methods ending up in the wrong
  interface.

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

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

7 years ago[cmake] Allow building fuzzers with OSS-Fuzz flags.
Matt Morehouse [Thu, 12 Oct 2017 21:58:41 +0000 (21:58 +0000)]
[cmake] Allow building fuzzers with OSS-Fuzz flags.

Reviewers: kcc, bogner

Reviewed By: bogner

Subscribers: mgorny, llvm-commits

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

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

7 years ago[SelectionDAG] Simplify the ISD::SIGN_EXTEND/ZERO_EXTEND handling to use less tempora...
Craig Topper [Thu, 12 Oct 2017 21:58:25 +0000 (21:58 +0000)]
[SelectionDAG] Simplify the ISD::SIGN_EXTEND/ZERO_EXTEND handling to use less temporary APInts by counting bits instead. NFCI

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

7 years ago[lit] Raise the logic for enabling clang & lld substitutions to llvm.
Zachary Turner [Thu, 12 Oct 2017 21:56:05 +0000 (21:56 +0000)]
[lit] Raise the logic for enabling clang & lld substitutions to llvm.

This paves the way for other projects which might /use/ clang or
lld but not necessarily need to the full set of functionality
available to clang and lld tests to be able to have a basic set
of substitutions that allow a project to run the clang or lld
executables.

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

7 years ago[LoopPredication] Check whether the loop is already guarded by the first iteration...
Artur Pilipenko [Thu, 12 Oct 2017 21:21:17 +0000 (21:21 +0000)]
[LoopPredication] Check whether the loop is already guarded by the first iteration check condition

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

7 years ago[DWARF] Fix bad comparator in sortGlobalExprs.
Eli Friedman [Thu, 12 Oct 2017 20:54:08 +0000 (20:54 +0000)]
[DWARF] Fix bad comparator in sortGlobalExprs.

The comparator passed to std::sort must provide a strict weak ordering;
otherwise, the behavior is undefined.

Fixes an assertion failure generating debug info for globals
split by GlobalOpt. I have a testcase, but not sure how to reduce it,
so not included here.  (Someone else came up with a testcase, but I
can't reproduce the crash with it, presumably because my version of LLVM
ends up sorting the array differently.)

This isn't really a complete fix (see the FIXME in the patch), but at
least it doesn't have undefined behavior.

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

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

7 years agoRevert "Reintroduce "[SCCP] Propagate integer range info for parameters in IPSCCP.""
Bruno Cardoso Lopes [Thu, 12 Oct 2017 20:52:34 +0000 (20:52 +0000)]
Revert "Reintroduce "[SCCP] Propagate integer range info for parameters in IPSCCP.""

This reverts commit r315593: still affect two bots:

http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/5308
http://green.lab.llvm.org/green/job/clang-stage2-configure-Rlto/21751/

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

7 years ago[LoopPredication] Support ule, sle latch predicates
Artur Pilipenko [Thu, 12 Oct 2017 20:40:27 +0000 (20:40 +0000)]
[LoopPredication] Support ule, sle latch predicates

This is a follow up for the loop predication change 313981 to support ule, sle latch predicates.

Reviewed By: mkazantsev

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

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

7 years ago[X86] Add CLWB intrinsic. llvm part
Craig Topper [Thu, 12 Oct 2017 20:08:31 +0000 (20:08 +0000)]
[X86] Add CLWB intrinsic. llvm part

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

7 years agoImplement custom lowering for ISD::CTTZ_ZERO_UNDEF and ISD::CTTZ.
Wei Ding [Thu, 12 Oct 2017 19:37:14 +0000 (19:37 +0000)]
Implement custom lowering for ISD::CTTZ_ZERO_UNDEF and ISD::CTTZ.

Differential Revision: http://reviews.llvm.org/D37348

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

7 years agoAMDGPU/NFC: Move AMDGPU specific note types to ELF.h
Konstantin Zhuravlyov [Thu, 12 Oct 2017 18:59:54 +0000 (18:59 +0000)]
AMDGPU/NFC: Move AMDGPU specific note types to ELF.h

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

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

7 years ago[X86] Add a bunch of -mcpu strings to the cpus.ll test.
Craig Topper [Thu, 12 Oct 2017 18:55:57 +0000 (18:55 +0000)]
[X86] Add a bunch of -mcpu strings to the cpus.ll test.

We were missing most of the "core" aliases as well as skylake, cannonlake, and knights landing.

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

7 years ago[NVPTX] Implemented wmma intrinsics and instructions.
Artem Belevich [Thu, 12 Oct 2017 18:27:55 +0000 (18:27 +0000)]
[NVPTX] Implemented wmma intrinsics and instructions.

WMMA = "Warp Level Matrix Multiply-Accumulate".
These are the new instructions introduced in PTX6.0 and available
on sm_70 GPUs.

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

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

7 years ago[codeview] Don't emit FPO data in funclet prologues
Reid Kleckner [Thu, 12 Oct 2017 18:20:35 +0000 (18:20 +0000)]
[codeview] Don't emit FPO data in funclet prologues

Attempt 3 to work around bugs in FPO data with funclets.

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

7 years agollvm-isel-fuzzer: Work around BUILD_SHARED_LIBS testing issues
Justin Bogner [Thu, 12 Oct 2017 18:10:22 +0000 (18:10 +0000)]
llvm-isel-fuzzer: Work around BUILD_SHARED_LIBS testing issues

Building with BUILD_SHARED_LIBS makes it tricky to copy around
executables at will, since they won't be able to find the LLVM
libraries any more. This makes testing a feature that's based on the
executable name problematic, so we'll just disable these two tests in
that configuration.

We could potentially fix this by symlinking the lib directory into the
test directory, but that wouldn't work on windows, and losing testing
on windows would be far worse than losing testing on a configuration
that's barely even supported.

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

7 years ago[TableGen] Allow intrinsics to have up to 8 return values.
Artem Belevich [Thu, 12 Oct 2017 17:40:00 +0000 (17:40 +0000)]
[TableGen] Allow intrinsics to have up to 8 return values.

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

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

7 years agoWork around lack of Wine support for SetFileInformationByHandle harder
Hans Wennborg [Thu, 12 Oct 2017 17:38:22 +0000 (17:38 +0000)]
Work around lack of Wine support for SetFileInformationByHandle harder

In r315079 I added a check for the ERROR_CALL_NOT_IMPLEMENTED error
code, but it turns out earlier versions of Wine just returned false
without setting any error code.

This patch handles the unset error code case.

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

7 years agoAMDGPU: Fix warnings introduced in r315526
Konstantin Zhuravlyov [Thu, 12 Oct 2017 17:34:05 +0000 (17:34 +0000)]
AMDGPU: Fix warnings introduced in r315526

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

7 years ago[ValueTracking] return zero when there's conflict in known bits of a shift (PR34838)
Sanjay Patel [Thu, 12 Oct 2017 17:31:46 +0000 (17:31 +0000)]
[ValueTracking] return zero when there's conflict in known bits of a shift (PR34838)

Poison allows us to return a better result than undef.

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

7 years agoReintroduce "[SCCP] Propagate integer range info for parameters in IPSCCP."
Bruno Cardoso Lopes [Thu, 12 Oct 2017 16:54:11 +0000 (16:54 +0000)]
Reintroduce "[SCCP] Propagate integer range info for parameters in IPSCCP."

This is r315288 & r315294, which were reverted due to stage2 bot
failures.

Summary:
This updates the SCCP solver to use of the ValueElement lattice for
parameters, which provides integer range information. The range
information is used to remove unneeded icmp instructions.

For the following function, f() can be optimized to `ret i32 2` with
this change

  source_filename = "sccp.c"
  target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
  target triple = "x86_64-unknown-linux-gnu"

  ; Function Attrs: norecurse nounwind readnone uwtable
  define i32 @main() local_unnamed_addr #0 {
  entry:
    %call = tail call fastcc i32 @f(i32 1)
    %call1 = tail call fastcc i32 @f(i32 47)
    %add3 = add nsw i32 %call, %call1
    ret i32 %add3
  }

  ; Function Attrs: noinline norecurse nounwind readnone uwtable
  define internal fastcc i32 @f(i32 %x) unnamed_addr #1 {
  entry:
    %c1 = icmp sle i32 %x, 100

    %cmp = icmp sgt i32 %x, 300
    %. = select i1 %cmp, i32 1, i32 2
    ret i32 %.
  }

  attributes #1 = { noinline }

Reviewers: davide, sanjoy, efriedma, dberlin

Reviewed By: davide, dberlin

Subscribers: mcrosier, gberry, mssimpso, dberlin, llvm-commits

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

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

7 years ago[PowerPC] Add profitablilty check for conversion to mtctr loops
Lei Huang [Thu, 12 Oct 2017 16:43:33 +0000 (16:43 +0000)]
[PowerPC] Add profitablilty check for conversion to mtctr loops

Add profitability checks for modifying counted loops to use the mtctr instruction.

The latency of mtctr is only justified if there are more than 4 comparisons that
will be removed as a result.  Usually counted loops are formed relatively early
and before unrolling, so most low trip count loops often don't survive.  However
we want to ensure that if they do, we do not mistakenly update them to mtctr loops.

Use CodeMetrics to ensure we are only doing this for small loops with small trip counts.

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

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

7 years ago[AMDGPU] For amdpal, widen interpolation mode workaround
Tim Renouf [Thu, 12 Oct 2017 16:16:41 +0000 (16:16 +0000)]
[AMDGPU] For amdpal, widen interpolation mode workaround

Summary:
The interpolation mode workaround ensures that at least one
interpolation mode is enabled in PSInputAddr. It does not also check
PSInputEna on the basis that the user might enable bits in that
depending on run-time state.

However, for amdpal os type, the user does not enable some bits after
compilation based on run-time states; the register values being
generated here are the final ones set in the hardware. Therefore, apply
the workaround to PSInputAddr and PSInputEnable together. (The case
where a bit is set in PSInputAddr but not in PSInputEnable is where the
frontend set up an input arg for a particular interpolation mode, but
nothing uses that input arg. Really we should have an earlier pass that
removes such an arg.)

Reviewers: arsenm, nhaehnle, dstuttard

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

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

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

7 years ago[dump] Remove NDEBUG from test to enable dump methods [NFC]
Don Hinton [Thu, 12 Oct 2017 16:16:06 +0000 (16:16 +0000)]
[dump] Remove NDEBUG from test to enable dump methods [NFC]

Summary:
Add LLVM_FORCE_ENABLE_DUMP cmake option, and use it along with
LLVM_ENABLE_ASSERTIONS to set LLVM_ENABLE_DUMP.

Remove NDEBUG and only use LLVM_ENABLE_DUMP to enable dump methods.

Move definition of LLVM_ENABLE_DUMP from config.h to llvm-config.h so
it'll be picked up by public headers.

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

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

7 years ago[x86] replace isEqualTo with == for efficiency
Sanjay Patel [Thu, 12 Oct 2017 16:15:38 +0000 (16:15 +0000)]
[x86] replace isEqualTo with == for efficiency

This is a follow-up suggested in D37534.
Patch by Yulia Koval.

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