Commit Graph

275754 Commits

Author SHA1 Message Date
Alex Bradbury cfa6291bb1 [RISCV] Codegen support for memory operations
This required the implementation of RISCVTargetInstrInfo::copyPhysReg. Support
for lowering global addresses follow in the next patch.

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

llvm-svn: 317685
2017-11-08 12:20:01 +00:00
Alex Bradbury 0f0e1b54f0 [RISCV] Codegen support for materializing constants
Differential Revision: https://reviews.llvm.org/D39101

llvm-svn: 317684
2017-11-08 12:02:22 +00:00
Pavel Labath d9f6f5f44d Xfail TestConcurrentTwoWatchpointsOneSignal on arm
r317561 exposed an interesting bug (pr35228) in handling of simultaneous
watchpoint hits. Disabling the test until we can get that fixed.

llvm-svn: 317683
2017-11-08 11:51:49 +00:00
Ivan A. Kosarev d60a3cc395 [Analysis] Fix merging TBAA tags with different final access types
There are cases when we have to merge TBAA access tags with the
same base access type, but different final access types. For
example, accesses to different members of the same structure may
be vectorized into a single load or store instruction. Since we
currently assume that the tags to merge always share the same
final access type, we incorrectly return a tag that describes an
access to one of the original final access types as the generic
tag. This patch fixes that by producing generic tags for the
common type and not the final access types of the original tags.

Resolves:
PR35225: Wrong tbaa metadata after load store vectorizer due to
recent change
https://bugs.llvm.org/show_bug.cgi?id=35225

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

llvm-svn: 317682
2017-11-08 11:42:21 +00:00
Simon Dardis 789f7ca265 [mips] Guard indirect and tailcall pseudo instructions correctly.
Previously these pseudo instructions were not guarded by ISA, so their
select was dependant on the ordering of the entries in the DAG matcher.

Reviewers: atanasyan

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

llvm-svn: 317681
2017-11-08 11:13:44 +00:00
Nuno Lopes 17921d9e21 BasicAA: fix bug where we would return partialalias instead of noalias
My fix is conservative and will make us return may-alias instead.

The test case is:
check(gep(x, 0), n, gep(x, n), -1)  with  n == sizeof(x)

Here, the first value accesses the whole object, but the second access
doesn't access anything. The semantics of -1 is read until the end of the
object, which in this case means read nothing.

No test case, since isn't trivial to exploit this one, but I've proved it correct.

llvm-svn: 317680
2017-11-08 10:59:00 +00:00
Pavel Labath d2aab749d1 Log: delimit thread name in log message
The thread name was not followed by a space, which meant it was glued to
the log message. I also align the name as we do that with other log
fields. I align it to 16 chars instead of llvm::max_thread_name(), as
that can be 64 on darwin, which is rather long. If anybody feels
differently about that, we can change it.

llvm-svn: 317679
2017-11-08 10:48:54 +00:00
Pavel Labath 042c752691 Make TestTopLevelExprs more robust in face of linker GC
Summary:
This test was failing in various configurations on linux in a fairly
unpredictible way. The success depended on whether the c++ abi library
was linked in statically or not and how well was the linker able to
strip parts of it. This introduces additional code to the "dummmy" test
executable, which ensures that all parts of the library needed to
evaluate the expressions are always present.

Reviewers: clayborg

Subscribers: srhines, tatyana-krasnukha, davide, lldb-commits

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

llvm-svn: 317678
2017-11-08 10:48:50 +00:00
Ilya Biryukov b5da91c875 Avoid printing some redundant name qualifiers in completion
Summary:
Adjusted PrintingPolicy inside code completion to avoid printing some
redundant name qualifiers.

Before this change, typedefs that were written unqualified in source
code were printed with qualifiers in completion. For example, in the
following code

    struct foo {
        typedef int type;
        type method();
    };

completion item for `method` had return type of `foo::type`, even
though the original code used `type` without qualifiers.
After this change, the completion item has return type `type`, as
originally written in the source code.

Note that this change does not suppress qualifiers written by the
user. For example, in the following code

    typedef int type;
    struct foo {
        typedef int type;
        ::type method(foo::type);
    };

