platform/upstream/llvm.git
5 years ago[SLP] limit vectorization of Constant subclasses (PR33958)
Sanjay Patel [Sun, 15 Sep 2019 13:03:24 +0000 (13:03 +0000)]
[SLP] limit vectorization of Constant subclasses (PR33958)

This is a fix for:
https://bugs.llvm.org/show_bug.cgi?id=33958

It seems universally true that we would not want to transform this kind of
sequence on any target, but if that's not correct, then we could view this
as a target-specific cost model problem. We could also white-list ConstantInt,
ConstantFP, etc. rather than blacklist Global and ConstantExpr.

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

llvm-svn: 371931

5 years ago[ARM] Simplify and update vmla test. NFC
David Green [Sun, 15 Sep 2019 11:53:05 +0000 (11:53 +0000)]
[ARM] Simplify and update vmla test. NFC

llvm-svn: 371930

5 years ago[CodeEmitter] Improve testing for APInt encoding
James Molloy [Sun, 15 Sep 2019 08:44:40 +0000 (08:44 +0000)]
[CodeEmitter] Improve testing for APInt encoding

I missed Artem's comment in D67487 before committing.

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

llvm-svn: 371929

5 years ago[CodeEmitter] Support instruction widths > 64 bits
James Molloy [Sun, 15 Sep 2019 08:35:08 +0000 (08:35 +0000)]
[CodeEmitter] Support instruction widths > 64 bits

Some VLIW instruction sets are Very Long Indeed. Using uint64_t constricts the Inst encoding to 64 bits (naturally).

This change switches CodeEmitter to a mode that uses APInts when Inst's bitwidth is > 64 bits (NFC for existing targets).

When Inst.BitWidth > 64 the prototype changes to:

  void TargetMCCodeEmitter::getBinaryCodeForInstr(const MCInst &MI,
                                                  SmallVectorImpl<MCFixup> &Fixups,
                                                  APInt &Inst,
                                                  APInt &Scratch,
                                                  const MCSubtargetInfo &STI);

The Inst parameter returns the encoded instruction, the Scratch parameter is used internally for manipulating operands and is exposed so that the underlying storage can be reused between calls to getBinaryCodeForInstr. The goal is to elide any APInt constructions that we can.

Similarly the operand encoding prototype changes to:

  getMachineOpValue(const MCInst &MI, const MCOperand &MO, APInt &op, SmallVectorImpl<MCFixup> &Fixups, const MCSubtargetInfo &STI);

That is, the operand is passed by reference as APInt rather than returned as uint64_t.

To reiterate, this APInt mode is enabled only when Inst.BitWidth > 64, so this change is NFC for existing targets.

llvm-svn: 371928

5 years agolld-link: Make Options.td formatting more self-consistent.
Nico Weber [Sat, 14 Sep 2019 23:41:42 +0000 (23:41 +0000)]
lld-link: Make Options.td formatting more self-consistent.

Also tighten up help strings for /force, --start-lib, and --end-lib.

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

llvm-svn: 371927

5 years agocompiler-rt/builtins: Make check-builtins run tests on macOS.
Nico Weber [Sat, 14 Sep 2019 22:22:47 +0000 (22:22 +0000)]
compiler-rt/builtins: Make check-builtins run tests on macOS.

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

llvm-svn: 371926

5 years agoAdd debug check for null pointers passed to <string_view>
Eric Fiselier [Sat, 14 Sep 2019 19:55:28 +0000 (19:55 +0000)]
Add debug check for null pointers passed to <string_view>

llvm-svn: 371925

5 years ago[Diagnostics] Added silence note for -Wsizeof-array-div; suggest extra parens
David Bolvansky [Sat, 14 Sep 2019 19:38:55 +0000 (19:38 +0000)]
[Diagnostics] Added silence note for -Wsizeof-array-div; suggest extra parens

llvm-svn: 371924

5 years ago[TargetLowering] SimplifyDemandedBits - add EXTRACT_SUBVECTOR support.
Simon Pilgrim [Sat, 14 Sep 2019 16:38:26 +0000 (16:38 +0000)]
[TargetLowering] SimplifyDemandedBits - add EXTRACT_SUBVECTOR support.

Call SimplifyDemandedBits on the source vector.

llvm-svn: 371923

5 years ago[lldb] Code cleanup: FormattersContainer.h: Use range-based for loops.
Jan Kratochvil [Sat, 14 Sep 2019 15:46:51 +0000 (15:46 +0000)]
[lldb] Code cleanup: FormattersContainer.h: Use range-based for loops.

Suggested for an other loop by Pavel Labath in:
https://reviews.llvm.org/D66654#inline-605808

llvm-svn: 371922

5 years ago[InstSimplify] simplifyUnsignedRangeCheck(): handle few tautological cases (PR43251)
Roman Lebedev [Sat, 14 Sep 2019 13:47:27 +0000 (13:47 +0000)]
[InstSimplify] simplifyUnsignedRangeCheck(): handle few tautological cases (PR43251)

Summary:
This is split off from D67356, since these cases produce a constant,
no real need to keep them in instcombine.

Alive proofs:
https://rise4fun.com/Alive/u7Fk
https://rise4fun.com/Alive/4lV

https://bugs.llvm.org/show_bug.cgi?id=43251

Reviewers: spatel, nikic, xbolva00

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 371921

5 years ago[clang-scan-deps] Add -M to work around -MT issue after r371918
Fangrui Song [Sat, 14 Sep 2019 07:25:27 +0000 (07:25 +0000)]
[clang-scan-deps] Add -M to work around -MT issue after r371918

gcc will complain if -MT is used but neither -M nor -MM is specified:

> cc1: error: to generate dependencies you must specify either -M or -MM

r371918 changed our behavior to match GCC, but apparently
clang-scan-deps is not happy.

llvm-svn: 371920

5 years ago[Driver] Fix multiple bugs related to dependency file options: -M -MM -MD -MMD -MT -MQ
Fangrui Song [Sat, 14 Sep 2019 06:01:22 +0000 (06:01 +0000)]
[Driver] Fix multiple bugs related to dependency file options: -M -MM -MD -MMD -MT -MQ

-M -o test.i => dependency file is test.d, not test.i
-MM -o test.i => dependency file is test.d, not test.i
-M -MMD => bogus warning -Wunused-command-line-argument
-M MT dummy => -w not rendered

llvm-svn: 371918

