Commit Graph

330179 Commits

Author SHA1 Message Date
Sam Elliott 977205b595 [Sanitizers] Add support for RISC-V 64-bit
Summary:
This has been tested with gcc trunk on openSUSE Tumbleweed on the HiFive Unleashed.

Patch by Andreas Schwab (schwab)

Reviewers: luismarques

Reviewed By: luismarques

Subscribers: mhorne, emaste, luismarques, asb, mgorny, fedor.sergeev, simoncook, kito-cheng, shiva0217, rogfer01, rkruppe, lenary, s.egerton, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

Differential Revision: https://reviews.llvm.org/D66870
2019-10-23 14:12:52 +01:00
Sam McCall 7bc7fe6b78 Revert "[Support] Add a way to run a function on a detached thread"
This reverts commit 40668abca4.
This causes clang tests to fail, as stacksize=0 is being explicitly passed and
is no longer a no-op.
2019-10-23 15:10:35 +02:00
Sam McCall 40668abca4 [Support] Add a way to run a function on a detached thread
This roughly mimics `std::thread(...).detach()` except it allows to
customize the stack size. Required for https://reviews.llvm.org/D50993.

I've decided against reusing the existing `llvm_execute_on_thread` because
it's not obvious what to do with the ownership of the passed
function/arguments:

1. If we pass possibly owning functions data to `llvm_execute_on_thread`,
   we'll lose the ability to pass small non-owning non-allocating functions
   for the joining case (as it's used now). Is it important enough?
2. If we use the non-owning interface in the new use case, we'll force
   clients to transfer ownership to the spawned thread manually, but
   similar code would still have to exist inside
   `llvm_execute_on_thread(_async)` anyway (as we can't just pass the same
   non-owning pointer to pthreads and Windows implementations, and would be
   forced to wrap it in some structure, and deal with its ownership.

Patch by Dmitry Kozhevnikov!

Differential Revision: https://reviews.llvm.org/D51103
2019-10-23 12:48:38 +02:00
Mirko Brkusanin 4b63ca1379 [Mips] Use appropriate private label prefix based on Mips ABI
MipsMCAsmInfo was using '$' prefix for Mips32 and '.L' for Mips64
regardless of -target-abi option. By passing MCTargetOptions to MCAsmInfo
we can find out Mips ABI and pick appropriate prefix.

Tags: #llvm, #clang, #lldb

Differential Revision: https://reviews.llvm.org/D66795
2019-10-23 12:24:35 +02:00
David Stenberg 74a72e6848 [DebugInfo] Stop describing imms in TargetInstrInfo's describeLoadedValue() impl
Summary:
The default implementation of the describeLoadedValue() hook uses the
MoveImm property to determine if an instruction moves an immediate. If
an instruction has that property the function returns the second
operand, assuming that that is the immediate value the instruction
moves. As far as I can tell, the MoveImm property does not imply that
the second operand is the immediate value, nor that any other operand
necessarily holds the immediate value; it just means that the
instruction moves some immediate value.

One example where the second operand is not the immediate is SystemZ's
LZER instruction, which moves a zero immediate implicitly: $f0S = LZER.

That case triggered an out-of-bound assertion when getting the operand.
I have added a test case for that instruction.

Another example is ARM's MVN instruction, which holds the logical
bitwise NOT'd value of the immediate that is moved. For the following
reproducer:

  extern void foo(int);
  int main() { foo(-11); }

an incorrect call site value would be emitted:

  $ clang --target=arm foo.c -O1 -g -Xclang -femit-debug-entry-values \
      -c -o - | ./build/bin/llvm-dwarfdump  - | \
      grep -A2 call_site_parameter

  0x00000058:       DW_TAG_GNU_call_site_parameter
                      DW_AT_location (DW_OP_reg0 R0)
                      DW_AT_GNU_call_site_value (DW_OP_lit10)

Another example is the A2_combineii instruction on Hexagon which moves
two immediates to a super-register: $d0 = A2_combineii 20, 10.

Perhaps these are rare exceptions, and most MoveImm instructions hold
the immediate in the second operand, but in my opinion the default
implementation of the hook should only describe values that it can, by
some contract, guarantee are safe to describe, rather than leaving it up
to the targets to override the exceptions, as that can silently result
in incorrect call site values.

This patch adds X86's relevant move immediate instructions to the
target's hook implementation, so this commit should be a NFC for that
target. We need to do the same for ARM and AArch64.

Reviewers: djtodoro, NikolaPrica, aprantl, vsk

Reviewed By: vsk

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #debug-info, #llvm

Differential Revision: https://reviews.llvm.org/D69109
2019-10-23 11:41:29 +02:00
georgerim 64df708400 [lib/ObjectYAML] - Add a full stop to the comment. NFC.
A test commit.
2019-10-23 12:35:43 +03:00
Petar Avramovic d1815dacb0 [MIPS GlobalISel] Select MSA vector generic and builtin mul
Select vector G_MUL for MIPS32 with MSA. We have to set bank
for vector operands to fprb and selectImpl will do the rest.
Manual selection of G_MUL is now done for gprb only.
__builtin_msa_mulv_<format> will be transformed into G_MUL
in legalizeIntrinsic and selected in the same way.

Differential Revision: https://reviews.llvm.org/D69310
2019-10-23 11:22:07 +02:00
Petar Avramovic c46d24f5c3 [MIPS GlobalISel] Select MSA vector generic and builtin sub
Select vector G_SUB for MIPS32 with MSA. We have to set bank
for vector operands to fprb and selectImpl will do the rest.
__builtin_msa_subv_<format> will be transformed into G_SUB
in legalizeIntrinsic and selected in the same way.
__builtin_msa_subvi_<format> will be directly selected into
SUBVI_<format> in legalizeIntrinsic.

Differential Revision: https://reviews.llvm.org/D69306
2019-10-23 11:15:25 +02:00
Roman Lebedev 20bf0cf2f0
[TargetLowering] optimizeSetCCToComparisonWithZero(): add extra sanity checks (PR43769)
We should do the fold only if both constants are plain,
non-opaque constants, at least that is the DAG.FoldConstantArithmetic()
requirement.
And if the constant we are comparing with is zero - we shouldn't be
trying to do this fold in the first place.

Fixes https://bugs.llvm.org/show_bug.cgi?id=43769
2019-10-23 12:01:40 +03:00
Richard Smith d052a578de [c++2a] Allow comparison functions to be explicitly defaulted.
This adds some initial syntactic checking that only the appropriate
function signatures can be defaulted. No implicit definitions are
generated yet.
2019-10-22 18:16:17 -07:00
Stephan T. Lavavej 437e0e5191 [libcxx][test][NFC] Fix comment typos.
(Testing git commit access.)
2019-10-22 15:22:13 -07:00
Louis Dionne 19e95ab421 [NFC] Strip trailing whitespace in test to test Github committing 2019-10-22 15:03:01 -07:00
Jinsong Ji 31d3c1d8b7 [PowerPC][NFC] Remove deprecated Function Attrs comments #2 2019-10-22 21:50:50 +00:00
Kit Barton efd7caaa4e Fix broken sphinx link in CMake.rst.
Reviewers: delcypher, beanz

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69325
2019-10-22 14:49:58 -07:00
Jinsong Ji cf57be9d34 [PowerPC][NFC] Remove deprecated Function Attrs comments 2019-10-22 21:38:31 +00:00
LLVM GN Syncbot f86dc64bad typo fix test commit 2019-10-22 21:32:11 +00:00
Hans Wennborg 4c539e8da1 Revert r374202"[ObjC generics] Fix not inheriting type bounds in categories/extensions."
This introduced new errors, see below. Reverting until that can be investigated
properly.

  #import <AVFoundation/AVFoundation.h>

  void f(int width, int height) {
    FourCharCode best_fourcc = kCMPixelFormat_422YpCbCr8_yuvs;
    NSDictionary* videoSettingsDictionary = @{
      (id)kCVPixelBufferPixelFormatTypeKey : @(best_fourcc),
    };
  }

  $ clang++ -c /tmp/a.mm

  /tmp/a.mm:6:5: error: cannot initialize a parameter of type
  'KeyType<NSCopying>  _Nonnull const' (aka 'const id') with an rvalue
  of type 'id'
      (id)kCVPixelBufferPixelFormatTypeKey : @(best_fourcc),
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1 error generated.

> When a category/extension doesn't repeat a type bound, corresponding
> type parameter is substituted with `id` when used as a type argument. As
> a result, in the added test case it was causing errors like
>
> > type argument 'T' (aka 'id') does not satisfy the bound ('id<NSCopying>') of type parameter 'T'
>
> We are already checking that type parameters should be consistent
> everywhere (see `checkTypeParamListConsistency`) and update
> `ObjCTypeParamDecl` to have correct underlying type. And when we use the
> type parameter as a method return type or a method parameter type, it is
> substituted to the bounded type. But when we use the type parameter as a
> type argument, we check `ObjCTypeParamType` that ignores the updated
> underlying type and remains `id`.
>
> Fix by desugaring `ObjCTypeParamType` to the underlying type, the same
> way we are doing with `TypedefType`.
>
> rdar://problem/54329242
>
> Reviewers: erik.pilkington, ahatanak
>
> Reviewed By: erik.pilkington
>
> Subscribers: jkorous, dexonsmith, ributzka, cfe-commits
>
> Differential Revision: https://reviews.llvm.org/D66696
2019-10-22 22:39:01 +02:00
Yaxun (Sam) Liu 1c98ff49a3 Fix name of warn_ignored_hip_only_option
Differential Revision: https://reviews.llvm.org/D69268
2019-10-22 16:36:28 -04:00
Evgenii Stepanov 70316d3174 Revert "Fix lld detection in standalone compiler-rt."
Breaks sanitizer-android buildbot.

This reverts commit d56203201f.
2019-10-22 13:36:06 -07:00
Nico Weber e0e7d06df3 fix a few typos to test git committing 2019-10-22 16:34:00 -04:00
Simon Cook aed9d6d64a [RISCV] Add support for -ffixed-xX flags
This adds support for reserving GPRs such that the compiler will not
choose a register for register allocation. The implementation follows
the same design as for AArch64; each reserved register becomes a target
feature and used for getting the reserved registers for a given
MachineFunction. The backend checks that it does not need to write to
any reserved register; if it does a relevant error is generated.

Differential Revision: https://reviews.llvm.org/D67185
2019-10-22 21:25:01 +01:00
Yaxun (Sam) Liu 68f5ca4e19 [HIP] Add option -fgpu-allow-device-init
Add this option to allow device side class type global variables
with non-trivial ctor/dtor. device side init/fini functions will
be emitted, which will be executed by HIP runtime when
the fat binary is loaded/unloaded.

This feature is to facilitate implementation of device side
sanitizer which requires global vars with non-trival ctors.

By default this option is disabled.

Differential Revision: https://reviews.llvm.org/D69268
2019-10-22 16:06:20 -04:00
Roman Lebedev 4334892e7b
[DAGCombine][ARM] x ==/!= c -> (x - c) ==/!= 0 iff '-c' can be folded into the x node.
Summary:
This fold, helps recover from the rest of the D62266 ARM regressions.
https://rise4fun.com/Alive/TvpC

Note that while the fold is quite flexible, i've restricted it
to the single interesting pattern at the moment.

Reviewers: efriedma, craig.topper, spatel, RKSimon, deadalnix

Reviewed By: deadalnix

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

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D62450
2019-10-22 22:56:35 +03:00
Roman Lebedev 9b1419a9e5
[NFC][LVI][CVP] Tests where pre-specified `add` no-wrap flags could be used by LVI
There's `ConstantRange::addWithNoWrap()`, LVI could use it to further
constrain the range, if an `add` already has some no-wrap flags specified.
2019-10-22 22:54:57 +03:00
Stanislav Mekhanoshin f9b1dc5553 [AMDGPU] Updated fold-vgpr-copy.mir test. NFC. 2019-10-22 12:43:23 -07:00
Michael Liao a7cebfe9c0 Relax assertions when there's really no entries. [NFC] 2019-10-22 15:26:30 -04:00
Kit Barton 8be5827f85 Test commit - add clarification to README regarding Darwin. 2019-10-22 11:39:15 -07:00
Stanislav Mekhanoshin 48f57138be [AMDGPU] Allow tied operand subreg folding
Turns out it makes sense, contrarily to what comment said.

Differential Revision: https://reviews.llvm.org/D69287
2019-10-22 11:27:36 -07:00
Nico Weber 19ca80ef05 gn build: make sync build work with git revs now that svn is gone 2019-10-22 14:19:35 -04:00
Jonas Devlieghere 0bff9bd26e [lldb] Adjust for the new class_rw_t layout.
The field holding the "ro" will now be a union. If the low bit is set,
then it isn't an ro and it needs to be dereferenced once more to get to
it. If the low bit isn't set, then it is a proper class_ro_t

No dedicated test is needed as this code path will trigger when running
the existing Objective-C tests under a current version of the runtime.
2019-10-22 10:22:06 -07:00
Tom Stellard 3bf7fddeb0 Update git-llvm script to push to GitHub
Summary:
Note: This patch should not be pushed until SVN has become read-only.
It should be the first patch committed directly to GitHub.

This patch updates git-llvm to check for merge commits and then push
changes to GitHub if none are found.  All logic related to SVN has been
removed.

Reviewers: jyknight

Subscribers: lenary, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67772
2019-10-22 16:23:25 +00:00
David Green 186155b89c [InstCombine] Signed saturation patterns
This adds an instcombine matcher for code that attempts to perform signed
saturating arithmetic by casting to a higher type. Unsigned cases are already
matched, this adds extra matches for the more complex signed cases, which
involves matching the min(max(add a b)) nodes with proper extends to ensure
legality.

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

llvm-svn: 375505
2019-10-22 15:39:47 +00:00
Zoe Carver 40c47680eb [libcxx] Remove shared_ptr::make_shared
Summary: This patch removes `shared_ptr::make_shared` as it is not part of the standard. This patch also adds __create_with_cntrl_block, which is a help function that can be used in std::allocate_shared and std::make_shared. This is the third patch (out of 4) from D66178.

    Reviewers: EricWF, mclow.lists, ldionne

    Subscribers: christof, dexonsmith, libcxx-commits

    Tags: #libc

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

llvm-svn: 375504
2019-10-22 15:16:49 +00:00
David Green 3ef017d066 [InstCombine] Signed saturation tests. NFC
llvm-svn: 375503
2019-10-22 14:49:40 +00:00
Petar Avramovic 95290827d7 [MIParser] Set RegClassOrRegBank during instruction parsing
MachineRegisterInfo::createGenericVirtualRegister sets
RegClassOrRegBank to static_cast<RegisterBank *>(nullptr).
MIParser on the other hand doesn't. When we attempt to constrain
Register Class on such VReg, additional COPY is generated.
This way we avoid COPY instructions showing in test that have MIR
input while they are not present with llvm-ir input that was used
to create given MIR for a -run-pass test.

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

llvm-svn: 375502
2019-10-22 14:25:37 +00:00
Petar Avramovic e4af9de36c [MIPS GlobalISel] Select MSA vector generic and builtin add
Select vector G_ADD for MIPS32 with MSA. We have to set bank
for vector operands to fprb and selectImpl will do the rest.
__builtin_msa_addv_<format> will be transformed into G_ADD
in legalizeIntrinsic and selected in the same way.
__builtin_msa_addvi_<format> will be directly selected into
ADDVI_<format> in legalizeIntrinsic. MIR tests for it have
unnecessary additional copies. Capture current state of tests
with run-pass=legalizer with a test in test/CodeGen/MIR/Mips.

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

llvm-svn: 375501
2019-10-22 13:51:57 +00:00
Eugene Leviant e5dd30f77e [ThinLTO] Add code comment. NFC
llvm-svn: 375500
2019-10-22 12:57:23 +00:00
Guillaume Chatelet 5b99c189b3 [Alignment][NFC] Convert StoreInst to MaybeAlign
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

Subscribers: hiraditya, jfb, llvm-commits

Tags: #llvm

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

llvm-svn: 375499
2019-10-22 12:55:32 +00:00
Guillaume Chatelet 734c74ba14 [Alignment][NFC] Convert LoadInst to MaybeAlign
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

Subscribers: hiraditya, jfb, llvm-commits

Tags: #llvm

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

llvm-svn: 375498
2019-10-22 12:35:55 +00:00
Nemanja Ivanovic f2c8f3b181 [PowerPC] Turn on CR-Logical reducer pass
This re-commits r375152 which was pulled in r375233 because it broke
the EXPENSIVE_CHECKS bot on Windows.

The reason for the failure was a bug in the pass that the commit turned
on by default. This patch fixes that bug and turns the pass back on.
This patch has been verified on the buildbot that originally failed
thanks to Simon Pilgrim.

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

llvm-svn: 375497
2019-10-22 12:20:38 +00:00
Guillaume Chatelet 8e050e41a4 [Alignment][NFC] Use MaybeAlign in AttrBuilder
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

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 375496
2019-10-22 11:57:52 +00:00
Guillaume Chatelet 17f5d2b1a5 [Alignment][NFC] Attributes use Align/MaybeAlign
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

Subscribers: jholewinski, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 375495
2019-10-22 09:51:06 +00:00
Eugene Leviant 0f4186779e [ThinLTO] Don't internalize during promotion
Differential revision: https://reviews.llvm.org/D69107

llvm-svn: 375493
2019-10-22 09:24:12 +00:00
George Rimar 78d632d105 [LLVMDebugInfoPDB] - Use cantFail() instead of assert().
Currently injected-sources-native.test fails with "Expected<T>
value was in success state.
(Note: Expected<T> values in success mode must still be checked
prior to being destroyed)"
when llvm is compiled with LLVM_ENABLE_ABI_BREAKING_CHECKS in Release.

The problem is that getStringForID returns Expected<StringRef>
and Expected value must always be checked, even if it is in success state.
Checking with assert only helps in Debug and is wrong.

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

llvm-svn: 375492
2019-10-22 08:52:45 +00:00
Benjamin Kramer ecc999101a [FrontendTests] Try again to make test not write an output file
Setting the output stream to nulls seems to work.

llvm-svn: 375491
2019-10-22 08:44:34 +00:00
Rainer Orth 1876e6c83c [builtins][test] Avoid unportable mmap call in clear_cache_test.c
Within the last two weeks, the Builtins-*-sunos :: clear_cache_test.c started to FAIL
on Solaris.  Running it under truss shows

  mmap(0x00000000, 128, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, 0, 0) Err#22 EINVAL
  _exit(1)

While there are several possible reasons mmap can return EINVAL on Solaris, it turns
out it's this one (from mmap(2)):

  MAP_ANON  was  specified,  but the file descriptor was not
   -1.

And indeed even the Linux mmap(2) documents this as unportable:

  MAP_ANONYMOUS
          The mapping is not backed by any file; its contents are initial‐
          ized to zero.  The fd argument is ignored; however, some  imple‐
          mentations require fd to be -1 if MAP_ANONYMOUS (or MAP_ANON) is
          specified, and portable applications should  ensure  this.   The

This patch follows this advise.  Tested on x86_64-pc-linux-gnu, amd64-pc-solaris2.11
and sparcv9-sun-solaris2.11.

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

llvm-svn: 375490
2019-10-22 08:44:25 +00:00
Benjamin Kramer 2108a974f7 Revert "[FrontendTests] Don't actually run the full compiler, parsing is sufficient."
This reverts commit 375488.

llvm-svn: 375489
2019-10-22 08:37:15 +00:00
Benjamin Kramer 3ca2b17f84 [FrontendTests] Don't actually run the full compiler, parsing is sufficient.
llvm-svn: 375488
2019-10-22 08:10:51 +00:00
Benjamin Kramer 64226b2df6 [clang-fuzzer] Update proto fuzzer example for r375453.
llvm-svn: 375487
2019-10-22 07:51:37 +00:00
Martin Storsjo 3fe1c88bb2 [CMake] [WinMsvc] Look for includes and libs in ${MSVC_BASE}/atlmfc
This is necessary if building with the DIA SDK enabled.

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

llvm-svn: 375486
2019-10-22 06:36:27 +00:00