completion item for `method` has return type of `::type` and
parameter type of `foo::type`, as originally written in the source
code.

Reviewers: arphaman, bkramer, klimek

Reviewed By: arphaman

Subscribers: mgorny, eraman, cfe-commits

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

llvm-svn: 317677
2017-11-08 10:39:09 +00:00
Ilya Biryukov cc3cf58cd2 Moved QualTypeNames.h from Tooling to AST.
Summary:
For code reuse in SemaCodeComplete.
Note that the tests for QualTypeNames are still in Tooling as they use
Tooling's common testing code.

Reviewers: rsmith, saugustine, rnk, klimek, bkramer

Reviewed By: rnk

Subscribers: cfe-commits, mgorny

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

llvm-svn: 317676
2017-11-08 10:39:03 +00:00
Raphael Isemann c197fe1782 Fixed link to bugzilla in the sidebar
llvm-svn: 317675
2017-11-08 10:10:31 +00:00
Alex Bradbury cc988415fe [NFCI] Ensure TargetOpcode::* are compatible with guessInstructionProperties=0
rL162640 introduced CodeGenTarget::guessInstructionProperties. If a target 
sets guessInstructionProperties=0 in its FooInstrInfo, tablegen will error if 
it has to guess properties from patterns. Unfortunately, 
guessInstructionProperties=0 can't be used with current upstream LLVM as 
instructions in the TargetOpcode namespace are always included and sometimes 
have inferred properties for mayLoad, mayStore, and hasSideEffects. This patch 
provides the simplest possible fix to this problem, setting default values for 
these fields in the TargetOpcode scope. There is no intended functional 
change, as the explicitly set properties should match what was previously 
inferred. A number of the instructions had hasSideEffects=1 inferred 
unintentionally. This patch makes it explicit, while future patches (such as 
D37097) correct the property.

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

llvm-svn: 317674
2017-11-08 09:26:06 +00:00
Sam McCall 28ef7d662f [clangd] loosen tests for flag-dependence revealed by r317670
llvm-svn: 317673
2017-11-08 09:15:01 +00:00
Haojian Wu 200458f342 [clang-refactor] Introduce a new rename rule for qualified symbols
Summary: Prototype of a new rename rule for renaming qualified symbol.

Reviewers: arphaman, ioeric, sammccall

Reviewed By: arphaman, sammccall

Subscribers: jklaehn, cfe-commits, klimek

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

llvm-svn: 317672
2017-11-08 08:56:56 +00:00
Matt Arsenault f6ee94c1c6 DAG: Add computeKnownBitsForFrameIndex
Some of the AMDGPU stack addressing modes require knowing the sign
bit is zero. We used to accomplish this by custom lowering
frame indexes, and then putting an AssertZext around a
TargetFrameIndex. This required specifically looking for
the AssextZext + frame index pattern which was moderately
disgusting. The same could probably be accomplished
with a target specific node, but would still
require special handling of frame indexes.

llvm-svn: 317671
2017-11-08 08:52:31 +00:00
Sam McCall c78ccbdefb [clangd] Sort completion results.
Summary:
This is (probably) not required by LSP, but at least one buggy client wants it.
It also simplifies some tests - changed a few completion tests to use -pretty.

Reviewers: hokein, malaperle

Subscribers: ilya-biryukov, cfe-commits

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

llvm-svn: 317670
2017-11-08 07:44:12 +00:00
Martin Storsjo bfe2fed2c4 [COFF] Add support for IMAGE_REL_ARM64_SECREL
I never ran into this until lld-link started enabling debug output
by default for the mingw mode. I haven't been able to verify that
this actually behaves correctly, but this relocation is handled
identically on all other architectures so far.

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

llvm-svn: 317669
2017-11-08 07:31:50 +00:00
Sylvestre Ledru a8c5460c8a Always use prctl(PR_SET_PTRACER)
Summary:
Sufficiently old Linux kernel headers don't provide the PR_SET_PTRACER, but we can still call prctl with it if the runtime kernel is newer. Even if it's not, prctl will only return EINVAL.