5 years ago[Driver] Improve Clang::getDependencyFileName and its tests after rC371853
Fangrui Song [Sat, 14 Sep 2019 04:13:15 +0000 (04:13 +0000)]
[Driver] Improve Clang::getDependencyFileName and its tests after rC371853

The test file name metadata-with-dots.c is confusing because -MD and -MMD
have nothing to do with metadata.

llvm-svn: 371917

5 years ago[ScheduleDAGMILive] Fix typo in comment.
Mingjie Xing [Sat, 14 Sep 2019 03:27:38 +0000 (03:27 +0000)]
[ScheduleDAGMILive] Fix typo in comment.

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

llvm-svn: 371916

5 years ago[Attributor][Fix] Use right type to replace expressions
Johannes Doerfert [Sat, 14 Sep 2019 02:57:50 +0000 (02:57 +0000)]
[Attributor][Fix] Use right type to replace expressions

Summary: This should be obsolete once the functionality in D66967 is integrated.

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

llvm-svn: 371915

5 years ago[llvm-objcopy] Ignore -B --binary-architecture=
Fangrui Song [Sat, 14 Sep 2019 01:36:31 +0000 (01:36 +0000)]
[llvm-objcopy] Ignore -B --binary-architecture=

GNU objcopy documents that -B is only useful with architecture-less
input (i.e. "binary" or "ihex"). After D67144, -O defaults to -I, and
-B is essentially a NOP.

* If -O is binary/ihex, GNU objcopy ignores -B.
* If -O is elf*, -B provides the e_machine field in GNU objcopy.

So to convert a blob to an ELF, `-I binary -B i386:x86-64 -O elf64-x86-64` has to be specified.

`-I binary -B i386:x86-64 -O elf64-x86-64` creates an ELF with its
e_machine field set to EM_NONE in GNU objcopy, but a regular x86_64 ELF
in elftoolchain elfcopy. Follow the elftoolchain approach (ignoring -B)
to simplify code. Users that expect their command line portable should
specify -B.

Reviewed By: jhenderson

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

llvm-svn: 371914

5 years ago[llvm-objcopy] Default --output-target to --input-target when unspecified
Fangrui Song [Sat, 14 Sep 2019 01:36:16 +0000 (01:36 +0000)]
[llvm-objcopy] Default --output-target to --input-target when unspecified

Fixes PR42171.

In GNU objcopy, if -O (--output-target) is not specified, the value is
copied from -I (--input-target).

```
objcopy -I binary -B i386:x86-64 a.txt b       # b is copied from a.txt
llvm-objcopy -I binary -B i386:x86-64 a.txt b  # b is an x86-64 object file
```

This patch changes our behavior to match GNU. With this change, we can
delete code related to -B handling (D67215).

Reviewed By: jakehehrlich

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

llvm-svn: 371913

5 years ago[llvm-ar] Uncapitalize error messages and delete full stop
Fangrui Song [Sat, 14 Sep 2019 01:18:47 +0000 (01:18 +0000)]
[llvm-ar] Uncapitalize error messages and delete full stop

Most GNU binutils don't append full stops in error messages. This
convention has been adopted by a bunch of LLVM binary utilities. Make
llvm-ar follow the convention as well.

Reviewed By: grimar

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

llvm-svn: 371912

5 years ago[llvm-objcopy] Add support for response files in llvm-strip and llvm-objcopy
Michael Pozulp [Sat, 14 Sep 2019 01:14:43 +0000 (01:14 +0000)]
[llvm-objcopy] Add support for response files in llvm-strip and llvm-objcopy

Summary: Addresses https://bugs.llvm.org/show_bug.cgi?id=42671

Reviewers: jhenderson, espindola, alexshap, rupprecht

Reviewed By: jhenderson

Subscribers: seiya, emaste, arichardson, jakehehrlich, MaskRay, abrachet, llvm-commits

Tags: #llvm

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

llvm-svn: 371911

5 years agoBugpoint: Remove some unnecessary c_str conversions on the journey to StringRef
David Blaikie [Sat, 14 Sep 2019 00:32:13 +0000 (00:32 +0000)]
Bugpoint: Remove some unnecessary c_str conversions on the journey to StringRef

llvm-svn: 371910

5 years ago[Reproducer] Add reproducer dump command.
Jonas Devlieghere [Fri, 13 Sep 2019 23:27:31 +0000 (23:27 +0000)]
[Reproducer] Add reproducer dump command.

This adds a reproducer dump commands which makes it possible to inspect
a reproducer from inside LLDB. Currently it supports the Files, Commands
and Version providers. I'm planning to add support for the GDB Remote
provider in a follow-up patch.

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

llvm-svn: 371909

5 years ago[Reproducer] Move GDB Remote Packet into Utility. (NFC)
Jonas Devlieghere [Fri, 13 Sep 2019 23:14:10 +0000 (23:14 +0000)]
[Reproducer] Move GDB Remote Packet into Utility. (NFC)

To support dumping the reproducer's GDB remote packets, we need the
(de)serialization logic to live in Utility rather than the GDB remote
plugin. This patch renames StreamGDBRemote to GDBRemote and moves the
relevant packet code there.

Its uses in the GDBRemoteCommunicationHistory and the
GDBRemoteCommunicationReplayServer are updated as well.

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

llvm-svn: 371907

5 years ago[WebAssembly] Narrowing and widening SIMD ops
Thomas Lively [Fri, 13 Sep 2019 22:54:41 +0000 (22:54 +0000)]
[WebAssembly] Narrowing and widening SIMD ops

Summary:
Implements target-specific LLVM intrinsics and clang builtins for
these new SIMD operations, as described at https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md#integer-to-integer-narrowing.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

llvm-svn: 371906

5 years ago[test] Update TestAPILog to pass on Windows.
Jonas Devlieghere [Fri, 13 Sep 2019 22:14:59 +0000 (22:14 +0000)]
[test] Update TestAPILog to pass on Windows.

The pretty function macro is including __cdecl on Windows, which was
causing the pattern matching to fail. This should fix that.

llvm-svn: 371905

5 years agoMake test check position independent as they sometimes come out reversed. NFCI.
Douglas Yung [Fri, 13 Sep 2019 22:12:27 +0000 (22:12 +0000)]
Make test check position independent as they sometimes come out reversed. NFCI.

llvm-svn: 371904

