platform/upstream/llvm.git
4 years agoFix buildbot failure due to obsolete CallSite usage
Anna Thomas [Fri, 17 Apr 2020 21:38:20 +0000 (17:38 -0400)]
Fix buildbot failure due to obsolete CallSite usage

Fix buildbot failures due to ef49b1d97e1ac75bff8ff7dec3097b43bcd07e73
(which was a revert of a previous change).

4 years ago[cmake] Temporarily disable building std::filesystem in CrossWinToARMLinux.cmake
Sergej Jaskiewicz [Fri, 17 Apr 2020 21:29:07 +0000 (00:29 +0300)]
[cmake] Temporarily disable building std::filesystem in CrossWinToARMLinux.cmake

4 years agoDon't accidentally create MachineFunctions in mir-debugify/mir-strip-debugify
Daniel Sanders [Fri, 17 Apr 2020 17:24:35 +0000 (10:24 -0700)]
Don't accidentally create MachineFunctions in mir-debugify/mir-strip-debugify

We should only modify existing ones. Previously, we were creating
MachineFunctions for externally-available functions. AFAICT this was benign
in tree but ultimately led to asan bugs in our out of tree target.

4 years agoRevert "[InlineFunction] Update metadata on loads that are return values"
Anna Thomas [Fri, 17 Apr 2020 21:11:21 +0000 (17:11 -0400)]
Revert "[InlineFunction] Update metadata on loads that are return values"

This reverts commit 1d0f757904919d19f1cf5dcd307874bceb1e9efb because of
https://bugs.llvm.org/show_bug.cgi?id=45590. Needs investigation.

4 years agoRevert "[libc++] Use proper shell escaping in the executors"
Louis Dionne [Fri, 17 Apr 2020 21:06:17 +0000 (17:06 -0400)]
Revert "[libc++] Use proper shell escaping in the executors"

This reverts f8452ddfcc, which broke some bots. I'll figure out what's
wrong and commit it again.

4 years agoRemove asserting getters from base Type
Christopher Tetreault [Fri, 17 Apr 2020 20:29:38 +0000 (13:29 -0700)]
Remove asserting getters from base Type

Summary:
Remove asserting vector getters from Type in preparation for the
VectorType refactor. The existence of these functions complicates the
refactor while adding little value.

Reviewers: dexonsmith, sdesmalen, efriedma

Reviewed By: efriedma

Subscribers: cfe-commits, hiraditya, llvm-commits

Tags: #llvm, #clang

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

4 years ago[libc++] Use proper shell escaping in the executors
Louis Dionne [Fri, 17 Apr 2020 20:43:35 +0000 (16:43 -0400)]
[libc++] Use proper shell escaping in the executors

4 years ago[globalisel][legalizer] Expect to lose DebugLocs in dead code
Daniel Sanders [Fri, 17 Apr 2020 18:42:53 +0000 (11:42 -0700)]
[globalisel][legalizer] Expect to lose DebugLocs in dead code

There's not really anything else that can be done with them.
Fortunately, this dead code cleanup doesn't seem to trigger
very often.

4 years ago[globalisel][legalizer] Include newly-dead code in artifact combine checks for DebugL...
Daniel Sanders [Fri, 17 Apr 2020 18:39:54 +0000 (11:39 -0700)]
[globalisel][legalizer] Include newly-dead code in artifact combine checks for DebugLoc loss

This dead code deletion is part of the combine and the combine
results should account for their locations.

4 years ago[globalisel][legalizer] Fix --verify-legalizer-debug-locs values
Daniel Sanders [Fri, 17 Apr 2020 18:25:51 +0000 (11:25 -0700)]
[globalisel][legalizer] Fix --verify-legalizer-debug-locs values

It was using the enum class name, like so:
    =DebugLocVerifyLevel::None                                         -   No verification
Changed it to:
    =none                                                              -   No verification

4 years ago[X86] Remove single incoming value phis from tests for the loop SAD pattern. NFC
Craig Topper [Fri, 17 Apr 2020 20:37:47 +0000 (13:37 -0700)]
[X86] Remove single incoming value phis from tests for the loop SAD pattern. NFC

InstCombine should ensure these don't exist.

I'm looking at making some changes to how we detect these
patterns and not having to worry about these phis will help.

4 years ago[PowerPC] Refactor ppcUserFeaturesCheck()
Lei Huang [Fri, 17 Apr 2020 20:19:46 +0000 (15:19 -0500)]
[PowerPC] Refactor ppcUserFeaturesCheck()

Summary: This function keeps growing, refactor to use lambda.

Reviewers: nemanjai, stefanp

Subscribers: kbarton, shchenz, cfe-commits

Tags: #clang

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

4 years ago[CUDA] Define __CUDACC__ before standard library headers
Raul Tambre [Fri, 17 Apr 2020 19:22:04 +0000 (12:22 -0700)]
[CUDA] Define __CUDACC__ before standard library headers

libstdc++ since version 7 when GNU extensions are enabled (e.g. -std=gnu++11)
use it to avoid defining overloads using `__float128`.  This fixes compiling
with GNU extensions failing due to `__float128` being used.

Discovered at https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4442#note_737136.

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

4 years ago[Float2Int] Make iteration over Roots deterministic
Bjorn Pettersson [Fri, 10 Apr 2020 17:24:11 +0000 (19:24 +0200)]
[Float2Int] Make iteration over Roots deterministic

Summary:
Use a SmallSetVector instead of a SmallPtrSet when collecting
and storing Roots.

The iteration order for a SmallPtrSet is not deterministic,
so in the past the order of items inserted in the WorkList
inside walkBackwards has been non-deterministic. This patch
intends to make the order of rewrites done in Float2Int
deterministic by changing the container for the Roots set.

The semantics result of the transformation should not be
any different afaict. But at least naming of IR variables
(when outputting the result as an ll file) should be more
stable now.

Reviewers: craig.topper, spatel, cameron.mcinally

Reviewed By: spatel

Subscribers: mgrang, llvm-commits

Tags: #llvm

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

4 years ago[llvm][CodeGen] Addressing modes for SVE stN.
Francesco Petrogalli [Fri, 17 Apr 2020 19:18:02 +0000 (20:18 +0100)]
[llvm][CodeGen] Addressing modes for SVE stN.

This reverts commit 17b1869b72f30f2702cb1abd7222027082e49eb6.

It is an attempt to fix the failure reported at