Patch by Mike Hommey <mh-llvm@glandium.org>

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: sylvestre.ledru, cfe-commits, kubamracek

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

llvm-svn: 317668
2017-11-08 07:25:19 +00:00
Serguei Katkov 3664aa8658 Revert "[CGP] Enable extending scope of optimizeMemoryInst"
Revert the patch r317665 causing buildbot failures.

llvm-svn: 317667
2017-11-08 05:38:54 +00:00
Serguei Katkov ee892325bf [CGP] Enable extending scope of optimizeMemoryInst
This patch enables the folding of address computation in
memory instruction in case adress is represented by Phi node.

The inputs of Phi node might be different in base register.

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

llvm-svn: 317665
2017-11-08 05:02:51 +00:00
Craig Topper 23a302256a [X86] Add masked vcvtps2ph builtins to CheckX86BuiltinFunctionCall.
This ensures that only immediates that fit in 8-bits are used. This matches what we do for the unmasked versions.

llvm-svn: 317664
2017-11-08 04:54:26 +00:00
Rui Ueyama 1e8813c6b4 Remove a given file even if openFileForRead fails.
I think the constract of this function is to remove a file in some way,
whether in background or in foreground. This patch makes sure that it
removes a given file.

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

llvm-svn: 317663
2017-11-08 04:22:40 +00:00
Craig Topper 65e6d0b758 [X86] Add patterns to fold EVEX store with EVEX encoded vcvtps2ph instructions. Remove bad pattern that had vf432 vcvtps2ph storing 128-bits.
llvm-svn: 317662
2017-11-08 04:00:31 +00:00
Craig Topper b832ee68b4 [X86] Allow legacy vcvtps2ph intrinsics to select EVEX encoded instructions. Rely on EVEX->VEX to convert back.
Missed store folding opportunities will be fixed in a subsequent commit.

llvm-svn: 317661
2017-11-08 04:00:30 +00:00
Rafael Espindola 5f903f3848 Update for llvm change.
llvm-svn: 317657
2017-11-08 01:50:34 +00:00
Rafael Espindola 0d7a38a81d Convert FileOutputBuffer::commit to Error.
llvm-svn: 317656
2017-11-08 01:50:29 +00:00
Reid Kleckner f7fdac4508 Revert "[scudo] Make getNumberOfCPUs Fuchsia compliant"
This reverts commit r317604.

Android doesn't have cpu_set_t.

llvm-svn: 317655
2017-11-08 01:33:15 +00:00
Dave Lee 48db01b980 Revert "Reapply: Allow yaml2obj to order implicit sections for ELF"
This reverts commit r317646.

llvm-svn: 317654
2017-11-08 01:31:20 +00:00
Rafael Espindola 81ca0df8f4 Update unittest too.
llvm-svn: 317651
2017-11-08 01:10:05 +00:00
Rafael Espindola f7a57294d7 Update for llvm change.
llvm-svn: 317650
2017-11-08 01:05:52 +00:00
Rafael Espindola e0df357dbd Convert FileOutputBuffer to Expected. NFC.
llvm-svn: 317649
2017-11-08 01:05:44 +00:00
Eugene Zelenko b8c9e2aae5 [Serialization] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 317648
2017-11-08 01:03:16 +00:00
David Blaikie 3f833edc7c Target/TargetInstrInfo.h -> CodeGen/TargetInstrInfo.h to match layering
This header includes CodeGen headers, and is not, itself, included by
any Target headers, so move it into CodeGen to match the layering of its
implementation.

llvm-svn: 317647
2017-11-08 01:01:31 +00:00
Dave Lee 7db10de5e6 Reapply: Allow yaml2obj to order implicit sections for ELF
Summary:
This change allows yaml input to control the order of implicitly added sections
(`.symtab`, `.strtab`, `.shstrtab`). The order is controlled by adding a
placeholder section of the given name to the Sections field.

This change is to support changes in D39582, where it is desirable to control
the location of the `.dynsym` section.

This reapplied version fixes:
  1. use of a function call within an assert
  2. failing lld test which has an unnamed section

Additionally, one more test to cover the unnamed section failure.

Reviewers: compnerd, jakehehrlich

Reviewed By: jakehehrlich

