Guillaume Chatelet [Wed, 11 Sep 2019 11:16:48 +0000 (11:16 +0000)]
[Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing
Summary:
This catches malformed mir files which specify alignment as log2 instead of pow2.
See https://reviews.llvm.org/D65945 for reference,
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Subscribers: MatzeB, qcolombet, dschuff, arsenm, sdardis, nemanjai, jvesely, nhaehnle, hiraditya, kbarton, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, s.egerton, pzheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67433
llvm-svn: 371608
Simon Atanasyan [Wed, 11 Sep 2019 11:16:06 +0000 (11:16 +0000)]
[mips][msa] Fix infinite loop for mips.nori.b intrinsic
When value of immediate in `mips.nori.b` is 255 (which has all ones in
binary form as 8bit integer) DAGCombiner and Legalizer would fall in an
infinite loop. DAGCombiner would try to simplify `or %value, -1` by
turning `%value` into UNDEF. Legalizer will turn it back into `Constant<0>`
which would then be again turned into UNDEF by DAGCombiner. To avoid this
loop we make UNDEF legal for MSA int types on Mips.
Patch by Mirko Brkusanin.
Differential Revision: https://reviews.llvm.org/D67280
llvm-svn: 371607
Simon Pilgrim [Wed, 11 Sep 2019 11:12:00 +0000 (11:12 +0000)]
Fix -Wdocumentation warning - void function doesn't need a @returns. NFCI.
llvm-svn: 371606
David Bolvansky [Wed, 11 Sep 2019 10:59:47 +0000 (10:59 +0000)]
[Diagnostics] Add -Wsizeof-array-div
Summary: Clang version of https://www.viva64.com/en/examples/v706/
Reviewers: rsmith
Differential Revision: https://reviews.llvm.org/D67287
llvm-svn: 371605
David Bolvansky [Wed, 11 Sep 2019 10:51:26 +0000 (10:51 +0000)]
[NFC] Updated objsize-64.ll test
llvm-svn: 371604
David Bolvansky [Wed, 11 Sep 2019 10:42:30 +0000 (10:42 +0000)]
[NFC] Fixed test
llvm-svn: 371603
David Bolvansky [Wed, 11 Sep 2019 10:37:03 +0000 (10:37 +0000)]
[InstCombine] Fixed handling of isOpNewLike (PR11748)
llvm-svn: 371602
Florian Hahn [Wed, 11 Sep 2019 10:32:15 +0000 (10:32 +0000)]
[LoopInterchange] Drop unused splitInnerLoopHeader declaration.
llvm-svn: 371601
Konrad Kleine [Wed, 11 Sep 2019 10:12:36 +0000 (10:12 +0000)]
[LLDB][ELF] Fixup for comments in D67390
llvm-svn: 371600
Konrad Kleine [Wed, 11 Sep 2019 10:00:30 +0000 (10:00 +0000)]
[LLDB][ELF] Load both, .symtab and .dynsym sections
Summary:
This change ensures that the .dynsym section will be parsed even when there's already is a .symtab.
It is motivated because of minidebuginfo (https://sourceware.org/gdb/current/onlinedocs/gdb/MiniDebugInfo.html#MiniDebugInfo).
There it says:
Keep all the function symbols not already in the dynamic symbol table.
That means the .symtab embedded inside the .gnu_debugdata does NOT contain the symbols from .dynsym. But in order to put a breakpoint on all symbols we need to load both. I hope this makes sense.
My other patch D66791 implements support for minidebuginfo, that's why I need this change.
Reviewers: labath, espindola, alexshap
Subscribers: JDevlieghere, emaste, arichardson, MaskRay, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D67390
llvm-svn: 371599
Dmitri Gribenko [Wed, 11 Sep 2019 09:16:17 +0000 (09:16 +0000)]
Revert "clang-misexpect: Profile Guided Validation of Performance Annotations in LLVM"
This reverts commit r371584. It introduced a dependency from compiler-rt
to llvm/include/ADT, which is problematic for multiple reasons.
One is that it is a novel dependency edge, which needs cross-compliation
machinery for llvm/include/ADT (yes, it is true that right now
compiler-rt included only header-only libraries, however, if we allow
compiler-rt to depend on anything from ADT, other libraries will
eventually get used).
Secondly, depending on ADT from compiler-rt exposes ADT symbols from
compiler-rt, which would cause ODR violations when Clang is built with
the profile library.
llvm-svn: 371598
Diogo N. Sampaio [Wed, 11 Sep 2019 09:06:17 +0000 (09:06 +0000)]
[ARM] Take into account -mcpu and -mfpu options while handling 'crypto' feature
Submittin in behalf of krisb (Kristina Bessonova) <ch.bessonova@gmail.com>
Summary:
'+crypto' means '+aes' and '+sha2' for arch >= ARMv8 when they were
not disabled explicitly. But this is correctly handled only in case of
'-march' option, though the feature may also be specified through
the '-mcpu' or '-mfpu' options. In the following example:
$ clang -mcpu=cortex-a57 -mfpu=crypto-neon-fp-armv8
'aes' and 'sha2' are disabled that is quite unexpected:
$ clang -cc1 -triple armv8--- -target-cpu cortex-a57
<...> -target-feature -sha2 -target-feature -aes -target-feature +crypto
This exposed by https://reviews.llvm.org/D63936 that makes
the 'aes' and 'sha2' features disabled by default.
So, while handling the 'crypto' feature we need to take into account:
- a CPU name, as it provides the information about architecture
(if no '-march' option specified),
- features, specified by the '-mcpu' and '-mfpu' options.
Reviewers: SjoerdMeijer, ostannard, labrinea, dnsampaio
Reviewed By: dnsampaio
Subscribers: ikudrin, javed.absar, kristof.beyls, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66018
Author: krisb
llvm-svn: 371597
David Zarzycki [Wed, 11 Sep 2019 08:32:37 +0000 (08:32 +0000)]
[LLDB] Do not try to canonicalize gethostname() result
This code is trying too hard and failing. Either the result of
gethostname() is canonical or it is not. If it is not, then trying to
canonicalize it is – for various reasons – a lost cause. For example, a
given machine might have multiple network interfaces with multiple
addresses per interface, each with a different canonical name.
Separably, the result of HostInfoPosix::GetHostname() and latency
thereof shouldn't depend on whether networking is up or down or what
network the machine happened to be attached to at any given moment (like
a laptop that travels between work and home).
https://reviews.llvm.org/D67230
llvm-svn: 371596
Florian Hahn [Wed, 11 Sep 2019 08:23:23 +0000 (08:23 +0000)]
[LoopInterchange] Properly move condition, induction increment and ops to latch.
Currently we only rely on the induction increment to come before the
condition to ensure the required instructions get moved to the new
latch.
This patch duplicates and moves the required instructions to the
newly created latch. We move the condition to the end of the new block,
then process its operands. We stop at operands that are defined
outside the loop, or are the induction PHI.
We duplicate the instructions and update the uses in the moved
instructions, to ensure other users remain intact. See the added
test2 for such an example.
Reviewers: efriedma, mcrosier
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D67367
llvm-svn: 371595
Sam Parker [Wed, 11 Sep 2019 08:17:48 +0000 (08:17 +0000)]
[NFC][ARM] Add and modify tests
Add test for ParallelDSP.
llvm-svn: 371594
Fangrui Song [Wed, 11 Sep 2019 07:38:21 +0000 (07:38 +0000)]
[LTO] Avoid calling GlobalValue::getGUID (MD5) twice
llvm-svn: 371593
Tim Renouf [Wed, 11 Sep 2019 07:26:39 +0000 (07:26 +0000)]
[TLI][AMDGPU] AMDPAL does not have library functions
Configure TLI to say that r600/amdgpu does not have any library
functions, such that InstCombine does not do anything like turn sin/cos
into the library function @tan with sufficient fast math flags.
Differential Revision: https://reviews.llvm.org/D67406
Change-Id: I02f907d3e64832117ea9800e9f9285282856e5df
llvm-svn: 371592
Fangrui Song [Wed, 11 Sep 2019 07:23:35 +0000 (07:23 +0000)]
[llvm-objcopy] Simplify --prefix-alloc-sections
Handle --prefix-alloc-sections after --rename-sections so that --prefix-alloc-sections code
does not have to check if renaming has been performed.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D66931
llvm-svn: 371591
Hideto Ueno [Wed, 11 Sep 2019 07:00:33 +0000 (07:00 +0000)]
[Attributor] Implement "noalias" callsite argument deduction
Summary: Now, `nocapture` is deduced in Attributor therefore, this patch introduces deduction for `noalias` callsite argument using `nocapture`.
Reviewers: jdoerfert, sstefan1
Reviewed By: jdoerfert
Subscribers: lebedev.ri, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67286
llvm-svn: 371590
Hideto Ueno [Wed, 11 Sep 2019 06:52:11 +0000 (06:52 +0000)]
[Attributor][Fix] Manifest nocapture only in CSArgument or Argument
Summary:
We can query to Attributor whether the value is captured in the scope or not on the following way:
```
const auto & NoCapAA = A.getAAFor<AANoCapture>(*this, IRPosition::value(V));
```
And if V is CallSiteReturned then `getDeducedAttribute` will add `nocatpure` to the callsite returned value. It is not valid.
This patch checks the position is an argument or call site argument.
This is tested in D67286.
Reviewers: jdoerfert, sstefan1
Reviewed By: jdoerfert
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67342
llvm-svn: 371589
Fangrui Song [Wed, 11 Sep 2019 06:20:14 +0000 (06:20 +0000)]
[ELF][test] Make tests more tolerant to exact symbol addresses
llvm-svn: 371588
Alexey Lapshin [Wed, 11 Sep 2019 06:07:16 +0000 (06:07 +0000)]
[Debuginfo][Instcombiner] Do not clone dbg.declare.
TryToSinkInstruction() has a bug: While updating debug info for
sunk instruction, it could clone dbg.declare intrinsic.
That is wrong. There could be only one dbg.declare.
The fix is to not clone dbg.declare intrinsic and to update
it`s arguments, to not to point to sunk instruction.
Differential Revision: https://reviews.llvm.org/D67217
llvm-svn: 371587
Fangrui Song [Wed, 11 Sep 2019 01:54:48 +0000 (01:54 +0000)]
[CodeGen] Add alias for cpu_dispatch function with IFunc & Fix resolver linkage type
Multi-versioned functions defined by cpu_dispatch and implemented with IFunc
can not be called outside the translation units where they are defined due to
lack of symbols. This patch add function aliases for these functions and thus
make them visible outside.
Differential Revision: https://reviews.llvm.org/D67058
Patch by Senran Zhang
llvm-svn: 371586
Fangrui Song [Wed, 11 Sep 2019 01:49:00 +0000 (01:49 +0000)]
[llvm-nm] Fix -DBUILD_SHARED_LIBS=ON builds after D66160/r371576
llvm-svn: 371585
Petr Hosek [Wed, 11 Sep 2019 01:09:16 +0000 (01:09 +0000)]
clang-misexpect: Profile Guided Validation of Performance Annotations in LLVM
This patch contains the basic functionality for reporting potentially
incorrect usage of __builtin_expect() by comparing the developer's
annotation against a collected PGO profile. A more detailed proposal and
discussion appears on the CFE-dev mailing list
(http://lists.llvm.org/pipermail/cfe-dev/2019-July/062971.html) and a
prototype of the initial frontend changes appear here in D65300
We revised the work in D65300 by moving the misexpect check into the
LLVM backend, and adding support for IR and sampling based profiles, in
addition to frontend instrumentation.
We add new misexpect metadata tags to those instructions directly
influenced by the llvm.expect intrinsic (branch, switch, and select)
when lowering the intrinsics. The misexpect metadata contains
information about the expected target of the intrinsic so that we can
check against the correct PGO counter when emitting diagnostics, and the
compiler's values for the LikelyBranchWeight and UnlikelyBranchWeight.
We use these branch weight values to determine when to emit the
diagnostic to the user.
A future patch should address the comment at the top of
LowerExpectIntrisic.cpp to hoist the LikelyBranchWeight and
UnlikelyBranchWeight values into a shared space that can be accessed
outside of the LowerExpectIntrinsic pass. Once that is done, the
misexpect metadata can be updated to be smaller.
In the long term, it is possible to reconstruct portions of the
misexpect metadata from the existing profile data. However, we have
avoided this to keep the code simple, and because some kind of metadata
tag will be required to identify which branch/switch/select instructions
are influenced by the use of llvm.expect
Patch By: paulkirth
Differential Revision: https://reviews.llvm.org/D66324
llvm-svn: 371584
Jason Molenda [Wed, 11 Sep 2019 01:03:24 +0000 (01:03 +0000)]
Ah, only skip this for embedded darwin targets.
llvm-svn: 371583
Jason Molenda [Wed, 11 Sep 2019 01:02:30 +0000 (01:02 +0000)]
Skip a test in TestProcessIO.py when running against ios devices.
llvm-svn: 371582
Reid Kleckner [Wed, 11 Sep 2019 01:01:06 +0000 (01:01 +0000)]
Emit -Wmicrosoft-enum-value warning instead of error in MS ABI
Summary:
The first NFC change is to replace a getCXXABI().isMicrosoft() check
with getTriple().isWindowsMSVCEnvironment(). This code takes effect in
non-C++ compilations, so it doesn't make sense to check the C++ ABI. In
the MS ABI, enums are always considered to be "complete" because the
underlying type of an unfixed enum will always be 'int'. This behavior
was moved from -fms-compatibility to MS ABI back in r249656.
The second change is functional, and it downgrades an error to a warning
when the MS ABI is used rather than only under -fms-compatibility. The
reasoning is that it's unreasonable for the following code to reject the
following code for all MS ABI targets with -fno-ms-compatibility:
enum Foo { Foo_Val = 0xDEADBEEF };
This is valid code for any other target, but in the MS ABI, Foo_Val just
happens to be negative. With this change, clang emits a
-Wmicrosoft-enum-value warning on this code, but compiles it without
error.
Fixes PR38478
Reviewers: hans, rsmith, STL_MSFT
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D67304
llvm-svn: 371581
David Blaikie [Wed, 11 Sep 2019 00:44:17 +0000 (00:44 +0000)]
Revert "llvm-reduce: Add pass to reduce parameters"
Looks to be failing on asan buildbots
This reverts commit r371567.
llvm-svn: 371580
Petr Hosek [Wed, 11 Sep 2019 00:43:35 +0000 (00:43 +0000)]
Revert "Adding support for overriding LLVM_ENABLE_RUNTIMES for runtimes builds."
This reverts commit r371566: this doesn't correctly handle the case
where LLVM_ENABLE_RUNTIMES contains a list of values.
llvm-svn: 371579
Jan Korous [Wed, 11 Sep 2019 00:30:26 +0000 (00:30 +0000)]
[clang-scan-deps][NFC] Fix tests - prevent FileCheck matching test dir path
Differential Revision: https://reviews.llvm.org/D67379
llvm-svn: 371578
Cyndy Ishida [Wed, 11 Sep 2019 00:13:01 +0000 (00:13 +0000)]
[Object][TextAPI] NFC, fix tapi lit tests
FileCheck command had wrong casing, which works fine on macOS, repairs the linux build bots
llvm-svn: 371577
Cyndy Ishida [Wed, 11 Sep 2019 00:00:53 +0000 (00:00 +0000)]
[llvm-nm] Add tapi file support
Summary:
This commit is the final one for adding tapi support to the llvm-nm implementation.
This commit also has accompanying tests the additions to lib/Object
Reviewers: ributzka, steven_wu
Reviewed By: ributzka
Subscribers: hiraditya, plotfi, dexonsmith, rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66160
llvm-svn: 371576
Kamil Rytarowski [Tue, 10 Sep 2019 23:55:03 +0000 (23:55 +0000)]
Remove xfail i386 NetBSD mark in vptr-non-unique-typeinfo.cpp
This test passes now.
llvm-svn: 371575
Kamil Rytarowski [Tue, 10 Sep 2019 23:42:16 +0000 (23:42 +0000)]
Remove xfail NetBSD mark from ignored-interceptors-mmap.cpp
This test now passes.
llvm-svn: 371574
Alina Sbirlea [Tue, 10 Sep 2019 23:36:43 +0000 (23:36 +0000)]
[MemorySSA] MemorySSA should not model debuginfo, and need not update it.
Reverts the change in r371084, but keeps the test.
After r371565, debuginfo cannot be modelled in MemorySSA, even with a
non-standard AA pipeline.
llvm-svn: 371573
Jessica Paquette [Tue, 10 Sep 2019 23:34:45 +0000 (23:34 +0000)]
[GlobalISel] When a tail call is emitted in a block, stop translating it
This fixes a crash in tail call translation caused by assume and lifetime_end
intrinsics.
It's possible to have instructions other than a return after a tail call which
will still have `Analysis::isInTailCallPosition` return true. (Namely,
lifetime_end and assume intrinsics.)
If we emit a tail call, we should stop translating instructions in the block.
Otherwise, we can end up emitting an extra return, or dead instructions in
general. This makes the verifier unhappy, and is generally unfortunate for
codegen.
This also removes the code from AArch64CallLowering that checks if we have a
tail call when lowering a return. This is covered by the new code now.
Also update call-translator-tail-call.ll to show that we now properly tail call
in the presence of lifetime_end and assume.
Differential Revision: https://reviews.llvm.org/D67415
llvm-svn: 371572
Owen Pan [Tue, 10 Sep 2019 23:26:45 +0000 (23:26 +0000)]
[clang-format] Apply BAS_AlwaysBreak to C++11 braced lists
See PR18455.
Differential Revision: https://reviews.llvm.org/D67395
llvm-svn: 371571
Jessica Paquette [Tue, 10 Sep 2019 23:25:12 +0000 (23:25 +0000)]
[AArch64][GlobalISel] Support sibling calls with mismatched calling conventions
Add support for sibcalling calls whose calling convention differs from the
caller's.
- Port over `CCState::resultsCombatible` from CallingConvLower.cpp into
CallLowering. This is used to verify that the way the caller and callee CC
handle incoming arguments matches up.
- Add `CallLowering::analyzeCallResult`. This is basically a port of
`CCState::AnalyzeCallResult`, but using `ArgInfo` rather than `ISD::InputArg`.
- Add `AArch64CallLowering::doCallerAndCalleePassArgsTheSameWay`. This checks
that the calling conventions are compatible, and that the caller and callee
preserve the same registers.
For testing:
- Update call-translator-tail-call.ll to show that we can now handle this.
- Add a GISel line to tailcall-ccmismatch.ll to show that we will not tail call
when the regmasks don't line up.
Differential Revision: https://reviews.llvm.org/D67361
llvm-svn: 371570
Alina Sbirlea [Tue, 10 Sep 2019 23:22:37 +0000 (23:22 +0000)]
Update ReleaseNotes: add enabling of MemorySSA.
llvm-svn: 371569
Amy Huang [Tue, 10 Sep 2019 23:15:38 +0000 (23:15 +0000)]
Reland "Change the X86 datalayout to add three address spaces
for 32 bit signed, 32 bit unsigned, and 64 bit pointers."
This reverts
57076d3199fc2b0af4a3736b7749dd5462cacda5.
Original review at https://reviews.llvm.org/D64931.
Review for added fix at https://reviews.llvm.org/D66843.
llvm-svn: 371568
David Blaikie [Tue, 10 Sep 2019 23:10:10 +0000 (23:10 +0000)]
llvm-reduce: Add pass to reduce parameters
Patch by Diego Treviño!
Differential Revision: https://reviews.llvm.org/D65479
llvm-svn: 371567
Puyan Lotfi [Tue, 10 Sep 2019 22:55:47 +0000 (22:55 +0000)]
Adding support for overriding LLVM_ENABLE_RUNTIMES for runtimes builds.
On some platforms, certain runtimes are not supported. For runtimes builds of
those platforms it would be nice if we could disable certain runtimes (ie
libunwind on Windows).
Differential Revision: https://reviews.llvm.org/D67195
llvm-svn: 371566
Alina Sbirlea [Tue, 10 Sep 2019 22:35:27 +0000 (22:35 +0000)]
[MemorySSA] Do not create memoryaccesses for debug info intrinsics.
Summary:
Do not model debuginfo intrinsics in MemorySSA.
Regularly these are non-memory modifying instructions. With -disable-basicaa, they were being modelled as Defs.
Reviewers: george.burgess.iv
Subscribers: aprantl, Prazek, sanjoy.google, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67307
llvm-svn: 371565
David Blaikie [Tue, 10 Sep 2019 22:31:35 +0000 (22:31 +0000)]
llvm-reduce: Remove some unused headers/more narrowly include them
llvm-svn: 371564
David Blaikie [Tue, 10 Sep 2019 22:10:00 +0000 (22:10 +0000)]
llvm-remove: Remove "using namespace" in header.
llvm-svn: 371563
David Blaikie [Tue, 10 Sep 2019 22:09:58 +0000 (22:09 +0000)]
llvm-reduce: Add pass to reduce Metadata
Patch by Diego Treviño!
Differential Revision: https://reviews.llvm.org/D65026
llvm-svn: 371562
Eric Christopher [Tue, 10 Sep 2019 22:05:01 +0000 (22:05 +0000)]
Move LLVM_ENABLE_ABI_BREAKING_CHECKS variables to their own file
so that you don't have to link Error.o and all of its dependencies.
In more detail: global initializers in Error.o can't be elided with
-ffunction-sections/-gc-sections since they always need to be run
causing a fairly significant binary bloat if all you want is the
ABI breaking checks code.
Differential Revision: https://reviews.llvm.org/D67387
llvm-svn: 371561
Jim Ingham [Tue, 10 Sep 2019 21:58:22 +0000 (21:58 +0000)]
Fix a thinko in handling the QSetLogging packet.
The comparison against LOG_MEMORY shortcut all the LOG_MEMORY_*
log channels. It has to come last.
llvm-svn: 371560
Reid Kleckner [Tue, 10 Sep 2019 21:54:16 +0000 (21:54 +0000)]
Actually reorder not and env in crash-recovery-modules.m
llvm-svn: 371559
Philip Reames [Tue, 10 Sep 2019 21:33:53 +0000 (21:33 +0000)]
[Loads] Move generic code out of vectorizer into a location it might be reused [NFC]
llvm-svn: 371558
Richard Smith [Tue, 10 Sep 2019 21:24:09 +0000 (21:24 +0000)]
When evaluating a __builtin_constant_p conditional, always enter
constant-folding mode regardless of the original evaluation mode.
In order for this to be correct, we need to track whether we're checking
for a potential constant expression or checking for undefined behavior
separately from the evaluation mode enum, since we don't want to clobber
those states when entering constant-folding mode.
llvm-svn: 371557
Philip Reames [Tue, 10 Sep 2019 21:12:29 +0000 (21:12 +0000)]
[ValueTracking] Factor our common speculation suppression logic [NFC]
Expose a utility function so that all places which want to suppress speculation (when otherwise legal) due to ordering and/or sanitizer interaction can do so.
llvm-svn: 371556
David Blaikie [Tue, 10 Sep 2019 20:52:14 +0000 (20:52 +0000)]
llvm-reduce: Simplify testing using -implicit-check-not
Also fix llvm-reduce to use the specified output file name directly,
without appending '.ll' to the name.
llvm-svn: 371555
Simon Atanasyan [Tue, 10 Sep 2019 20:19:59 +0000 (20:19 +0000)]
[mips] Allow PT_LOAD to have overlapping p_offset ranges on EM_MIPS
Port the D64906 <https://reviews.llvm.org/D64906> technique to MIPS.
Fix PR33131
llvm-svn: 371554
Alexey Bataev [Tue, 10 Sep 2019 20:19:58 +0000 (20:19 +0000)]
[OPENMP5.0]Allow teams directive outside of the target directives.
According to OpenMP 5.0, teams directives are allowed not only in the
target context, but also in the implicit parallel regions.
llvm-svn: 371553
Reid Kleckner [Tue, 10 Sep 2019 20:15:45 +0000 (20:15 +0000)]
Re-land Remove REQUIRES:shell from tests that pass for me on Windows
This reverts r371497 (git commit
3d7e9ab7b9f8c53aa41420c54970f0fb421004a2)
Reorder `not` with `env` in these two tests so they pass:
Driver/rewrite-map-in-diagnostics.c
Index/crash-recovery-modules.m.
This will not be necessary after D66531 lands.
llvm-svn: 371552
Sanjay Patel [Tue, 10 Sep 2019 20:04:10 +0000 (20:04 +0000)]
[x86] add test for false dependency with AVX; NFC
Goes with D67363
llvm-svn: 371551
Roman Lebedev [Tue, 10 Sep 2019 19:30:17 +0000 (19:30 +0000)]
[NFC][InstCombine] rewrite test added in r371537 to use non-null pointer instead
I only want to ensure that %offset is non-zero there,
it doesn't matter how that info is conveyed.
As filed in PR43267, the assumption way does not work.
llvm-svn: 371550
Alexey Bataev [Tue, 10 Sep 2019 19:16:56 +0000 (19:16 +0000)]
Fix for PR43175: compiler crash when trying to emit noncapturable
constant.
If the constexpr variable is partially initialized, the initializer can
be emitted as the structure, not as an array, because of some early
optimizations. The llvm variable gets the type from this constant and,
thus, gets the type which is pointer to struct rather than pointer to an
array. We need to convert this type to be truely array, otherwise it may
lead to the compiler crash when trying to emit array subscript
expression.
llvm-svn: 371548
Philip Reames [Tue, 10 Sep 2019 18:43:15 +0000 (18:43 +0000)]
[X86] Updated target specific selection dag code to conservatively check for isAtomic in addition to isVolatile
See D66309 for context.
This is the first sweep of x86 target specific code to add isAtomic bailouts where appropriate. The intention here is to have the switch from AtomicSDNode to LoadSDNode/StoreSDNode be close to NFC; that is, I'm not looking to allow additional optimizations at this time.
Sorry for the lack of tests. As discussed in the review, most of these are vector tests (for which atomicity is not well defined) and I couldn't figure out to exercise the anyextend cases which aren't vector specific.
Differential Revision: https://reviews.llvm.org/D66322
llvm-svn: 371547
Roman Lebedev [Tue, 10 Sep 2019 18:40:00 +0000 (18:40 +0000)]
[NFC][InstSimplify] rewrite test added in r371537 to use non-null pointer instead
I only want to ensure that %offset is non-zero there,
it doesn't matter how that info is conveyed.
As filed in PR43267, the assumption way does not work.
llvm-svn: 371546
Vedant Kumar [Tue, 10 Sep 2019 18:36:53 +0000 (18:36 +0000)]
[lldbtest] Add an "expected_cmd_failure" option to the filecheck helper
llvm-svn: 371544
Vedant Kumar [Tue, 10 Sep 2019 18:36:50 +0000 (18:36 +0000)]
[Function] Factor out GetCallEdgeForReturnAddress, NFC
Finding the call edge in a function which corresponds to a particular
return address is a generic/useful operation.
llvm-svn: 371543
Matt Arsenault [Tue, 10 Sep 2019 17:57:33 +0000 (17:57 +0000)]
GlobalISel/TableGen: Handle REG_SEQUENCE patterns
The scalar f64 patterns don't work yet because they fail on multiple
results from the unused implicit def of scc in the result bit
operation.
llvm-svn: 371542
Guozhi Wei [Tue, 10 Sep 2019 17:25:11 +0000 (17:25 +0000)]
[BPI] Adjust the probability for floating point unordered comparison
Since NaN is very rare in normal programs, so the probability for floating point unordered comparison should be extremely small. Current probability is 3/8, it is too large, this patch changes it to a tiny number.
Differential Revision: https://reviews.llvm.org/D65303
llvm-svn: 371541
Matt Arsenault [Tue, 10 Sep 2019 17:19:46 +0000 (17:19 +0000)]
AMDGPU/GlobalISel: Select G_FABS/G_FNEG
f64 doesn't work yet because tablegen currently doesn't handlde
REG_SEQUENCE.
This does regress some multi use VALU fneg cases since now the
immediate remains in an SGPR, and more moves are used for legalizing
the xor. This is a SIFixSGPRCopies deficiency.
llvm-svn: 371540
Matt Arsenault [Tue, 10 Sep 2019 17:17:05 +0000 (17:17 +0000)]
AMDGPU/GlobalISel: Select cvt pk intrinsics
llvm-svn: 371539
Matt Arsenault [Tue, 10 Sep 2019 17:16:59 +0000 (17:16 +0000)]
AMDGPU/GlobalISel: Select llvm.amdgcn.sffbh
llvm-svn: 371538
Roman Lebedev [Tue, 10 Sep 2019 17:13:59 +0000 (17:13 +0000)]
[NFC][InstCombine][InstSimplify] PR43251 - and some patterns with offset != 0
https://rise4fun.com/Alive/21b
llvm-svn: 371537
Matt Arsenault [Tue, 10 Sep 2019 16:42:37 +0000 (16:42 +0000)]
AMDGPU/GlobalISel: RegBankSelect for G_ZEXTLOAD/G_SEXTLOAD
llvm-svn: 371536
Matt Arsenault [Tue, 10 Sep 2019 16:42:31 +0000 (16:42 +0000)]
AMDGPU/GlobalISel: Legalize constant 32-bit loads
Legalize by casting to a 64-bit constant address. This isn't how the
DAG implements it, but it should.
llvm-svn: 371535
Sam Elliott [Tue, 10 Sep 2019 16:24:03 +0000 (16:24 +0000)]
[RISCV] Support llvm-objdump -M no-aliases and -M numeric
Summary:
Now that llvm-objdump allows target-specific options, we match the
`no-aliases` and `numeric` options for RISC-V, as supported by GNU objdump.
This is done by overriding the variables used for the command-line options, so
that the command-line options are still supported.
This patch updates all tests using `llvm-objdump -riscv-no-aliases` to use
`llvm-objdump -M no-aliases`.
Reviewers: luismarques, asb
Reviewed By: luismarques, asb
Subscribers: pzheng, hiraditya, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, s.egerton, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66139
llvm-svn: 371534
Matt Arsenault [Tue, 10 Sep 2019 16:20:14 +0000 (16:20 +0000)]
AMDGPU/GlobalISel: First pass at attempting to legalize load/stores
There's still a lot more to do, but this handles decomposing due to
alignment. I've gotten it to the point where nothing crashes or
infinite loops the legalizer.
llvm-svn: 371533
Adrian Prantl [Tue, 10 Sep 2019 16:17:38 +0000 (16:17 +0000)]
Implement DW_OP_convert
This patch adds basic support for DW_OP_convert[1] for integer
types. Recent versions of LLVM's optimizer may insert this opcode into
DWARF expressions. DW_OP_convert is effectively a type cast operation
that takes a reference to a base type DIE (or zero) and then casts the
value at the top of the DWARF stack to that type. Internally this
works by changing the bit size of the APInt that is used as backing
storage for LLDB's DWARF stack.
I managed to write a unit test for this by implementing a mock YAML
object file / module that takes debug info sections in yaml2obj
format.
[1] Typed DWARF stack. http://www.dwarfstd.org/ShowIssue.php?issue=140425.1
<rdar://problem/
48167864>
Differential Revision: https://reviews.llvm.org/D67369
llvm-svn: 371532
Sam Elliott [Tue, 10 Sep 2019 15:55:55 +0000 (15:55 +0000)]
[RISCV] Add Option for Printing Architectural Register Names
Summary:
This is an option primarily to use during testing. Instead of always
printing registers using their ABI names, this allows a user to request they
are printed with their architectural name.
This is then used in the register constraint tests to ensure the mapping
between architectural and abi names is correct.
Reviewers: asb, luismarques
Reviewed By: asb
Subscribers: pzheng, hiraditya, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, s.egerton, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65950
llvm-svn: 371531
Adrian Prantl [Tue, 10 Sep 2019 15:53:18 +0000 (15:53 +0000)]
Don't emit .gnu_pubnames when tuning for LLDB.
LLDB reads the various .apple* accelerator tables (and in the near
future: the DWARF 5 accelerator tables) which should make
.gnu_pubnames redundant. This changes the Clang driver to no longer
pass -ggnu-pubnames when tuning for LLDB.
Thanks to David Blaikie for pointing this out!
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-
20190422/thread.html#646062
rdar://problem/
50142073
Differential Revision: https://reviews.llvm.org/D67373
llvm-svn: 371530
Sanjay Patel [Tue, 10 Sep 2019 15:42:22 +0000 (15:42 +0000)]
[x86] add a test for BreakFalseDeps; NFC
As discussed in D67363
llvm-svn: 371528
Djordje Todorovic [Tue, 10 Sep 2019 14:48:52 +0000 (14:48 +0000)]
Revert "[utils] Implement the llvm-locstats tool"
This reverts commit rL371520.
llvm-svn: 371527
Sanjay Patel [Tue, 10 Sep 2019 14:29:02 +0000 (14:29 +0000)]
[ARM] add test for BreakFalseDeps with minsize attribute; NFC
llvm-svn: 371526
Simon Pilgrim [Tue, 10 Sep 2019 14:28:29 +0000 (14:28 +0000)]
[X86] Add AVX partial dependency tests as noted on D67363
llvm-svn: 371525
Sanjay Patel [Tue, 10 Sep 2019 14:26:25 +0000 (14:26 +0000)]
[ARM] auto-generate complete test checks; NFC
llvm-svn: 371524
Florian Hahn [Tue, 10 Sep 2019 14:20:20 +0000 (14:20 +0000)]
[VectorUtils] Remove unused include. [NFC]
Patch by Francesco Petrogalli <francesco.petrogalli@arm.com>
Reviewers: fhahn
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D67365
llvm-svn: 371523
Clement Courbet [Tue, 10 Sep 2019 14:20:08 +0000 (14:20 +0000)]
[clang][codegen][NFC] Make test patterns more permissive.
See the discussion in:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-
20190909/692736.html
llvm-svn: 371522
David Zarzycki [Tue, 10 Sep 2019 14:19:52 +0000 (14:19 +0000)]
[CMake] Don't pass all LLVM_COMPILE_FLAGS to the C compiler
GCC (unlike clang!) warns about C++ flags when compiling C.
https://reviews.llvm.org/D67171
llvm-svn: 371521
Djordje Todorovic [Tue, 10 Sep 2019 13:47:03 +0000 (13:47 +0000)]
[utils] Implement the llvm-locstats tool
The tool reports verbose output for the DWARF debug location coverage.
The llvm-locstats for each variable or formal parameter DIE computes what
percentage from the code section bytes, where it is in scope, it has
location description. The line 0 shows the number (and the percentage) of
DIEs with no location information, but the line 100 shows the number (and
the percentage) of DIEs where there is location information in all code
section bytes (where the variable or parameter is in the scope). The line
50..59 shows the number (and the percentage) of DIEs where the location
information is in between 50 and 59 percentage of its scope covered.
The tool will be very useful for tracking improvements regarding the
"debugging optimized code" support with LLVM ecosystem.
Differential Revision: https://reviews.llvm.org/D66526
llvm-svn: 371520
Roman Lebedev [Tue, 10 Sep 2019 13:29:40 +0000 (13:29 +0000)]
[NFC][InstCombine] PR43251 - valid for other predicates too
llvm-svn: 371519
Florian Hahn [Tue, 10 Sep 2019 13:10:28 +0000 (13:10 +0000)]
[InstCombine] Use SimplifyFMulInst to simplify multiply in fma.
This allows us to fold fma's that multiply with 0.0. Also, the
multiply by 1.0 case is handled there as well. The fneg/fabs cases
are not handled by SimplifyFMulInst, so we need to keep them.
Reviewers: spatel, anemet, lebedev.ri
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D67351
llvm-svn: 371518
Florian Hahn [Tue, 10 Sep 2019 13:05:34 +0000 (13:05 +0000)]
[InstCombine] Precommit tests for D67351.
llvm-svn: 371517
Sanjay Patel [Tue, 10 Sep 2019 13:00:31 +0000 (13:00 +0000)]
[BreakFalseDeps] fix typos/grammar in documentation comment; NFC
llvm-svn: 371516
Martin Storsjo [Tue, 10 Sep 2019 12:31:40 +0000 (12:31 +0000)]
[Object] Implement relocation resolver for COFF ARM/ARM64
Adding testscases for this via llvm-dwarfdump.
Also add testcases for the existing resolver support for X86.
Differential Revision: https://reviews.llvm.org/D67340
llvm-svn: 371515
Fangrui Song [Tue, 10 Sep 2019 12:28:07 +0000 (12:28 +0000)]
[ELF][test] Make tests more tolerant to exact symbol addresses
Delete relocation-local.s and relocation-shared.s - covered by various tests
llvm-svn: 371514
Haojian Wu [Tue, 10 Sep 2019 12:17:49 +0000 (12:17 +0000)]
Fix the "git modified" issue on the preserve-comments-crlf.s.
Summary:
rL371473 corrected the line ending (to crlf) in preserve-comments-crlf.s, but it causes a wired issue on git
repository (I ran git pull today, it showed a local change of that file even I did not change anything).
Reviewers: gribozavr
Reviewed By: gribozavr
Subscribers: llvm-commits, cfe-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67391
llvm-svn: 371513
Raphael Isemann [Tue, 10 Sep 2019 12:04:04 +0000 (12:04 +0000)]
[lldb] Readd missing functionalities/breakpoint tests
It seems when I restructured the test folders the functionalities/breakpoint
was deleted. This just reverts this change and re-adds the tests.
llvm-svn: 371512
Guillaume Chatelet [Tue, 10 Sep 2019 12:00:43 +0000 (12:00 +0000)]
[Alignment][NFC] Use llvm::Align for TargetLowering::getPrefLoopAlignment
Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Reviewed By: courbet
Subscribers: wuzish, arsenm, nemanjai, jvesely, nhaehnle, hiraditya, kbarton, MaskRay, jsji, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67386
llvm-svn: 371511
Igor Kudrin [Tue, 10 Sep 2019 11:54:32 +0000 (11:54 +0000)]
Reland [DWARF] Add a unit test for DWARFUnit::getLength().
This is a follow-up of rL369529, where the return value of
DWARFUnit::getLength() was changed from uint32_t to uint64_t.
The test checks that a unit header with Length > 4G can be successfully
parsed and the value of the Length field is not truncated.
Differential Revision: https://reviews.llvm.org/D67276
llvm-svn: 371510
Rui Ueyama [Tue, 10 Sep 2019 11:50:26 +0000 (11:50 +0000)]
[LLD][COFF] Add index to disambiguate archive members when using -wholearchive
Patch by Markus Böck.
PR42951: When linking an archive with members that have the same name linking
fails when using the -wholearchive option. This patch passes the index
of the member in the archive to the offset parameter to disambiguate the
member.
Differential Revision: https://reviews.llvm.org/D66239
llvm-svn: 371509
Alexander Timofeev [Tue, 10 Sep 2019 10:58:57 +0000 (10:58 +0000)]
[AMDGPU]: PHI Elimination hooks added for custom COPY insertion.
Reviewers: rampitec, vpykhtin
Differential Revision: https://reviews.llvm.org/D67101
llvm-svn: 371508
Dmitri Gribenko [Tue, 10 Sep 2019 10:39:09 +0000 (10:39 +0000)]
Revert "Reland "r364412 [ExpandMemCmp][MergeICmps] Move passes out of CodeGen into opt pipeline.""
This reverts commit r371502, it broke tests
(clang/test/CodeGenCXX/auto-var-init.cpp).
llvm-svn: 371507
Djordje Todorovic [Tue, 10 Sep 2019 10:37:28 +0000 (10:37 +0000)]
[llvm-dwarfdump] Add additional stats fields
The additional fields will be parsed by the llvm-locstats tool in order to
produce more human readable output of the DWARF debug location quality
generated.
Differential Revision: https://reviews.llvm.org/D66525
llvm-svn: 371506