The patch differs from the original one reviwed at
https://reviews.llvm.org/D77435 only for the use of the std::make_tuple
in building the return value of `findAddrModeSVELoadStore`:

   -  return {IsRegReg ? Opc_rr : Opc_ri, NewBase, NewOffset};
   +  return std::make_tuple(IsRegReg ? Opc_rr : Opc_ri, NewBase,

the original patch submitted at
https://github.com/llvm/llvm-project/commit/fc4e954ed5c0825cdfe3a590ff1904ef38bc47db
was failing the following build:

http://lab.llvm.org:8011/builders/clang-armv7-linux-build-cache/builds/29420/

with error:

/home/buildslave/buildslave/clang-armv7-linux-build-cache/llvm/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
/home/buildslave/buildslave/clang-armv7-linux-build-cache/llvm/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp:1439:10:
error: chosen constructor is explicit in copy-initialization
  return {IsRegReg ? Opc_rr : Opc_ri, NewBase, NewOffset};
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   /usr/bin/../lib/gcc/arm-linux-gnueabihf/5.4.0/../../../../include/c++/5.4.0/tuple:479:19:
   note: explicit constructor declared here
           constexpr tuple(_UElements&&... __elements)
                     ^
     1 error generated.

4 years agoRevert "[llvm][CodeGen] Addressing modes for SVE stN."
Francesco Petrogalli [Fri, 17 Apr 2020 19:02:03 +0000 (20:02 +0100)]
Revert "[llvm][CodeGen] Addressing modes for SVE stN."

This reverts commit fc4e954ed5c0825cdfe3a590ff1904ef38bc47db.

The commit reported the following failure:

http://lab.llvm.org:8011/builders/clang-armv7-linux-build-cache/builds/29420

FAILED: lib/Target/AArch64/CMakeFiles/LLVMAArch64CodeGen.dir/AArch64ISelDAGToDAG.cpp.o
/usr/bin/c++   -DGTEST_HAS_RTTI=0 -D_DEBUG -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Target/AArch64 -I/home/buildslave/buildslave/clang-armv7-linux-build-cache/llvm/llvm/lib/Target/AArch64 -I/usr/include/libxml2 -Iinclude -I/home/buildslave/buildslave/clang-armv7-linux-build-cache/llvm/llvm/include -mthumb -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections -O3  -fvisibility=hidden    -fno-exceptions -fno-rtti -UNDEBUG -std=c++14 -MMD -MT lib/Target/AArch64/CMakeFiles/LLVMAArch64CodeGen.dir/AArch64ISelDAGToDAG.cpp.o -MF lib/Target/AArch64/CMakeFiles/LLVMAArch64CodeGen.dir/AArch64ISelDAGToDAG.cpp.o.d -o lib/Target/AArch64/CMakeFiles/LLVMAArch64CodeGen.dir/AArch64ISelDAGToDAG.cpp.o -c /home/buildslave/buildslave/clang-armv7-linux-build-cache/llvm/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
/home/buildslave/buildslave/clang-armv7-linux-build-cache/llvm/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp:1439:10: error: chosen constructor is explicit in copy-initialization
  return {IsRegReg ? Opc_rr : Opc_ri, NewBase, NewOffset};
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   /usr/bin/../lib/gcc/arm-linux-gnueabihf/5.4.0/../../../../include/c++/5.4.0/tuple:479:19: note: explicit constructor declared here
           constexpr tuple(_UElements&&... __elements)

4 years ago[AMDGPU] copyPhysReg() for 16 bit SGPR subregs
Stanislav Mekhanoshin [Wed, 15 Apr 2020 23:16:13 +0000 (16:16 -0700)]
[AMDGPU] copyPhysReg() for 16 bit SGPR subregs

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

4 years agoFix interaction of static plugins with -DLLVM_LINK_LLVM_DYLIB=ON.
Eli Friedman [Thu, 16 Apr 2020 21:32:15 +0000 (14:32 -0700)]
Fix interaction of static plugins with -DLLVM_LINK_LLVM_DYLIB=ON.

We should link static plugins into libLLVM.so; they shouldn't depend on
libLLVM.so.

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

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

4 years ago[libc++] Split features for platform detection into its own function
Louis Dionne [Fri, 17 Apr 2020 18:44:22 +0000 (14:44 -0400)]
[libc++] Split features for platform detection into its own function

This will allow refactoring how the locales are figured out more easily.

4 years ago[AMDGPU] Use SDWA for 16 bit subreg copy
Stanislav Mekhanoshin [Wed, 15 Apr 2020 22:40:13 +0000 (15:40 -0700)]
[AMDGPU] Use SDWA for 16 bit subreg copy

This simplifies the logic and allows to use it on GFX8.

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

4 years ago[llvm][CodeGen] Addressing modes for SVE stN.
Francesco Petrogalli [Fri, 17 Apr 2020 18:26:28 +0000 (19:26 +0100)]
[llvm][CodeGen] Addressing modes for SVE stN.

Reviewers: efriedma, sdesmalen, c-rhodes, ctetreau

Reviewed By: c-rhodes

Subscribers: tschuett, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[llvm][CodeGen] Fix issue for SVE gather prefetch.
Francesco Petrogalli [Fri, 17 Apr 2020 18:05:31 +0000 (19:05 +0100)]
[llvm][CodeGen] Fix issue for SVE gather prefetch.

Summary:
This change is fixing an issue where the dagcombine incorrectly used an addressing mode with scaled offsets (indices), instead of unscaled offsets.
Those addressing modes do not exist for `prfh` , `prfw` and `prfd`, hence we can reuse `prfb` because that has unscaled offsets, and because the pseudo-code in the XML spec suggests that the element size is not used for the amount of data that is prefetched by the instruction.

FWIW, GCC also emits a `prfb` for these cases.

Reviewers: sdesmalen, andwar, rengolin

Reviewed By: sdesmalen

Subscribers: tschuett, hiraditya, llvm-commits

Tags: #llvm

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

4 years agoAllow lldb-test to combine -find with -dump-clang-ast
Adrian Prantl [Thu, 16 Apr 2020 21:10:23 +0000 (14:10 -0700)]
Allow lldb-test to combine -find with -dump-clang-ast

This patch threads an lldb::DescriptionLevel through the typesystem to
allow dumping the full Clang AST (level=verbose) of any lldb::Type in
addition to the human-readable source description (default
level=full). This type dumping interface is currently not exposed
through the SBAPI.

The application is to let lldb-test dump the clang AST of search
results. I need this to test lazy type completion of clang types in
subsequent patches.

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

4 years agoClean up usages of asserting vector getters in Type
Christopher Tetreault [Fri, 17 Apr 2020 17:39:33 +0000 (10:39 -0700)]
Clean up usages of asserting vector getters in Type

Summary:
Remove usages of asserting vector getters in Type in preparation for the
VectorType refactor. The existence of these functions complicates the
refactor while adding little value.

Reviewers: craig.topper, sdesmalen, efriedma, RKSimon

Reviewed By: efriedma

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agoReland Implement _ExtInt as an extended int type specifier.
Erich Keane [Fri, 17 Apr 2020 17:44:19 +0000 (10:44 -0700)]
Reland Implement _ExtInt as an extended int type specifier.

I fixed the LLDB issue, so re-applying the patch.

This reverts commit a4b88c044980337bb14390be654fe76864aa60ec.

4 years ago[CallSite removal][Attributor] Replaces use of CallSite with CallBase. NFC
Craig Topper [Fri, 17 Apr 2020 17:33:59 +0000 (10:33 -0700)]
[CallSite removal][Attributor] Replaces use of CallSite with CallBase. NFC

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

4 years ago[AArch64] Fold one-use variables into assert
Benjamin Kramer [Fri, 17 Apr 2020 17:43:06 +0000 (19:43 +0200)]
[AArch64] Fold one-use variables into assert

Avoids unused variable warnings in Release builds.

4 years ago[CallSite removal][MemCpyOptimizer] Replace CallSite with CallBase. NFC
Craig Topper [Fri, 17 Apr 2020 17:12:15 +0000 (10:12 -0700)]
[CallSite removal][MemCpyOptimizer] Replace CallSite with CallBase. NFC

There are also some adjustments to use MaybeAlign in here due
to CallBase::getParamAlignment() being deprecated. It would
be a little cleaner if getOrEnforceKnownAlignment was migrated
to Align/MaybeAlign.

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

4 years agoRevert "Implement _ExtInt as an extended int type specifier."
Sterling Augustine [Fri, 17 Apr 2020 16:43:55 +0000 (09:43 -0700)]
Revert "Implement _ExtInt as an extended int type specifier."

This reverts commit 61ba1481e200b5b35baa81ffcff81acb678e8508.

I'm reverting this because it breaks the lldb build with
incomplete switch coverage warnings. I would fix it forward,
but am not familiar enough with lldb to determine the correct
fix.

lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:3958:11: error: enumeration values 'DependentExtInt' and 'ExtInt' not handled in switch [-Werror,-Wswitch]
  switch (qual_type->getTypeClass()) {
          ^
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:4633:11: error: enumeration values 'DependentExtInt' and 'ExtInt' not handled in switch [-Werror,-Wswitch]
  switch (qual_type->getTypeClass()) {
          ^
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:4889:11: error: enumeration values 'DependentExtInt' and 'ExtInt' not handled in switch [-Werror,-Wswitch]
  switch (qual_type->getTypeClass()) {

4 years ago[libc] Add write(2) implementation for Linux and FDReader test utility
Alex Brachet [Fri, 17 Apr 2020 17:21:05 +0000 (13:21 -0400)]
[libc] Add write(2) implementation for Linux and FDReader test utility

Summary: Adds `write` for Linux and FDReader utility which should be useful for some stdio tests as well.

Reviewers: sivachandra, PaulkaToast

Reviewed By: sivachandra

Subscribers: mgorny, tschuett, libc-commits

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

4 years agoRevert "[CallSite removal][MemCpyOptimizer] Replace CallSite with CallBase. NFC"
Craig Topper [Fri, 17 Apr 2020 17:10:53 +0000 (10:10 -0700)]
Revert "[CallSite removal][MemCpyOptimizer] Replace CallSite with CallBase. NFC"

There were extra changes that weren't supposed to be in there

This reverts commit b91f78db370bb8161472acd75a67916d033c3348.

4 years ago[libc] Add spec/*.td as dependencies to add_gen_header
Alex Brachet [Fri, 17 Apr 2020 17:10:46 +0000 (13:10 -0400)]
[libc] Add spec/*.td as dependencies to add_gen_header

Summary: It also re formats long lines in `add_gen_header`

Reviewers: sivachandra

Reviewed By: sivachandra

Subscribers: mgorny, tschuett, libc-commits

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

4 years ago[CallSite removal][MemCpyOptimizer] Replace CallSite with CallBase. NFC
Craig Topper [Fri, 17 Apr 2020 16:48:11 +0000 (09:48 -0700)]
[CallSite removal][MemCpyOptimizer] Replace CallSite with CallBase. NFC

There are also some adjustments to use MaybeAlign in here due
to CallBase::getParamAlignment() being deprecated. It would
be cleaner if getOrEnforceKnownAlignment was migrated
to Align/MaybeAlign.

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

4 years ago[LVI] Cleanup/unify cache access
Nikita Popov [Tue, 24 Mar 2020 19:31:13 +0000 (20:31 +0100)]
[LVI] Cleanup/unify cache access

This patch combines the "has" and "get" parts of the cache access.
getCachedValueInfo() now both sets the BBLV return argument, and
returns whether the value was found.

Additionally, the management of the work stack is now integrated
into getBlockValue(). If the value is not cached yet, we try to
push to the stack (and return false, indicating that we need to
solve first), or return overdefined in case of a cycle.

These changes a) avoid a duplicate cache lookup for has & get and
b) ensure that the logic is uniform everywhere. For this reason
this change is also not quite NFC, because previously overdefined
values from the cache, and overdefined values from a cycle received
different treatment when it came to assumption intersection.

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

4 years ago[MI] Reduce MachineInstr size (NFC)
Nikita Popov [Wed, 15 Apr 2020 20:40:08 +0000 (22:40 +0200)]
[MI] Reduce MachineInstr size (NFC)

Move CapOperands next to AsmPrinterFlags, to reduce size of
MachineInstr by 8 bytes.

4 years ago[PredicateInfo] Remove unused member (NFC)
Nikita Popov [Thu, 16 Apr 2020 19:19:45 +0000 (21:19 +0200)]
[PredicateInfo] Remove unused member (NFC)

PredicateInfo takes up a large amount of memory during IPSCCP
with many functions. And a large part of that space seems to
be going completely to waste here...

4 years ago[libc++] List the set of __config_site macros used for features
Louis Dionne [Mon, 13 Apr 2020 21:15:37 +0000 (17:15 -0400)]
[libc++] List the set of __config_site macros used for features

Instead of creating Lit features for all __config_site macros automatically,
only do so for macros that generate features actually used in the test
suite. This makes it easier to know which ones are supported by the test
suite at a glance.

Note that the `libcpp-abi-version-vN` is dropped altogether, but it
wasn't used anywhere.

4 years ago[ARM] Fix conditions for lowering to S[LR]I
Petre-Ionut Tudor [Tue, 31 Mar 2020 16:27:45 +0000 (17:27 +0100)]
[ARM] Fix conditions for lowering to S[LR]I

Summary:
Fixed wrong conditions for generating (S[LR]I X, Y, C2) from
(or (and X, BvecC1), (lsl Y, C2)) and added ISel nodes to lower to S[LR]I. The
optimisation is also enabled by default now.

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

4 years agoNFC: remove outdated TODOs from ARM test file.
Sjoerd Meijer [Fri, 17 Apr 2020 16:08:11 +0000 (17:08 +0100)]
NFC: remove outdated TODOs from ARM test file.

4 years ago[PowerPC][Future] More support for PCRel addressing for global values
Stefan Pintilie [Fri, 17 Apr 2020 16:05:02 +0000 (11:05 -0500)]
[PowerPC][Future] More support for PCRel addressing for global values

Add initial support for PC Relative addressing for global values that
require GOT indirect addressing. This patch adds PCRelative support for
global addresses that may not be known at link time and may require
access through the GOT.

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

4 years ago[libc] Disable AOR ulp tests for sinf, cosf and sincosf.
Siva Chandra Reddy [Fri, 17 Apr 2020 15:59:35 +0000 (08:59 -0700)]
[libc] Disable AOR ulp tests for sinf, cosf and sincosf.

They seemed to fallback to the system libc and start depending on its
accuracy.

4 years ago[Support][X86] Include sched.h after D78324
Fangrui Song [Fri, 17 Apr 2020 15:43:02 +0000 (08:43 -0700)]
[Support][X86] Include sched.h after D78324

http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/28848/steps/build%20stage%201/logs/stdio

4 years ago[builtins] Add missing header in D77912 and make __builtin_clzll more robust
Fangrui Song [Fri, 17 Apr 2020 15:29:58 +0000 (08:29 -0700)]
[builtins] Add missing header in D77912 and make __builtin_clzll more robust

4 years ago[ELF] Support a few more SPARCv9 relocations
LemonBoy [Fri, 17 Apr 2020 14:58:15 +0000 (07:58 -0700)]
[ELF] Support a few more SPARCv9 relocations

Implemented a bunch of relocations found in binaries with medium/large code model and the Local-Exec TLS model. The binaries link and run fine in Qemu.
In addition, the emulation `elf64_sparc` is now recognized.

Reviewed By: MaskRay

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

4 years ago[SYCL] Update __builtin_unique_stable_name for other backends.
Erich Keane [Fri, 17 Apr 2020 14:52:50 +0000 (07:52 -0700)]
[SYCL] Update __builtin_unique_stable_name for other backends.

The CUDA backend (and other downstreams) have trouble with the tilde and
arrow delimiter, so replace these with 'm' (for macro) and '_'.  Since
these are in the normal lambda ID location, the format of these should
not conflict with anything else.

4 years ago[Support][X86] Change getHostNumPhsicalCores() to return number of physical cores...
Fangrui Song [Thu, 16 Apr 2020 19:05:53 +0000 (12:05 -0700)]
[Support][X86] Change getHostNumPhsicalCores() to return number of physical cores enabled by affinity

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

While here, make the x86-64 code available for x86-32.

The output has been available and stable since
https://git.kernel.org/linus/3dd9d514846cdca1dcef2e4fce666d85e199e844 (2005)
```
processor:
...
physical id:
siblings:
core id:
```

Don't check HAVE_SCHED_GETAFFINITY/HAVE_CPU_COUNT. The interface is
simply available in every libc which can build LLVM.

Reviewed By: aganea

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

4 years ago[GlobalISel][AMDGPU] add legalization for G_FREEZE
Dominik Montada [Tue, 14 Apr 2020 09:25:05 +0000 (11:25 +0200)]
[GlobalISel][AMDGPU] add legalization for G_FREEZE

Summary:
Copy the legalization rules from SelectionDAG:
-widenScalar using anyext
-narrowScalar using intermediate merges
-scalarize/fewerElements using unmerge
-moreElements using G_IMPLICIT_DEF and insert

Add G_FREEZE legalization actions to AMDGPULegalizerInfo.
Use the same legalization actions as G_IMPLICIT_DEF.

Depends on D77795.

Reviewers: dsanders, arsenm, aqjune, aditya_nandakumar, t.p.northover, lebedev.ri, paquette, aemerson

Reviewed By: arsenm

Subscribers: kzhuravl, yaxunl, dstuttard, tpr, t-tye, jvesely, nhaehnle, kerbowa, wdng, rovka, hiraditya, volkan, llvm-commits

Tags: #llvm

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

4 years ago[ValueLattice] Steal bits from Tag to track range extensions (NFC).
Florian Hahn [Fri, 17 Apr 2020 14:30:00 +0000 (15:30 +0100)]
[ValueLattice] Steal bits from Tag to track range extensions (NFC).

Users of ValueLatticeElement currently have to ensure constant ranges
are not extended indefinitely. For example, in SCCP, mergeIn goes to
overdefined if a constantrange value is repeatedly merged with larger
constantranges. This is a simple form of widening.

In some cases, this leads to an unnecessary loss of information and
things can be improved by allowing a small number of extensions in the
hope that a fixed point is reached after a small number of steps.

To make better decisions about widening, it is helpful to keep track of
the number of range extensions. That state is tied directly to a
concrete ValueLatticeElement and some unused bits in the class can be
used. The current patch preserves the existing behavior by default:
CheckWiden defaults to false and if CheckWiden is true, a single change
to the range is allowed.

Follow-up patches will slightly increase the threshold for widening.

Reviewers: efriedma, davide, mssimpso

Reviewed By: efriedma

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

4 years ago[libc++] NFC: Rename Lit feature for no RTTI to -fno-rtti
Louis Dionne [Fri, 17 Apr 2020 14:36:32 +0000 (10:36 -0400)]
[libc++] NFC: Rename Lit feature for no RTTI to -fno-rtti

4 years agoRemove accidental include.
Benjamin Kramer [Fri, 17 Apr 2020 14:36:30 +0000 (16:36 +0200)]
Remove accidental include.

Thank you clangd.

4 years agoChange users of CreateShuffleVector to pass the masks as int instead of Constants
Benjamin Kramer [Fri, 17 Apr 2020 14:33:39 +0000 (16:33 +0200)]
Change users of CreateShuffleVector to pass the masks as int instead of Constants

No functionality change intended.

4 years ago[PhaseOrdering] remove blank lines in tests; NFC
Sanjay Patel [Fri, 17 Apr 2020 13:34:34 +0000 (09:34 -0400)]
[PhaseOrdering] remove blank lines in tests; NFC

4 years ago[AMDGPU] New helper functions to get a register class of a given width
Jay Foad [Thu, 9 Apr 2020 11:01:05 +0000 (12:01 +0100)]
[AMDGPU] New helper functions to get a register class of a given width

Summary:
Introduce new helper functions getVGPRClassForBitWidth,
getAGPRClassForBitWidth, getSGPRClassForBitWidth and use them to
refactor various other functions that all contained their own lists of
valid register class widths. NFC.

Reviewers: arsenm, rampitec

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits

Tags: #llvm

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

4 years agoImplement _ExtInt as an extended int type specifier.
Erich Keane [Tue, 24 Dec 2019 15:28:40 +0000 (07:28 -0800)]
Implement _ExtInt as an extended int type specifier.

Introduction/Motivation:
LLVM-IR supports integers of non-power-of-2 bitwidth, in the iN syntax.
Integers of non-power-of-two aren't particularly interesting or useful
on most hardware, so much so that no language in Clang has been
motivated to expose it before.

However, in the case of FPGA hardware normal integer types where the
full bitwidth isn't used, is extremely wasteful and has severe
performance/space concerns.  Because of this, Intel has introduced this
functionality in the High Level Synthesis compiler[0]
under the name "Arbitrary Precision Integer" (ap_int for short). This
has been extremely useful and effective for our users, permitting them
to optimize their storage and operation space on an architecture where
both can be extremely expensive.

We are proposing upstreaming a more palatable version of this to the
community, in the form of this proposal and accompanying patch.  We are
proposing the syntax _ExtInt(N).  We intend to propose this to the WG14
committee[1], and the underscore-capital seems like the active direction
for a WG14 paper's acceptance.  An alternative that Richard Smith
suggested on the initial review was __int(N), however we believe that
is much less acceptable by WG14.  We considered _Int, however _Int is
used as an identifier in libstdc++ and there is no good way to fall
back to an identifier (since _Int(5) is indistinguishable from an
unnamed initializer of a template type named _Int).

[0]https://www.intel.com/content/www/us/en/software/programmable/quartus-prime/hls-compiler.html)
[1]http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2472.pdf

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

4 years ago[libc++abi] NFC: Remove trailing whitespace
Louis Dionne [Fri, 17 Apr 2020 14:06:55 +0000 (10:06 -0400)]
[libc++abi] NFC: Remove trailing whitespace

4 years ago[XCOFF][AIX] Fix getSymbol to return the correct qualname when necessary
jasonliu [Thu, 16 Apr 2020 19:52:34 +0000 (19:52 +0000)]
[XCOFF][AIX] Fix getSymbol to return the correct qualname when necessary

Summary:
AIX symbol have qualname and unqualified name. The stock getSymbol
could only return unqualified name, which leads us to patch many
caller side(lowerConstant, getMCSymbolForTOCPseudoMO).
So we should try to address this problem in the callee
side(getSymbol) and clean up the caller side instead.

Note: this is a "mostly" NFC patch, with a fix for the original
lowerConstant behavior.

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

4 years ago[AMDGPU] Simplify SIRegisterInfo::getRegSplitParts
Jay Foad [Fri, 17 Apr 2020 09:28:47 +0000 (10:28 +0100)]
[AMDGPU] Simplify SIRegisterInfo::getRegSplitParts

Summary:
Use more logic and fewer tables. This reduces the line count and
reduces the effort required to introduce more register classes of
different sizes in future.

Reviewers: arsenm, rampitec, nhaehnle

Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits

Tags: #llvm

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

4 years ago[VectorUtils] Create shufflevector masks as int vectors instead of Constants
Benjamin Kramer [Fri, 17 Apr 2020 13:28:00 +0000 (15:28 +0200)]
[VectorUtils] Create shufflevector masks as int vectors instead of Constants

No functionality change intended.

4 years ago[clang][AST] Support AST files larger than 512M
Dmitry Polukhin [Thu, 16 Apr 2020 16:24:46 +0000 (09:24 -0700)]
[clang][AST] Support AST files larger than 512M

Summary:
Clang uses 32-bit integers for storing bit offsets from the beginning of
the file that results in 512M limit on AST file. This diff replaces
absolute offsets with relative offsets from the beginning of
corresponding data structure when it is possible. And uses 64-bit
offsets for DeclOffests and TypeOffssts because these coder AST
section may easily exceeds 512M alone.

This diff breaks AST file format compatibility so VERSION_MAJOR bumped.

Test Plan:
Existing clang AST serialization tests
Tested on clangd with ~700M and ~900M preamble files
check-clang with ubsan

Reviewers: rsmith, dexonsmith

Subscribers: ilya-biryukov, kadircet, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[libc++] Move .fail.cpp tests with verify-support to .verify.cpp
Louis Dionne [Fri, 17 Apr 2020 12:47:40 +0000 (08:47 -0400)]
[libc++] Move .fail.cpp tests with verify-support to .verify.cpp

4 years ago[x86] rename variables for types for readability; NFC
Sanjay Patel [Fri, 17 Apr 2020 12:41:18 +0000 (08:41 -0400)]
[x86] rename variables for types for readability; NFC

This gets harder to follow if we allow changing types/sizes
between source, dest, and intermediate value.

4 years ago[x86] add/adjust tests for FP<->int casts; NFC
Sanjay Patel [Fri, 17 Apr 2020 12:22:17 +0000 (08:22 -0400)]
[x86] add/adjust tests for FP<->int casts; NFC

4 years ago[RISCV][AsmParser] Implement .option (no)pic
Roger Ferrer Ibanez [Fri, 17 Apr 2020 07:39:49 +0000 (07:39 +0000)]
[RISCV][AsmParser] Implement .option (no)pic

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

4 years ago[clangd] Fix memory leak in FileIndexTest
Kadir Cetinkaya [Fri, 17 Apr 2020 11:56:22 +0000 (13:56 +0200)]
[clangd] Fix memory leak in FileIndexTest

4 years ago[clangd] Drop dangling relations while sharding
Kadir Cetinkaya [Fri, 17 Apr 2020 11:19:52 +0000 (13:19 +0200)]
[clangd] Drop dangling relations while sharding

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

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

4 years agoRecommit [X86][MC][NFC] Reduce the parameters of functions in X86MCCodeEmitter(Part II)
Shengchen Kan [Fri, 17 Apr 2020 03:17:38 +0000 (11:17 +0800)]
Recommit [X86][MC][NFC] Reduce the parameters of functions in X86MCCodeEmitter(Part II)

Previous patch didn't handle the early return in `emitREXPrefix` correctly,
which causes REX prefix was not emitted for instruction without
operands. This patch includes the fix for that.

4 years agoUnifyFunctionExitNodes.h - remove unnecessary PassRegistry.h include. NFC
Simon Pilgrim [Fri, 17 Apr 2020 11:14:02 +0000 (12:14 +0100)]
UnifyFunctionExitNodes.h - remove unnecessary PassRegistry.h include. NFC

4 years agoSSAUpdaterBulk.h - remove unnecessary SmallPtrSet.h include. NFC
Simon Pilgrim [Fri, 17 Apr 2020 11:01:25 +0000 (12:01 +0100)]
SSAUpdaterBulk.h - remove unnecessary SmallPtrSet.h include. NFC

4 years agoScalar.h - remove unused forward declarations. NFC.
Simon Pilgrim [Fri, 17 Apr 2020 10:49:13 +0000 (11:49 +0100)]
Scalar.h - remove unused forward declarations. NFC.

4 years agoAMDGPU/GlobalISel: Work around another selector crash
Jay Foad [Fri, 17 Apr 2020 10:49:38 +0000 (11:49 +0100)]
AMDGPU/GlobalISel: Work around another selector crash

This does for G_EXTRACT_VECTOR_ELT what 588bd7be366 did for G_TRUNC.

Ideally types without a corresponding register class wouldn't reach
here, but we're currently missing some (in particular a 192-bit class
is missing).

4 years ago[NFC] Add missing 'const' notion to LCSSA-related functions
Max Kazantsev [Fri, 17 Apr 2020 10:18:01 +0000 (17:18 +0700)]
[NFC] Add missing 'const' notion to LCSSA-related functions

These functions don't really do any changes to loop info or
dominator tree. We should state this explicitly using 'const'.

4 years agoProvide operand indices to adjustSchedDependency
Fraser Cormack [Tue, 31 Mar 2020 10:57:51 +0000 (11:57 +0100)]
Provide operand indices to adjustSchedDependency

This allows targets to know exactly which operands are contributing to
the dependency, which is required for targets with per-operand
scheduling models.

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

4 years ago[cmake] LLVMVectorize - add include/llvm/Transforms/Vectorize header path
Simon Pilgrim [Fri, 17 Apr 2020 10:06:26 +0000 (11:06 +0100)]
[cmake] LLVMVectorize - add include/llvm/Transforms/Vectorize header path

MSVC projects were missing the llvm/Transforms/Vectorize/* headers

4 years agoMCObjectWriter.h - remove Endian.h/EndianStream.h/raw_ostream.h includes. NFC
Simon Pilgrim [Thu, 16 Apr 2020 18:31:45 +0000 (19:31 +0100)]
MCObjectWriter.h - remove Endian.h/EndianStream.h/raw_ostream.h includes. NFC

Push these includes down to the the writers that actually need them, a number of which were implicitly relying on the MCObjectWriter.h.

4 years agoConstantPools.h - remove unused DenseMap.h include. NFC.
Simon Pilgrim [Thu, 16 Apr 2020 17:25:44 +0000 (18:25 +0100)]
ConstantPools.h - remove unused DenseMap.h include. NFC.

4 years agoMCStreamer.h - remove unused llvm::MCCodePaddingContext forward declaration. NFC.
Simon Pilgrim [Thu, 16 Apr 2020 17:21:35 +0000 (18:21 +0100)]
MCStreamer.h - remove unused llvm::MCCodePaddingContext forward declaration. NFC.

4 years agoMCWasmStreamer.h.h - cleanup includes and forward declarations. NFC.
Simon Pilgrim [Thu, 16 Apr 2020 17:13:23 +0000 (18:13 +0100)]
MCWasmStreamer.h.h - cleanup includes and forward declarations. NFC.
Remove unnecessary SmallPtrSet.h/SectionKind.h includes
Remove unused MCAssembler/raw_ostream forward declarations

4 years agoMCSectionXCOFF.h - remove unnecessary Twine.h include. NFC
Simon Pilgrim [Thu, 16 Apr 2020 17:10:59 +0000 (18:10 +0100)]
MCSectionXCOFF.h - remove unnecessary Twine.h include. NFC

4 years ago[tools][tests] - Use --check-prefixes instead of multiple --check-prefix. NFCI.
Georgii Rymar [Wed, 15 Apr 2020 15:28:08 +0000 (18:28 +0300)]
[tools][tests] - Use --check-prefixes instead of multiple --check-prefix. NFCI.

There is no need to use `--check-prefix` multiple times.
It helps to improve readability/test maintainability.
This patch does it for all tools at once.

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

4 years ago[gn build] Port ff9379f4b2d
LLVM GN Syncbot [Fri, 17 Apr 2020 09:27:53 +0000 (09:27 +0000)]
[gn build] Port ff9379f4b2d

4 years ago[NFC] Remove waymarking because it improves performances
Tyker [Fri, 17 Apr 2020 08:53:01 +0000 (10:53 +0200)]
[NFC] Remove waymarking because it improves performances

Summary:
This patch remove waymarking and replaces it with storing a pointer to the User in the Use.
here are the results on the measurements for the CTMark tests of the test suite.
```
Metric: instructions_count

Program                                                      baseline      patched       diff
 test-suite :: CTMark/ClamAV/clamscan.test                    72557942065   71733653521  -1.1%
 test-suite :: CTMark/sqlite3/sqlite3.test                    76281422939   75484840636  -1.0%
 test-suite :: CTMark/consumer-typeset/consumer-typeset.test  51364676366   50862185614  -1.0%
 test-suite :: CTMark/SPASS/SPASS.test                        60476106505   59908437767  -0.9%
 test-suite :: CTMark/tramp3d-v4/tramp3d-v4.test              112578442329  111725050856 -0.8%
 test-suite :: CTMark/mafft/pairlocalalign.test               50846133013   50473644539  -0.7%
 test-suite :: CTMark/kimwitu++/kc.test                       54692641250   54349070299  -0.6%
 test-suite :: CTMark/7zip/7zip-benchmark.test                182216614747  181216091230 -0.5%
 test-suite :: CTMark/Bullet/bullet.test                      123459210616  122905866767 -0.4%
 Geomean difference                                                                      -0.8%

Metric: peak_memory_use

Program                                                      baseline  patched   diff
 test-suite :: CTMark/tramp3d-v4/tramp3d-v4.test              326864    338524    3.6%
 test-suite :: CTMark/sqlite3/sqlite3.test                    216412    221240    2.2%
 test-suite :: CTMark/7zip/7zip-benchmark.test                11808284  12022604  1.8%
 test-suite :: CTMark/Bullet/bullet.test                      6831752   6945988   1.7%
 test-suite :: CTMark/SPASS/SPASS.test                        2682552   2721820   1.5%
 test-suite :: CTMark/ClamAV/clamscan.test                    5037256   5107936   1.4%
 test-suite :: CTMark/consumer-typeset/consumer-typeset.test  2752728   2790768   1.4%
 test-suite :: CTMark/mafft/pairlocalalign.test               1517676   1537244   1.3%
 test-suite :: CTMark/kimwitu++/kc.test                       1090748   1103448   1.2%
 Geomean difference                                                               1.8%

Metric: compile_time

Program                                                      baseline patched diff
 test-suite :: CTMark/consumer-typeset/consumer-typeset.test  14.71    14.38  -2.2%
 test-suite :: CTMark/sqlite3/sqlite3.test                    23.18    22.73  -2.0%
 test-suite :: CTMark/7zip/7zip-benchmark.test                57.96    56.99  -1.7%
 test-suite :: CTMark/ClamAV/clamscan.test                    20.75    20.49  -1.2%
 test-suite :: CTMark/kimwitu++/kc.test                       18.35    18.15  -1.1%
 test-suite :: CTMark/SPASS/SPASS.test                        18.72    18.57  -0.8%
 test-suite :: CTMark/mafft/pairlocalalign.test               14.09    14.00  -0.6%
 test-suite :: CTMark/Bullet/bullet.test                      37.38    37.19  -0.5%
 test-suite :: CTMark/tramp3d-v4/tramp3d-v4.test              33.81    33.76  -0.2%
 Geomean difference                                                           -1.1%
```

i believe that it is worth trading +1.8% peak memory use for -1.1% compile time.
also this patch removes waymarking which simplifies the Use and User classes.

Reviewers: nikic, lattner

Reviewed By: lattner

Subscribers: russell.gallop, foad, ggreif, rriddle, ekatz, fhahn, lebedev.ri, mgorny, hiraditya, george.burgess.iv, asbirlea, llvm-commits

Tags: #llvm

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

4 years ago[CommandLine] Fix cl::ConsumeAfter support with more than one positional argument
Yi-Hong Lyu [Fri, 17 Apr 2020 06:45:45 +0000 (23:45 -0700)]
[CommandLine] Fix cl::ConsumeAfter support with more than one positional argument

Summary:
Currently, cl::ConsumeAfter only works for the case that has exactly one
positional argument. Without the fix, it skip fulfilling first positional
argument and put that additional positional argument in interpreter arguments.

Reviewers: bkramer, Mordante, rnk, lattner, beanz, craig.topper

Reviewed By: rnk

Subscribers: JosephTremoulet, hiraditya, llvm-commits

Tags: #llvm

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

4 years agoUse proper dependency name for libc.include.stdio
Alex Brachet [Fri, 17 Apr 2020 09:10:22 +0000 (05:10 -0400)]
Use proper dependency name for libc.include.stdio

4 years agoIPO.h - remove unused llvm::Function forward declaration. NFC.
Simon Pilgrim [Thu, 16 Apr 2020 20:44:50 +0000 (21:44 +0100)]
IPO.h - remove unused llvm::Function forward declaration. NFC.

4 years agoConstantFolding.h - remove unused llvm::ConstantVector forward declaration. NFC.
Simon Pilgrim [Thu, 16 Apr 2020 19:50:46 +0000 (20:50 +0100)]
ConstantFolding.h - remove unused llvm::ConstantVector forward declaration. NFC.

4 years agoScheduleDFS.h - Replace ArrayRef.h include with forward declaration. NFC.
Simon Pilgrim [Wed, 15 Apr 2020 21:32:17 +0000 (22:32 +0100)]
ScheduleDFS.h - Replace ArrayRef.h include with forward declaration. NFC.

We have no need to include the entire header.

4 years agoScoreboardHazardRecognizer.h - remove unnecessary llvm::InstrItineraryData forward...
Simon Pilgrim [Wed, 15 Apr 2020 21:30:21 +0000 (22:30 +0100)]
ScoreboardHazardRecognizer.h - remove unnecessary llvm::InstrItineraryData forward declaration. NFC.

We have to include MCInstrItineraries.h where its defined.

4 years ago[clang-tidy] modernize-use-using: Fix broken fixit with 'template' keyword
Matthias Gehre [Tue, 14 Apr 2020 18:17:22 +0000 (20:17 +0200)]
[clang-tidy] modernize-use-using: Fix broken fixit with 'template' keyword

Summary:
Before this PR, `modernize-use-using` would transform the typedef in
```

template <typename a> class TemplateKeyword {
  typedef typename a::template f<> e;
  typedef typename a::template f<>::d e2;
};
```
into
```
template <typename a> class TemplateKeyword {
  using d = typename a::b<>;
  using d2 = typename a::template a::b<>::c;
};
```
The first one is missing the `template` keyword,
the second one has an extra `a::` scope. Both result
in compilation errors.

Reviewers: aaron.ballman, alexfh, hokein, njames93

Subscribers: xazax.hun, cfe-commits

Tags: #clang

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

4 years ago[Fixed Point] Move the compassign LHS type correction a bit further down. NFCI.
Bevin Hansson [Thu, 16 Apr 2020 13:02:41 +0000 (15:02 +0200)]
[Fixed Point] Move the compassign LHS type correction a bit further down. NFCI.

Summary:
We can simplify the LHSTy correction for
fixed-point compassign by moving it below
the point where we know we have a compound
assignment.

Also, we shouldn't look at the LHS and RHS
separately; look at the computation result
type instead.

Looking at the LHS and RHS is also wrong
for compassigns with fixed and floating
point (though this does not work upstream
yet).

Reviewers: leonardchan

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[profile] Avoid duplicating or leaking VMO
Petr Hosek [Sat, 28 Mar 2020 00:48:28 +0000 (17:48 -0700)]
[profile] Avoid duplicating or leaking VMO

Now that write data continously into the memory mapping, we don't need
to keep the VMO handle around after it has been mapped. This change also
ensures that the VMO is always closed on error.

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

4 years ago[ARM][MVE] Add VHADD and VHSUB patterns
Sam Parker [Wed, 15 Apr 2020 08:57:13 +0000 (09:57 +0100)]
[ARM][MVE] Add VHADD and VHSUB patterns

Add patterns that use a normal, non-wrapping, add and sub nodes along
with an arm vshr imm node.

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

4 years agoFix opt-viewer tests failing after move from cgi.escape to html.escape
James Nagurne [Fri, 17 Apr 2020 06:01:01 +0000 (08:01 +0200)]
Fix opt-viewer tests failing after move from cgi.escape to html.escape

These two tests utilize pre-generated opt-viewer output to diff against
a run of opt-viewer over a known yaml file.

In commit 4b428e8f (D76126), the escape function used for rendering was changed
from cgi.escape to html.escape. This modification causes a behavioral
difference with regards to quote characters.

cgi will not escape quotes by default, but html will.

Therefore, these tests were failing because they expected the old behavior
of "string", but was instead seeing &quot;string&quot.

This solution modifies the known test outputs to use the escaped quotes
rather than not escaping quotes during rendering for no particular reason.

It is notable that when testing the optimization records generated by
LLVM, there was never quotes in the remarks I could find, specifically in
the Callee field where they exist in the pre-generated yaml for testing.

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

4 years agoTemporaily revert [X86][MC][NFC] Reduce the parameters of functions in X86MCCodeEmitt...
Shengchen Kan [Fri, 17 Apr 2020 06:11:05 +0000 (14:11 +0800)]
Temporaily revert [X86][MC][NFC] Reduce the parameters of functions in X86MCCodeEmitter(Part II)

It causes some encoding fails. Plan to recommit it after fixing that.

This reverts commit 3017580c7961397f96e9481abf82bbf874bb2633.

4 years ago[X86][MC][NFC] Reduce the parameters of functions in X86MCCodeEmitter(Part II)
Shengchen Kan [Fri, 17 Apr 2020 03:17:38 +0000 (11:17 +0800)]
[X86][MC][NFC] Reduce the parameters of functions in X86MCCodeEmitter(Part II)

Summary:
We determine the REX prefix used by instruction in `determineREXPrefix`,
and this value is used in `emitMemModRMByte' and used as the return
value of `emitOpcodePrefix`.

Before this patch, REX was passed as reference to `emitPrefixImpl`, it
is strange and not necessary, e.g, we have to write
```
bool Rex = false;
emitPrefixImpl(CurOp, CurByte, Rex, MI, STI, OS);
```
in `emitPrefix` even if `Rex` will not be used.

So we let HasREX be the return value of `emitPrefixImpl`. The HasREX is passed
from `emitREXPrefix` to  `emitOpcodePrefix` and then to
`emitPrefixImpl`. This makes sense since REX is a kind of opcode prefix
and of course is a prefix.

Reviewers: craig.topper, pengfei

Reviewed By: craig.topper

Subscribers: annita.zhang, craig.topper, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[PowerPC] Exploit the rldicl + rldicl when and with mask
QingShan Zhang [Fri, 17 Apr 2020 05:24:00 +0000 (05:24 +0000)]
[PowerPC] Exploit the rldicl + rldicl when and with mask

If we are and the constant like 0xFFFFFFC00000, for now, we are using several
instructions to generate this 48bit constant and final an "and". However, we
could exploit it with two rotate instructions.

       MB          ME               MB+63-ME
+----------------------+     +----------------------+
|0000001111111111111000| ->  |0000000001111111111111|
+----------------------+     +----------------------+
 0                    63      0                    63
Rotate left ME + 1 bit first, and then, mask it with (MB + 63 - ME, 63),
finally, rotate back. Notice that, we need to round it with 64 bit for the
wrapping case.

Reviewed by: ChenZheng, Nemanjai

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

4 years ago[SampleProfile] Use CallBase in function arguments and data structures to reduce...
Craig Topper [Fri, 17 Apr 2020 04:03:39 +0000 (21:03 -0700)]
[SampleProfile] Use CallBase in function arguments and data structures to reduce the number of explicit casts. NFCI

Removing CallSite left us with a bunch of explicit casts from
Instruction to CallBase. This moves the casts earlier so that
function arguments and data structure types are CallBase so
we don't have to cast when we use them.

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

4 years ago[llvm-objcopy][MachO] Correctly identify object file endianness.
Lang Hames [Fri, 17 Apr 2020 04:48:40 +0000 (21:48 -0700)]
[llvm-objcopy][MachO] Correctly identify object file endianness.

The header magic value is held in the native endianness, so the method used in
cc0ec3fdb9d. Use MachOReader / MachOWriter's existing endianness tests instead.

4 years ago[mlir] [VectorOps] Progressive lowering of vector.broadcast
aartbik [Thu, 16 Apr 2020 23:01:42 +0000 (16:01 -0700)]
[mlir] [VectorOps] Progressive lowering of vector.broadcast

Summary:
Rather than having a full, recursive, lowering of vector.broadcast
to LLVM IR, it is much more elegant to have a progressive lowering
of each vector.broadcast into a lower dimensional vector.broadcast,
until only elementary vector operations remain. This results
in more elegant, step-wise code, that is easier to understand.
Also makes some optimizations in the generated code.

Reviewers: nicolasvasilache, mehdi_amini, andydavis1, grosul1

Reviewed By: nicolasvasilache

Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, grosul1, frgossen, llvm-commits

Tags: #llvm

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

4 years ago[llvm-objcopy][MachO] Fix MachO::relocation_info use after 386f1c114d5.
Lang Hames [Fri, 17 Apr 2020 01:21:41 +0000 (18:21 -0700)]
[llvm-objcopy][MachO] Fix MachO::relocation_info use after 386f1c114d5.

Use shift/mask operations to access r_symbolnum rather than relying on
MachO::relocation_info. This should fix the big-endian bot failures that were
caused by 386f1c114d5.

4 years ago[WebAssembly] Fix faulty logic in verifyRelocTargets
Wouter van Oortmerssen [Fri, 17 Apr 2020 01:19:29 +0000 (18:19 -0700)]
[WebAssembly] Fix faulty logic in verifyRelocTargets