Subscribers: llvm-commits

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

llvm-svn: 317646
2017-11-08 00:58:50 +00:00
Matt Arsenault 4709ab9124 AMDGPU: Set correct sched model on v_mad_u64_u32
llvm-svn: 317645
2017-11-08 00:48:25 +00:00
Eugene Zelenko 0d00c89995 [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 317644
2017-11-08 00:39:18 +00:00
Douglas Yung 76036fce25 Fix compile issue on MSVC.
llvm-svn: 317642
2017-11-08 00:29:42 +00:00
Mitch Phillips 0222224da6 Revert rL317618
The implemented pass fails and is breaking a large number of unit tests.
Example:
http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/5777/steps/build-stage3-compiler/logs/stdio

This reverts commit rL317618

llvm-svn: 317641
2017-11-08 00:20:53 +00:00
Evgeniy Stepanov 98fe207986 [sanitizer] Asm implementation of syscall() for arm32.
Summary:
These will be used in an ifunc resolver, when the binary may not be
completely relocated, and syscall() function from libc could not be
used.

Reviewers: dvyukov, vitalybuka

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

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

llvm-svn: 317640
2017-11-08 00:15:12 +00:00
Sriraman Tallam 056b3fd6fb Attribute nonlazybind should not affect calls to functions with hidden visibility.
Differential Revision: https://reviews.llvm.org/D39625

llvm-svn: 317639
2017-11-08 00:01:05 +00:00
Evgeniy Stepanov 0379d3f844 (NFC) Rename GetMax{,User}VirtualAddress.
Future change will introduce GetMaxVirtualAddress that will not take
the kernel area into account.

llvm-svn: 317638
2017-11-07 23:51:22 +00:00
Rafael Espindola 367ca01478 Fix unused variable error.
llvm-svn: 317637
2017-11-07 23:43:01 +00:00
Jonathan Peyton 40039ac98c Cleanup version symbol macros and attributes/declspecs
1) Get rid of xaliasify, xexpand and xversionify for KMP_EXPAND_NAME and
KMP_VERSION_SYMBOL. KMP_VERSION_SYMBOL is a combination of xaliasify and
xversionify.

2) Put all attribute and __declspec definitions in kmp_os.h

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

llvm-svn: 317636
2017-11-07 23:32:13 +00:00
Bob Haarman 6c301b6eb1 [coff] use relative instead of absolute __safe_se_handler_base when present
Summary:
__safe_se_handler_base should be either absolute 0 (when no SafeSEH
table is present), or relative to the image base (when the table is
present). An earlier change inadvertedly made the symbol absolute in
both cases, leading to the SafeSEH table not being locatble at run
time. This change fixes that and updates the safeseh test to check for
the presence of the relocation.

Reviewers: rnk, ruiu

Reviewed By: ruiu

Subscribers: ruiu, llvm-commits

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

llvm-svn: 317635
2017-11-07 23:24:10 +00:00
Paul Robinson 63efdd32dd Reapply r317609 with a simpler sed script, thanks to Justin Bogner!
llvm-svn: 317634
2017-11-07 23:17:43 +00:00
Rafael Espindola 37a575f8b6 Delete dead code.
llvm-svn: 317633
2017-11-07 23:12:41 +00:00
Rafael Espindola c78890640e Use std::thread directly.
Now that this code is posix only we don't need to use runBackground.

llvm-svn: 317632
2017-11-07 23:09:54 +00:00
Rafael Espindola 1501a26b39 Simplify unlinkAsync.
It used to rename the file before removing it in a background thread.

A simpler way to delay the removal is simply to open the file.

Since this is a posix specific issue, simplify the windows
implementation.

llvm-svn: 317631
2017-11-07 23:01:37 +00:00
Dave Lee dcce03300d Revert "Allow yaml2obj to order implicit sections for ELF"
Also, revert "Fix build bots after r317622"

This reverts commit r317622, r317626.

llvm-svn: 317630
2017-11-07 22:51:27 +00:00
Paul Robinson 9737f54f1d Revert r317609, test fails on one bot
llvm-svn: 317628
2017-11-07 22:39:12 +00:00