5 years ago[clang-scan-deps] Fix for headers having the same name as a directory
Alex Lorenz [Fri, 13 Sep 2019 22:12:02 +0000 (22:12 +0000)]
[clang-scan-deps] Fix for headers having the same name as a directory

Scan deps tool crashes when called on a C++ file, containing an include
that has the same name as a directory.
The tool crashes since it finds foo/dir and tries to read that as a file and fails.

Patch by: kousikk (Kousik Kumar)

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

llvm-svn: 371903

5 years ago[LLDB] Add missing breaks for switch statement
Tim Shen [Fri, 13 Sep 2019 22:00:03 +0000 (22:00 +0000)]
[LLDB] Add missing breaks for switch statement

llvm-svn: 371902

5 years ago[GlobalISel] Fix insertion point of new instructions to be after PHIs.
Amara Emerson [Fri, 13 Sep 2019 21:49:24 +0000 (21:49 +0000)]
[GlobalISel] Fix insertion point of new instructions to be after PHIs.

For some reason we sometimes insert new instructions one instruction before
the first non-PHI when legalizing. This can result in having non-PHI
instructions before PHIs, which mean that PHI elimination doesn't catch them.

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

llvm-svn: 371901

5 years ago[NFC][libLTO] Rearrange declaration in lto.h
Steven Wu [Fri, 13 Sep 2019 21:19:12 +0000 (21:19 +0000)]
[NFC][libLTO] Rearrange declaration in lto.h

Summary:
Rearrange the function declaration in lto.h so they falls in the correct
doxygen group.

Reviewers: tejohnson, bd1976llvm, deadalnix

Reviewed By: tejohnson

Subscribers: mehdi_amini, inglorion, jkorous, dexonsmith, ributzka, llvm-commits

Tags: #llvm

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

llvm-svn: 371900

5 years ago[test] Print the log output on failure.
Jonas Devlieghere [Fri, 13 Sep 2019 21:15:03 +0000 (21:15 +0000)]
[test] Print the log output on failure.

This ensures that if the assertion fails we dump the log content. This
should help me investigate what the output looks like on Windows, where
the test is failing.

llvm-svn: 371899

5 years agoAdd dependency from Orc to Passes
Sanjoy Das [Fri, 13 Sep 2019 21:07:56 +0000 (21:07 +0000)]
Add dependency from Orc to Passes

Summary: Orc uses registerFunctionAnalyses that's defined in Passes.

Reviewers: dblaikie

Subscribers: mcrosier, bixia, llvm-commits

Tags: #llvm

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

llvm-svn: 371898

5 years agoFix test to use %t for newly created files.
Tim Shen [Fri, 13 Sep 2019 21:06:47 +0000 (21:06 +0000)]
Fix test to use %t for newly created files.

This is both for consistency with other `mkdir`s in tests, and
fixing permission issues with the non-temporary cwd during testing (they
are not always writable).

llvm-svn: 371897

5 years ago[llvm-opt-report] Improve error handling
Francis Visoiu Mistrih [Fri, 13 Sep 2019 20:52:04 +0000 (20:52 +0000)]
[llvm-opt-report] Improve error handling

* std::move the error extracted from the parsing creation to avoid asserts
* print a newline after the error message
* create the parser from the metadata

llvm-svn: 371895

5 years agoFix C++03 build failures due to >>
Eric Fiselier [Fri, 13 Sep 2019 20:30:45 +0000 (20:30 +0000)]
Fix C++03 build failures due to >>

llvm-svn: 371894

5 years ago[AArch64][GlobalISel] Tail call memory intrinsics
Jessica Paquette [Fri, 13 Sep 2019 20:25:58 +0000 (20:25 +0000)]
[AArch64][GlobalISel] Tail call memory intrinsics

Because memory intrinsics are handled differently than other calls, we need to
check them for tail call eligiblity in the legalizer. This allows us to still
inline them when it's beneficial to do so, but also tail call when possible.

This adds simple tail calling support for when the intrinsic is followed by a
return.

It ports the attribute checks from `TargetLowering::isInTailCallPosition` into
a similarly-named function in LegalizerHelper.cpp. The target-specific
`isUsedByReturnOnly` hook is not ported here.

Update tailcall-mem-intrinsics.ll to show that GlobalISel can now tail call
memory intrinsics.

Update legalize-memcpy-et-al.mir to have a case where we don't tail call.

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

llvm-svn: 371893

5 years ago[OPENMP5.0]Add basic support for declare variant directive.
Alexey Bataev [Fri, 13 Sep 2019 20:18:17 +0000 (20:18 +0000)]
[OPENMP5.0]Add basic support for declare variant directive.

Added basic support for declare variant directive and its match clause
with user context selector.

llvm-svn: 371892

5 years ago[Support] Add overload writeFileAtomically(std::function Writer)
Jan Korous [Fri, 13 Sep 2019 20:08:27 +0000 (20:08 +0000)]
[Support] Add overload writeFileAtomically(std::function Writer)

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

llvm-svn: 371890

5 years ago[Docs] Bug fix for reference to nonexistent document
DeForest Richards [Fri, 13 Sep 2019 20:05:57 +0000 (20:05 +0000)]
[Docs] Bug fix for reference to nonexistent document

This commit fixes a bug in which the toctree contained a reference to a non-existent document.

llvm-svn: 371889

5 years ago[FPEnv] Document that constrained FP intrinsics cannot be mixed with non-constrained
Kevin P. Neal [Fri, 13 Sep 2019 19:36:19 +0000 (19:36 +0000)]
[FPEnv] Document that constrained FP intrinsics cannot be mixed with non-constrained

Reviewed by: andrew.w.kaylor, cameron.mcinally, uweigand
Approved by: andrew.w.kaylor
Differential Revision: https://reviews.llvm.org/D67360

llvm-svn: 371888

5 years ago[aarch64] move custom isel of extract_vector_elt to td file - NFC
Sebastian Pop [Fri, 13 Sep 2019 19:28:30 +0000 (19:28 +0000)]
[aarch64] move custom isel of extract_vector_elt to td file - NFC

In preparation for def-pat selection of dot product instructions,
this patch moves the custom instruction selection of extract_vector_elt
to the td file. Without this change it is impossible to catch a pattern that
starts with an extract_vector_elt: the custom cpp code is executed first
ahead of the patterns in the td files that are only executed at the end of
the switch statement in SelectCode(Node).

With this patch applied, it becomes possible to select a different pattern
that starts with extract_vector_elt by selecting a higher complexity than
this pattern.

The patch has been tested on aarch64-linux with make check-all.

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

llvm-svn: 371887

5 years agoMark [[nodiscard]] test as unsupported with GCC 5
Eric Fiselier [Fri, 13 Sep 2019 19:09:29 +0000 (19:09 +0000)]
Mark [[nodiscard]] test as unsupported with GCC 5

llvm-svn: 371886

5 years ago[Reproducer] Include the this pointer in the API log.
Jonas Devlieghere [Fri, 13 Sep 2019 19:08:10 +0000 (19:08 +0000)]
[Reproducer] Include the this pointer in the API log.

The new centralized way of doing API logging through the reproducer
macros is lacking a way to easily correlate instances of API objects.
Logging the this pointer makes that significantly easier. For methods
this is now always passed as the first argument, similar to the self
argument in Python.

This patch also adds a test case for API logging, which uncovered that
we were not quoting strings.

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

llvm-svn: 371885

5 years agoFix pretty printer test with GCC
Eric Fiselier [Fri, 13 Sep 2019 19:04:33 +0000 (19:04 +0000)]
Fix pretty printer test with GCC

llvm-svn: 371884

5 years agoAArch64: fix EXPENSIVE_CHECKS for arm64_32.
Tim Northover [Fri, 13 Sep 2019 18:55:38 +0000 (18:55 +0000)]
AArch64: fix EXPENSIVE_CHECKS for arm64_32.

For some reason I'd decided to mark the end-result of a GOT load as
dead. It's clearly not (necessarily).

llvm-svn: 371883

5 years agoFix error in ProcessLauncherWindows.cpp
Adrian McCarthy [Fri, 13 Sep 2019 18:50:39 +0000 (18:50 +0000)]
Fix error in ProcessLauncherWindows.cpp

Restored missing parens on a function call.

llvm-svn: 371882

5 years agoUpdate XFAIL list for new GCC versions
Eric Fiselier [Fri, 13 Sep 2019 18:43:29 +0000 (18:43 +0000)]
Update XFAIL list for new GCC versions

llvm-svn: 371881

5 years agoFix various test failures with GCC
Eric Fiselier [Fri, 13 Sep 2019 18:40:46 +0000 (18:40 +0000)]
Fix various test failures with GCC

llvm-svn: 371880

5 years ago[SLP] add test for vectorization of constant expressions; NFC
Sanjay Patel [Fri, 13 Sep 2019 18:33:02 +0000 (18:33 +0000)]
[SLP] add test for vectorization of constant expressions; NFC

Goes with D67362.

llvm-svn: 371879

5 years agoReland r371785: Add -Wpoison-system-directories warning
Manoj Gupta [Fri, 13 Sep 2019 18:00:51 +0000 (18:00 +0000)]
Reland r371785: Add -Wpoison-system-directories warning

When using clang as a cross-compiler, we should not use system
headers to do the compilation.
This CL adds support of a new warning flag -Wpoison-system-directories which
emits warnings if --sysroot is set and headers from common host system location
are used.
By default the warning is disabled.

The intention of the warning is to catch bad includes which are usually
generated by third party build system not targeting cross-compilation.
Such cases happen in Chrome OS when someone imports a new package or upgrade
one to a newer version from upstream.

This is reland of r371785 with a fix to test file.

Patch by: denik (Denis Nikitin)

llvm-svn: 371878

5 years ago[NFC][InstSimplify] Add some more tests for D67498/D67502
Roman Lebedev [Fri, 13 Sep 2019 17:58:24 +0000 (17:58 +0000)]
[NFC][InstSimplify] Add some more tests for D67498/D67502

llvm-svn: 371877

5 years agoFix build error in 371875
Erich Keane [Fri, 13 Sep 2019 17:56:38 +0000 (17:56 +0000)]
Fix build error in 371875

Apparently Clang complains about the name hiding here in a way that my
GCC build does not, so a shocking number of buildbots decided to tell me
about it.  Change the name of the variable to prevent the name hiding
and hope we don't have to fix this again.

llvm-svn: 371876

5 years ago[NFCI]Create CommonAttributeInfo Type as base type of *Attr and ParsedAttr.
Erich Keane [Fri, 13 Sep 2019 17:39:31 +0000 (17:39 +0000)]
[NFCI]Create CommonAttributeInfo Type as base type of *Attr and ParsedAttr.

In order to enable future improvements to our attribute diagnostics,
this moves info from ParsedAttr into CommonAttributeInfo, then makes
this type the base of the *Attr and ParsedAttr types. Quite a bit of
refactoring took place, including removing a bunch of redundant Spelling
Index propogation.

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

llvm-svn: 371875

5 years agoFix failing negative compilation test for some versions of Clang
Eric Fiselier [Fri, 13 Sep 2019 17:39:06 +0000 (17:39 +0000)]
Fix failing negative compilation test for some versions of Clang

llvm-svn: 371874

5 years agoRevert for: [AMDGPU]: PHI Elimination hooks added for custom COPY insertion.
Alexander Timofeev [Fri, 13 Sep 2019 17:37:30 +0000 (17:37 +0000)]
Revert for: [AMDGPU]: PHI Elimination hooks added for custom COPY insertion.

llvm-svn: 371873

5 years agoFix bug in `darwin_test_archs()` when the cache variable is set but empty.
Dan Liew [Fri, 13 Sep 2019 17:31:24 +0000 (17:31 +0000)]
Fix bug in `darwin_test_archs()` when the cache variable is set but empty.

Summary:
If the cache variable named in `${valid_archs}` (e.g. `DARWIN_osx_BUILTIN_ARCHS`)
is set in the cache but is empty then the cache check
`if(${valid_archs})` will be false so the function will probe the
compiler but the `set(...)` command at the end of the function to update
the cache variable will be a no-op. This is because `set(...)` will not
update an existing cache variable unless the `FORCE` argument is
provided.

To fix this this patch adds `FORCE` so the cache is always updated.

rdar://problem/55323665

Reviewers: vsk, kubamracek

Subscribers: mgorny, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 371872

5 years ago[CMake] Separate the detection Darwin platforms architectures for the
Dan Liew [Fri, 13 Sep 2019 17:31:22 +0000 (17:31 +0000)]
[CMake] Separate the detection Darwin platforms architectures for the
built-ins from the rest of compiler-rt.

The detection of supported platform (os) architectures for Darwin relies
on the `darwin_test_archs()` CMake function. This is used both for
building the builtins (`builtin-config-ix.cmake`) and for the rest of
the compiler-rt (`config-ix.cmake`).

`darwin_test_archs()`  implements a cache, presumably to speed up CMake
re-configures.  Unfortunately this caching is buggy because it depends
on external global state (i.e. the `TEST_COMPILE_ONLY` variable) and
this is not taken into account. For `config-ix.cmake`
`TEST_COMPILE_ONLY` is not set and for `builtin-config-ix.cmake`
`TEST_COMPILE_ONLY` is set to `On`.  This makes the
`darwin_test_archs()` function racey in the sense that a call from one
calling context will poison the cache for the other calling context.

This is actually an issue George Karpenkov discovered a while back
and had an incomplete patch for (https://reviews.llvm.org/D45337)
but this was never merged.

To workaround this, this patch switches to using a different set of
variables for the platform architecture builtins, i.e.
`DARWIN_<OS>_ARCHS` -> `DARWIN_<OS>_BUILTIN_ARCHS`. This avoids the
cache poisoning problem because the cached variable names are different.
This also has the advantage that the the configured architectures for
builtins and the rest of the compiler-rt are now independent and
can be set differently if necessary.

Note in `darwin_test_archs()` we also now pass `-w` to the compiler
because `try_compile_only()` treats compiler warnings as errors.  This
was extremely fragile because compiler warnings (can easily appear due
to a buggy compiler or SDK headers) would cause compiler-rt to think an
architecture on Darwin wasn't supported.

rdar://problem/48637491

llvm-svn: 371871

5 years ago[Remarks][NFC] Forward declare ParsedStringTable
Francis Visoiu Mistrih [Fri, 13 Sep 2019 17:27:28 +0000 (17:27 +0000)]
[Remarks][NFC] Forward declare ParsedStringTable

llvm-svn: 371870

5 years ago[Remarks][NFC] Use StringLiteral for magic numbers
Francis Visoiu Mistrih [Fri, 13 Sep 2019 16:46:23 +0000 (16:46 +0000)]
[Remarks][NFC] Use StringLiteral for magic numbers

llvm-svn: 371869

5 years ago[AArch64][GlobalISel] Add support for sibcalling callees with varargs
Jessica Paquette [Fri, 13 Sep 2019 16:10:19 +0000 (16:10 +0000)]
[AArch64][GlobalISel] Add support for sibcalling callees with varargs

This adds support for tail calling callees with varargs, equivalent to how it
is done in AArch64ISelLowering.

This only works for sibling calls, and does not add the necessary support for
musttail with varargs. (See r345641 for equivalent ISelLowering support.) This
should be implemented when we stop falling back on musttail.

Update call-translator-tail-call.ll to show that we can now tail call varargs.

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

llvm-svn: 371868

5 years agoRecommit r370502: Make `vector` unconditionally move elements when
Eric Fiselier [Fri, 13 Sep 2019 16:09:33 +0000 (16:09 +0000)]
Recommit r370502: Make `vector` unconditionally move elements when
exceptions are disabled.

The patch was reverted due to some confusion about non-movable types. ie
types
that explicitly delete their move constructors. However, such types do
not meet
the requirement for `MoveConstructible`, which is required by
`std::vector`:

Summary:

`std::vector<T>` is free choose between using copy or move operations
when it
needs to resize. The standard only candidates that the correct exception
safety
guarantees are provided. When exceptions are disabled these guarantees
are
trivially satisfied. Meaning vector is free to optimize it's
implementation by
moving instead of copying.

This patch makes `std::vector` unconditionally move elements when
exceptions are
disabled. This optimization is conforming according to the current
standard wording.

There are concerns that moving in `-fno-noexceptions`mode will be a
surprise to
users. For example, a user may be surprised to find their code is slower
with
exceptions enabled than it is disabled. I'm sympathetic to this
surprised, but
I don't think it should block this optimization.

Reviewers: mclow.lists, ldionne, rsmith
Reviewed By: ldionne
Subscribers: zoecarver, christof, dexonsmith, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D62228

llvm-svn: 371867

5 years ago[lldb] - Update unit tests after lib/ObjectYAML change.
George Rimar [Fri, 13 Sep 2019 16:00:28 +0000 (16:00 +0000)]
[lldb] - Update unit tests after lib/ObjectYAML change.

An update after r371865

llvm-svn: 371866

5 years ago[yaml2obj/ObjectYAML] - Cleanup the error reporting API, add custom errors handlers.
George Rimar [Fri, 13 Sep 2019 16:00:16 +0000 (16:00 +0000)]
[yaml2obj/ObjectYAML] - Cleanup the error reporting API, add custom errors handlers.

This is a continuation of the YAML library error reporting
refactoring/improvement and the idea by itself was mentioned
in the following thread:
https://reviews.llvm.org/D67182?id=218714#inline-603404

This performs a cleanup of all object emitters in the library.
It allows using the custom one provided by the caller.

One of the nice things is that each tool can now print its tool name,
e.g: "yaml2obj: error: <text>"

Also, the code became a bit simpler.

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

llvm-svn: 371865

5 years agoOnly initialize the streams cout/wcout/cerr/wcerr etc once, rather than any time...
Marshall Clow [Fri, 13 Sep 2019 15:28:06 +0000 (15:28 +0000)]
Only initialize the streams cout/wcout/cerr/wcerr etc once, rather than any time Init::Init is called. Fixes PR#43300

llvm-svn: 371864

5 years agoFix build in C++20
Eric Fiselier [Fri, 13 Sep 2019 15:13:11 +0000 (15:13 +0000)]
Fix build in C++20

llvm-svn: 371863

5 years ago[docs][llvm-readelf][llvm-readobj] Improve --stack-sizes documentation
James Henderson [Fri, 13 Sep 2019 15:01:39 +0000 (15:01 +0000)]
[docs][llvm-readelf][llvm-readobj] Improve --stack-sizes documentation

llvm-readobj's document was missing --stack-sizes entirely from its
document, so this patch adds it. It also adds a note to the llvm-readelf
description that the switch is only implemented for GNU style output
currently. For reference, --stack-sizes was added in r367942.

Reviewed by: MaskRay

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

llvm-svn: 371862

5 years ago[X86] Use incDecVectorConstant to simplify the min/max code in LowerVSETCC.
Craig Topper [Fri, 13 Sep 2019 14:59:08 +0000 (14:59 +0000)]
[X86] Use incDecVectorConstant to simplify the min/max code in LowerVSETCC.

incDecVectorConstant is used for a similar reason in LowerVSETCCWithSUBUS
so we might as well share the code.

llvm-svn: 371861

5 years agoFix a few spellos in docs.
Nico Weber [Fri, 13 Sep 2019 14:58:24 +0000 (14:58 +0000)]
Fix a few spellos in docs.

(Trying to debug an incremental build thing on a bot...)

llvm-svn: 371860

5 years ago[Sema][Typo Correction] Fix potential infite loop on ambiguity checks
David Goldman [Fri, 13 Sep 2019 14:43:24 +0000 (14:43 +0000)]
[Sema][Typo Correction] Fix potential infite loop on ambiguity checks

Summary:
This fixes a bug introduced in D62648, where Clang could infinite loop
if it became stuck on a single TypoCorrection when it was supposed to
be testing ambiguous corrections. Although not a common case, it could
happen if there are multiple possible corrections with the same edit
distance.

The fix is simply to wipe the TypoExpr from the `TransformCache` so that
the call to `TransformTypoExpr` doesn't use the `CachedEntry`.

Reviewers: rsmith

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 371859

5 years agogn build: pacify "gn format" after 371102
Nico Weber [Fri, 13 Sep 2019 14:35:20 +0000 (14:35 +0000)]
gn build: pacify "gn format" after 371102

llvm-svn: 371858

5 years ago[PowerPC][NFC] Move codegen tests to PowerPC from MIR/PowerPC
Jinsong Ji [Fri, 13 Sep 2019 14:18:36 +0000 (14:18 +0000)]
[PowerPC][NFC] Move codegen tests to PowerPC from MIR/PowerPC

All tests with -run-pass !=none should not in MIR/, See MIR/README.

```
Tests for codegen passes should NOT be here but in
test/CodeGen/sometarget. As
a rule of thumb this directory should only contain tests using
'llc -run-pass none'.
```

llvm-svn: 371857

5 years ago[ADT] Remove a workaround for old versions of clang
Benjamin Kramer [Fri, 13 Sep 2019 13:47:49 +0000 (13:47 +0000)]
[ADT] Remove a workaround for old versions of clang

llvm-svn: 371856

5 years ago[docs][llvm-objcopy][llvm-strip] Improve --strip-unneeded description
James Henderson [Fri, 13 Sep 2019 13:26:52 +0000 (13:26 +0000)]
[docs][llvm-objcopy][llvm-strip] Improve --strip-unneeded description

Behaviour was recently added to this switch to strip debug sections too.
See r369761.

This change also makes the description for the --strip-unneeded switch
consistent between the two docs.

Reviewed by: MaskRay

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

llvm-svn: 371855

5 years agoclang-format: Add support for formatting (some) lambdas with explicit template parame...
Nico Weber [Fri, 13 Sep 2019 13:18:55 +0000 (13:18 +0000)]
clang-format: Add support for formatting (some) lambdas with explicit template parameters.

This patch makes cases work where the lambda's template list doesn't
contain any of + - ! ~ / % << | || && ^ == != >= <= ? : true false
(see added FIXME).

Ports r359967 to clang-format.

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

llvm-svn: 371854

5 years agoFix depfile name construction
Luke Cheeseman [Fri, 13 Sep 2019 13:15:35 +0000 (13:15 +0000)]
Fix depfile name construction

- When using -o, the provided filename is using for constructing the depfile
  name (when -MMD is passed).
- The logic looks for the rightmost '.' character and replaces what comes after
  with 'd'.
- This works incorrectly when the filename has no extension and the directories
  have '.' in them (e.g. out.dir/test)
- This replaces the funciton to just llvm::sys::path functionality

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

llvm-svn: 371853

5 years agolld-link: Add a flag /lldignoreenv that makes lld-link ignore env vars.
Nico Weber [Fri, 13 Sep 2019 13:13:52 +0000 (13:13 +0000)]
lld-link: Add a flag /lldignoreenv that makes lld-link ignore env vars.

This is useful for enforcing that builds are independent of the
environment; it can be used when all system library paths are added
via /libpath: already. It's similar ot cl.exe's /X flag.

Since it should also affect %LINK% (the other caller of
`Process::GetEnv` in lld/COFF), the early-option-parsing needs
to move around a bit. The options are:

- Add a manual loop over the argv ArrayRef and look for "/lldignoreenv".
  This repeats the name of the flag in both Options.td and in
  DriverUtils.cpp.

- Add yet another table.ParseArgs() call just for /lldignoreenv before
  adding %LINK%.

- Use the existing early ParseArgs() that's there for --rsp-quoting and use
  it for /lldignoreenv for %LINK% as well. This means --rsp-quoting
  and /lldignoreenv can't be passed via %LINK%.

I went with the third approach.

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

llvm-svn: 371852

5 years agogn build: (manually) merge r371834, take 2
Nico Weber [Fri, 13 Sep 2019 13:07:54 +0000 (13:07 +0000)]
gn build: (manually) merge r371834, take 2

llvm-svn: 371851

5 years agoRevert "gn build: (manually) merge r371834"
Nico Weber [Fri, 13 Sep 2019 13:04:59 +0000 (13:04 +0000)]
Revert "gn build: (manually) merge r371834"

This reverts commit abc7e2b6004cd693cf3b6dedbc7908e099c7ac6a.
The commit was incomplete. I'll revert and reland the full commit,
so that the correct change is a single commit.

llvm-svn: 371850

5 years agogn build: (manually) merge r371834
Nico Weber [Fri, 13 Sep 2019 12:59:06 +0000 (12:59 +0000)]
gn build: (manually) merge r371834

llvm-svn: 371849

5 years agogn build: Merge r371822
Nico Weber [Fri, 13 Sep 2019 12:58:58 +0000 (12:58 +0000)]
gn build: Merge r371822

llvm-svn: 371848

5 years agogn build: (manually) merge r371787
Nico Weber [Fri, 13 Sep 2019 12:58:52 +0000 (12:58 +0000)]
gn build: (manually) merge r371787

llvm-svn: 371847

5 years ago[ADT] Make DenseMap use allocate_buffer
Benjamin Kramer [Fri, 13 Sep 2019 12:32:40 +0000 (12:32 +0000)]
[ADT] Make DenseMap use allocate_buffer

This unlocks some goodies like sized deletion and gets the alignment
right on platforms that chose to provide a lower default new alignment.

llvm-svn: 371846

5 years ago[llvm-size] Fix spelling errors (Berkely -> Berkeley)
James Henderson [Fri, 13 Sep 2019 12:00:42 +0000 (12:00 +0000)]
[llvm-size] Fix spelling errors (Berkely -> Berkeley)

llvm-svn: 371845

5 years ago[Orc] Roll back ThreadPool to std::function
Benjamin Kramer [Fri, 13 Sep 2019 11:59:51 +0000 (11:59 +0000)]
[Orc] Roll back ThreadPool to std::function

MSVC doesn't allow move-only types in std::packaged_task. Boo.

llvm-svn: 371844

5 years ago[Orc] Address the remaining move-capture FIXMEs
Benjamin Kramer [Fri, 13 Sep 2019 11:35:33 +0000 (11:35 +0000)]
[Orc] Address the remaining move-capture FIXMEs

This required spreading unique_function a bit more, which I think is a
good thing.

llvm-svn: 371843

5 years ago[lldb][NFC] Remove ArgEntry::ref member
Raphael Isemann [Fri, 13 Sep 2019 11:26:48 +0000 (11:26 +0000)]
[lldb][NFC] Remove ArgEntry::ref member

The StringRef should always be identical to the C string, so we
might as well just create the StringRef from the C-string. This
might be slightly slower until we implement the storage of ArgEntry
with a string instead of a std::unique_ptr<char[]>. Until then we
have to do the additional strlen on the C string to construct the
StringRef.

llvm-svn: 371842

5 years ago[X86] negateFMAOpcode - extend to support FMADDSUB/FMSUBADD and output negation....
Simon Pilgrim [Fri, 13 Sep 2019 11:22:40 +0000 (11:22 +0000)]
[X86] negateFMAOpcode - extend to support FMADDSUB/FMSUBADD and output negation. NFCI.

Some prep work for PR42863, this change allows us to move all the FMA opcode mappings into the negateFMAOpcode helper.

For the FMADDSUB/FMSUBADD cases, we can only negate the accumulator - any other negations will result in an error.

llvm-svn: 371840

5 years ago[ASTImporter] Add development internals docs
Gabor Marton [Fri, 13 Sep 2019 11:21:52 +0000 (11:21 +0000)]
[ASTImporter] Add development internals docs

Reviewers: a_sidorin, shafik, teemperor, gamesh411, balazske, dkrupp, a.sidorin

Subscribers: rnkovacs, Szelethus, cfe-commits

Tags: #clang

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

llvm-svn: 371839

5 years ago[ARM] Add earlyclobber for cross beat MVE instructions
David Green [Fri, 13 Sep 2019 11:20:17 +0000 (11:20 +0000)]
[ARM] Add earlyclobber for cross beat MVE instructions

rL367544 added @earlyclobbers for the MVE VREV64 instruction. This adds the
same for a number of other 32bit instructions that are similarly unpredictable
if the destination equals the source (due to the cross beat nature of the
instructions).
This includes:
  VCADD.f32
  VCADD.i32
  VCMUL.f32
  VHCADD.s32
  VMULLT/B.s/u32
  VQDMLADH{X}.s32
  VQRDMLADH{X}.s32
  VQDMLSDH{X}.s32
  VQRDMLSDH{X}.s32
  VQDMULLT/B.s32 with Qm and Rm

No tests here as this would require intrinsics (or very interesting codegen) to
manifest. The tests will follow naturally as the intrinsics are added.

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

llvm-svn: 371838

5 years ago[lldb][NFC] Simplify Args::ReplaceArgumentAtIndex
Raphael Isemann [Fri, 13 Sep 2019 10:41:29 +0000 (10:41 +0000)]
[lldb][NFC] Simplify Args::ReplaceArgumentAtIndex

This code is not on any performance critical path that would
justify this shortening optimization. It also makes it possible
to turn 'ref' into a function (as this is the only place where
we modify this ArgEntry member).

llvm-svn: 371836

5 years ago[Clang Interpreter] Initial patch for the constexpr interpreter
Nandor Licker [Fri, 13 Sep 2019 09:46:16 +0000 (09:46 +0000)]
[Clang Interpreter] Initial patch for the constexpr interpreter

Summary:
This patch introduces the skeleton of the constexpr interpreter,
capable of evaluating a simple constexpr functions consisting of
if statements. The interpreter is described in more detail in the
RFC. Further patches will add more features.

Reviewers: Bigcheese, jfb, rsmith

Subscribers: bruno, uenoku, ldionne, Tyker, thegameg, tschuett, dexonsmith, mgorny, cfe-commits

Tags: #clang

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

llvm-svn: 371834

5 years ago[AArch64] More @llvm.fma.f16 tests
Sjoerd Meijer [Fri, 13 Sep 2019 09:44:13 +0000 (09:44 +0000)]
[AArch64] More @llvm.fma.f16 tests

Follow up of rL371321 that added FMA FP16 patterns. This adds more tests
for @llvm.fma.f16. This probably shows we miss one fmsub optimisation
opportunity, which I will look into.

llvm-svn: 371833

5 years agoFix a perl warning: Scalar value @ArgParts[0] better written as $ArgParts[0] at ...
Sylvestre Ledru [Fri, 13 Sep 2019 09:31:19 +0000 (09:31 +0000)]
Fix a perl warning: Scalar value @ArgParts[0] better written as $ArgParts[0] at /usr/share/clang/scan-build-10/libexec/ccc-analyzer line 502.

llvm-svn: 371832

5 years ago[Alignment] Introduce llvm::Align to MCSection
Guillaume Chatelet [Fri, 13 Sep 2019 09:29:59 +0000 (09:29 +0000)]
[Alignment] Introduce llvm::Align to MCSection

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, JDevlieghere

Subscribers: arsenm, sdardis, jvesely, nhaehnle, sbc100, hiraditya, aheejin, jrtc27, atanasyan, llvm-commits

Tags: #llvm

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

llvm-svn: 371831

5 years ago[lib/ObjectYAML] - Change interface to return `bool` instead of `int`. NFCI
George Rimar [Fri, 13 Sep 2019 09:12:38 +0000 (09:12 +0000)]
[lib/ObjectYAML] - Change interface to return `bool` instead of `int`. NFCI

It was suggested in comments for D67445 to split this part.

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

llvm-svn: 371828

5 years ago[ARM] Add support for MVE vmaxv and vminv
Sam Tebbs [Fri, 13 Sep 2019 09:11:46 +0000 (09:11 +0000)]
[ARM] Add support for MVE vmaxv and vminv

This patch adds vecreduce_smax, vecredude_umax, vecreduce_smin, vecreduce_umin and selection for vmaxv and minv.

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

llvm-svn: 371827

5 years ago[llvm-objdump] Fix llvm-objdump --all-headers output order
George Rimar [Fri, 13 Sep 2019 08:56:28 +0000 (08:56 +0000)]
[llvm-objdump] Fix llvm-objdump --all-headers output order

Patch by Justice Adams!

Made llvm-objdump --all-headers output match the order of GNU objdump for compatibility reasons.

Old order of the headers output:
* file header
* section header table
* symbol table
* program header table
* dynamic section

New order of the headers output (GNU compatible):
* file header information
* program header table
* dynamic section
* section header table
* symbol table

(Relevant BugZilla Bug: https://bugs.llvm.org/show_bug.cgi?id=41830)

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

llvm-svn: 371826

5 years ago[Polly] Fix lib/Transform/ScheduleOptimizer.cpp compilation on Solaris
Rainer Orth [Fri, 13 Sep 2019 08:45:06 +0000 (08:45 +0000)]
[Polly] Fix lib/Transform/ScheduleOptimizer.cpp compilation on Solaris

lib/Transform/ScheduleOptimizer.cpp fails to compile on Solaris, both on the 9.x
branch (first noticed when running test-release.sh without -no-polly) and on trunk:

  /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/tools/polly/lib/Transform/ScheduleOptimizer.cpp: In function ‘MicroKernelParamsTy getMicroKernelParams(const llvm::TargetTransformInfo*, polly::MatMulInfoTy)’:
  /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/tools/polly/lib/Transform/ScheduleOptimizer.cpp:914:62: error: call of overloaded ‘sqrt(long unsigned int)’ is ambiguous
    914 |       ceil(sqrt(Nvec * LatencyVectorFma * ThroughputVectorFma) / Nvec) * Nvec;
        |                                                              ^
  In file included from /usr/gcc/9/lib/gcc/x86_64-pc-solaris2.11/9.1.0/include-fixed/math.h:24,
                   from /usr/gcc/9/include/c++/9.1.0/cmath:45,
                   from /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/include/llvm-c/DataTypes.h:28,
                   from /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/include/llvm/Support/DataTypes.h:16,
                   from /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/include/llvm/ADT/Hashing.h:47,
                   from /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/include/llvm/ADT/ArrayRef.h:12,
                   from /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/tools/polly/include/polly/ScheduleOptimizer.h:12,
                   from /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/tools/polly/lib/Transform/ScheduleOptimizer.cpp:48:
  /usr/gcc/9/lib/gcc/x86_64-pc-solaris2.11/9.1.0/include-fixed/iso/math_iso.h:220:21: note: candidate: ‘long double std::sqrt(long double)’
    220 |  inline long double sqrt(long double __X) { return __sqrtl(__X); }
        |                     ^~~~
  /usr/gcc/9/lib/gcc/x86_64-pc-solaris2.11/9.1.0/include-fixed/iso/math_iso.h:186:15:
note: candidate: ‘float std::sqrt(float)’
    186 |  inline float sqrt(float __X) { return __sqrtf(__X); }
        |               ^~~~
  /usr/gcc/9/lib/gcc/x86_64-pc-solaris2.11/9.1.0/include-fixed/iso/math_iso.h:74:15:
note: candidate: ‘double std::sqrt(double)’
     74 | extern double sqrt __P((double));
        |               ^~~~
  /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/tools/polly/lib/Transform/ScheduleOptimizer.cpp:915:67:
error: call of overloaded ‘ceil(long unsigned int)’ is ambiguous
    915 |   int Mr = ceil(Nvec * LatencyVectorFma * ThroughputVectorFma / Nr);
        |                                                                   ^
  In file included from /usr/gcc/9/lib/gcc/x86_64-pc-solaris2.11/9.1.0/include-fixed/math.h:24,
                   from /usr/gcc/9/include/c++/9.1.0/cmath:45,
                   from /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/include/llvm-c/DataTypes.h:28,
                   from /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/include/llvm/Support/DataTypes.h:16,
                   from /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/include/llvm/ADT/Hashing.h:47,
                   from /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/include/llvm/ADT/ArrayRef.h:12,
                   from /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/tools/polly/include/polly/ScheduleOptimizer.h:12,
                   from /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/tools/polly/lib/Transform/ScheduleOptimizer.cpp:48:
  /usr/gcc/9/lib/gcc/x86_64-pc-solaris2.11/9.1.0/include-fixed/iso/math_iso.h:196:21: note: candidate: ‘long double std::ceil(long double)’
    196 |  inline long double ceil(long double __X) { return __ceill(__X); }
        |                     ^~~~
  /usr/gcc/9/lib/gcc/x86_64-pc-solaris2.11/9.1.0/include-fixed/iso/math_iso.h:160:15:
note: candidate: ‘float std::ceil(float)’
    160 |  inline float ceil(float __X) { return __ceilf(__X); }
        |               ^~~~
  /usr/gcc/9/lib/gcc/x86_64-pc-solaris2.11/9.1.0/include-fixed/iso/math_iso.h:76:15:
note: candidate: ‘double std::ceil(double)’
     76 | extern double ceil __P((double));
        |               ^~~~

Fixed by adding casts to disambiguate, checked that it now compiles on both
amd64-pc-solaris2.11 and sparcv9-sun-solaris2.11 and on x86_64-pc-linux-gnu.

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

llvm-svn: 371825

5 years agoRevert "Fix test failures after r371640"
Dmitri Gribenko [Fri, 13 Sep 2019 08:26:59 +0000 (08:26 +0000)]
Revert "Fix test failures after r371640"

This reverts commit r371645, because r371640 was reverted.

llvm-svn: 371824

5 years ago[lldb][NFC] Make ArgEntry::quote private and provide a getter
Raphael Isemann [Fri, 13 Sep 2019 08:26:00 +0000 (08:26 +0000)]
[lldb][NFC] Make ArgEntry::quote private and provide a getter

llvm-svn: 371823