platform/upstream/llvm.git
4 years agoAMDGPU/GlobalISel: Allow selecting s128 load/stores
Matt Arsenault [Sat, 1 Feb 2020 16:02:04 +0000 (11:02 -0500)]
AMDGPU/GlobalISel: Allow selecting s128 load/stores

4 years agoAMDGPU: Fix splitting wide f32 s.buffer.load intrinsics
Matt Arsenault [Sat, 1 Feb 2020 16:35:15 +0000 (11:35 -0500)]
AMDGPU: Fix splitting wide f32 s.buffer.load intrinsics

This would witch f32 to i32, and produce an invald concat_vectors from
i32 pieces to an f32 vector.

4 years agoRevert "[clang-doc] Improving Markdown Output"
Petr Hosek [Mon, 3 Feb 2020 20:27:09 +0000 (12:27 -0800)]
Revert "[clang-doc] Improving Markdown Output"

This reverts commit 0fbaf3a7c2395d751cfa4ecd7f483f077b03d9bd as tests
are failing on some bots.

4 years ago[AIX] Don't use a zero fill with a second parameter
David Tenty [Mon, 3 Feb 2020 20:14:08 +0000 (15:14 -0500)]
[AIX] Don't use a zero fill with a second parameter

Summary:
The AIX assembler .space directive can't take a second non-zero argument to fill
with. But LLVM emitFill currently assumes it can. We add a flag to the AsmInfo
to check if non-zero fill is supported, and if we can't zerofill non-zero values
we just splat the .byte directives.

Reviewers: stevewan, sfertile, DiggerLin, jasonliu, Xiangling_L

Reviewed By: jasonliu

Subscribers: Xiangling_L, wuzish, nemanjai, hiraditya, kbarton, jsji, llvm-commits

Tags: #llvm

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

4 years ago[clang-doc] Improving Markdown Output
Petr Hosek [Mon, 3 Feb 2020 19:45:25 +0000 (11:45 -0800)]
[clang-doc] Improving Markdown Output

This change has two components. The moves the generated file
for a namespace to the directory named after the namespace in
a file named 'index.<format>'. This greatly improves the browsing
experience since the index page is shown by default for a directory.

The second improves the markdown output by adding the links to the
referenced pages for children objects and the link back to the source
code.

Patch By: Clayton

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

4 years ago[MLIR][Linalg] Use GenericLoopNestRangeBuilder in tiling code.
Alexander Belyaev [Mon, 3 Feb 2020 11:41:19 +0000 (12:41 +0100)]
[MLIR][Linalg] Use GenericLoopNestRangeBuilder in tiling code.

Preparation for adding support for tiling to parallel loops.

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

4 years ago[MLIR][Linalg] Allow fusion of more than 2 linalg ops.
Alexander Belyaev [Mon, 3 Feb 2020 12:52:13 +0000 (13:52 +0100)]
[MLIR][Linalg] Allow fusion of more than 2 linalg ops.

LinalgDependenceGraph was not updated after successful producer-consumer
fusion for linalg ops. In this patch it is fixed by reconstructing
LinalgDependenceGraph on every iteration. This is very ineffective and
should be improved by updating LDGraph only when it is necessary.

4 years ago[AArch64][GlobalISel] Walk through G_AND in TB(N)Z bit calculation
Jessica Paquette [Fri, 31 Jan 2020 00:17:21 +0000 (16:17 -0800)]
[AArch64][GlobalISel] Walk through G_AND in TB(N)Z bit calculation

Given

```
tb(n)z (and x, m), b
```

Where the `b`-th bit of `m` is 1,

```
tb(n)z (and x, m), b == tb(n)z x, b
```

So, we can walk past a `G_AND` in this case.

Also add test/CodeGen/AArch64/GlobalISel/opt-fold-and-tbz-tbnz.mir to test this.

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

4 years ago[AArch64][GlobalISel] Don't reconvert to p0 in convertPtrAddToAdd().
Amara Emerson [Mon, 3 Feb 2020 18:32:25 +0000 (10:32 -0800)]
[AArch64][GlobalISel] Don't reconvert to p0 in convertPtrAddToAdd().

convertPtrAddToAdd improved overall code size and quality by a significant amount,
but on -O0 we generate some cross-class copies due to the fact that we emitted
G_PTRTOINT and G_INTTOPTR around the G_ADD. Unfortunately at -O0 we don't run any
register coalescing, so these cross class copies end up escaping as moves, and
we ended up regressing 3 benchmarks on CTMark (though still a winner overall).

This patch changes the lowering to instead directly emit the G_ADD into the
destination register, and then force changes the dest LLT to s64 from p0. This
should be ok, as all uses of the register should now be selected and therefore
the LLT doesn't matter for the users. It does however matter for the importer
patterns, which will fail to select a G_ADD if there's a p0 LLT.

I'm not able to get rid of the G_PTRTOINT on the source yet however. We can't
use the same trick of breaking the type system since that could break the
selection of the defining instruction. Thus with -O0 we still end up with a
cross class copy on source.

Code size improvements on -O0:
Program                                         baseline      new         diff
 test-suite :: CTMark/Bullet/bullet.test        965520       949164      -1.7%
 test-suite...TMark/7zip/7zip-benchmark.test    1069456      1052600     -1.6%
 test-suite...ark/tramp3d-v4/tramp3d-v4.test    1213692      1199804     -1.1%
 test-suite...:: CTMark/sqlite3/sqlite3.test    421680       419736      -0.5%
 test-suite...-typeset/consumer-typeset.test    837076       833380      -0.4%
 test-suite :: CTMark/lencod/lencod.test        799712       796976      -0.3%
 test-suite...:: CTMark/ClamAV/clamscan.test    688264       686132      -0.3%
 test-suite :: CTMark/kimwitu++/kc.test         1002344      999648      -0.3%
 test-suite...Mark/mafft/pairlocalalign.test    422296       421768      -0.1%
 test-suite :: CTMark/SPASS/SPASS.test          656792       656532      -0.0%
 Geomean difference                                                      -0.6%

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

4 years agoGlobalISel: Implement fewerElementsVector for G_SEXT_INREG
Matt Arsenault [Sun, 12 Jan 2020 00:05:06 +0000 (19:05 -0500)]
GlobalISel: Implement fewerElementsVector for G_SEXT_INREG

Start using a new strategy with a combination of merge and unmerges.

This allows scalarizing before lowering, which in cases like
<2 x s128> avoids producing giant illegal shifts.

4 years ago[TargetRegisterInfo] Make the heuristic to skip region split overridable by the target
Quentin Colombet [Mon, 3 Feb 2020 18:22:50 +0000 (10:22 -0800)]
[TargetRegisterInfo] Make the heuristic to skip region split overridable by the target

RegAllocGreedy uses a fairly compile time intensive splitting heuristic
called region splitting. This heuristic was disabled via another heuristic
when it is likely that it won't be worth the compile time. The only way
to control this other heuristic was via a command line option (huge-size-for-split).

This commit gives more control on this heuristic by making it overridable
by the target using a target hook in TargetRegisterInfo called
shouldRegionSplitForVirtReg.

The default implementation of this hook keeps the heuristic as it was
before this patch.

4 years agoFix a -Wbitwise-conditional-parentheses warning in _LIBUNWIND_ARM_EHABI libunwind...
Nico Weber [Mon, 3 Feb 2020 19:16:52 +0000 (14:16 -0500)]
Fix a -Wbitwise-conditional-parentheses warning in _LIBUNWIND_ARM_EHABI libunwind builds

```
src/UnwindCursor.hpp:1344:51: error: operator '?:' has lower precedence than '|';
    '|' will be evaluated first [-Werror,-Wbitwise-conditional-parentheses]
  _info.flags = isSingleWordEHT ? 1 : 0 | scope32 ? 0x2 : 0;  // Use enum?
                                      ~~~~~~~~~~~ ^
src/UnwindCursor.hpp:1344:51: note: place parentheses around the '|' expression
    to silence this warning
  _info.flags = isSingleWordEHT ? 1 : 0 | scope32 ? 0x2 : 0;  // Use enum?
                                                  ^
                                      (          )
src/UnwindCursor.hpp:1344:51: note: place parentheses around the '?:' expression
    to evaluate it first
  _info.flags = isSingleWordEHT ? 1 : 0 | scope32 ? 0x2 : 0;  // Use enum?
                                                  ^
                                          (                )
```

But `0 |` is a no-op for either of those two interpretations, so I think
what was meant here was

```
  _info.flags = (isSingleWordEHT ? 1 : 0) | (scope32 ? 0x2 : 0);  // Use enum?
```

Previously, if `isSingleWordEHT` was set, bit 2 would never be set. Now
it is. From what I can tell, the only thing that checks these bitmask is
ProcessDescriptors in Unwind-EHABI.cpp, and that only cares about bit 1,
so in practice this shouldn't have much of an effect.

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

4 years agoAdd PassManagerImpl.h to hide implementation details
Reid Kleckner [Sat, 1 Feb 2020 00:05:32 +0000 (16:05 -0800)]
Add PassManagerImpl.h to hide implementation details

ClangBuildAnalyzer results show that a lot of time is spent
instantiating AnalysisManager::getResultImpl across the code base:

**** Templates that took longest to instantiate:
 50445 ms: llvm::AnalysisManager<llvm::Function>::getResultImpl (412 times, avg 122 ms)
 47797 ms: llvm::AnalysisManager<llvm::Function>::getResult<llvm::TargetLibraryAnalysis> (389 times, avg 122 ms)
 46894 ms: std::tie<const unsigned long long, const bool> (2452 times, avg 19 ms)
 43851 ms: llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096, 4096>::Allocate (3228 times, avg 13 ms)
 33911 ms: std::tie<const unsigned int, const unsigned int, const unsigned int, const unsigned int> (897 times, avg 37 ms)
 33854 ms: std::tie<const unsigned long long, const unsigned long long> (1897 times, avg 17 ms)
 27886 ms: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string (11156 times, avg 2 ms)

I mentioned this result to @chandlerc, and he suggested this direction.

AnalysisManager is already explicitly instantiated, and getResultImpl
doesn't need to be inlined. Move the definition to an Impl header, and
include that header in files that explicitly instantiate
AnalysisManager. There are only four (real) IR units:
- function
- module
- loop
- cgscc

Looking at a specific transform (ArgumentPromotion.cpp), here are three
compilations before & after this change:

BEFORE:
$ for i in $(seq 3) ; do ./ccit.bat ; done
peak memory: 258.15MB
real: 0m6.297s
peak memory: 257.54MB
real: 0m5.906s
peak memory: 257.47MB
real: 0m6.219s

AFTER:
$ for i in $(seq 3) ; do ./ccit.bat ; done
peak memory: 235.35MB
real: 0m5.454s
peak memory: 234.72MB
real: 0m5.235s
peak memory: 234.39MB
real: 0m5.469s

The 20MB of memory saved seems real, and the time improvement seems like
it is there.

Reviewed By: MaskRay

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

4 years agoRevert "[SVE] Fix bug in simplification of scalable vector instructions"
Reid Kleckner [Mon, 3 Feb 2020 19:12:09 +0000 (11:12 -0800)]
Revert "[SVE] Fix bug in simplification of scalable vector instructions"

This reverts commit 31574d38ac5fa4646cf01dd252a23e682402134f.

The newly added shufflevector test does not pass locally on either of my
workstations.

4 years ago[llvm-objdump] Suppress spurious warnings when parsing Mach-O binaries.
Michael Trent [Wed, 29 Jan 2020 19:07:53 +0000 (11:07 -0800)]
[llvm-objdump] Suppress spurious warnings when parsing Mach-O binaries.

Summary:
llvm-objdump started warning when asked to disassemble a section that
isn't present in the input files, in Yuanfang Chen's change:
d16c162c9453db855503134fe29ae4a3c0bec936. The problem is that the
logic was restricted only to the generic llvm-objdump parser, not to the
Mach-O-specific parser used for Apple toolchain compatibility. The
solution is to log section names from the Mach-O parser.

The macho-cstring-dump.test has been updated to fail if it encounters
this new warning in the future.

Reviewers: pete, ab, lhames, jhenderson, grimar, MaskRay, ychen

Reviewed By: jhenderson, grimar

Subscribers: rupprecht, llvm-commits

Tags: #llvm

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

4 years ago[lldb] Remove unused parameter from ValueObject::GetExpressionPath
Alex Langford [Sun, 2 Feb 2020 22:17:02 +0000 (14:17 -0800)]
[lldb] Remove unused parameter from ValueObject::GetExpressionPath

I previously removed the code in ValueObject::GetExpressionPath that
took advantage of the parameter `qualify_cxx_base_classes`. As a result,
this is now unused and can be removed.

4 years ago[lldb] Delete ClangForward.h
Alex Langford [Sat, 1 Feb 2020 07:04:55 +0000 (23:04 -0800)]
[lldb] Delete ClangForward.h

Summary:
I think that there are very few things from clang that actually need forward
declaration, so not having a ClangForward header makes sense.

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

4 years ago[clang] detect switch fallthrough marked by a comment (PR43465)
Luboš Luňák [Sun, 2 Feb 2020 19:13:41 +0000 (20:13 +0100)]
[clang] detect switch fallthrough marked by a comment (PR43465)

The regex can be extended if needed, but this should probably handle
most of the cases.

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

4 years ago[LoopUtils] Make duplicate method a utility. [NFCI]
Alina Sbirlea [Mon, 27 Jan 2020 21:36:41 +0000 (13:36 -0800)]
[LoopUtils] Make duplicate method a utility. [NFCI]

Summary:
Method appendLoopsToWorklist is duplicate in LoopUnroll and in the
LoopPassManager as an internal method. Make it an utility.

Reviewers: dmgreen, chandlerc, fedor.sergeev, yamauchi

Subscribers: mehdi_amini, hiraditya, zzheng, llvm-commits

Tags: #llvm

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

4 years ago[SVE] Fix bug in simplification of scalable vector instructions
Christopher Tetreault [Mon, 3 Feb 2020 15:46:00 +0000 (07:46 -0800)]
[SVE] Fix bug in simplification of scalable vector instructions

Summary:
* Most of the simplifications in SimplifyShuffleVectorInst depend on the
concrete value of, or the length of the mask vector. For scalable
vectors, this cannot be known at compile time.
** for these tests, detect if the vector is scalable before attempting
the transformation
* The functions ShuffleVectorInst::getMaskValue and
ShuffleVectorInst::getShuffleMask access the value of the constant mask.
However, since the length of the mask is unknown at compile time, these
function do not work for scalable vectors. Add asserts to ensure that
the input mask is not scalable

Reviewers: efriedma, sdesmalen, apazos, chrisj, huihuiz

Reviewed By: efriedma

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years ago[SimplifyLibCalls] Remove unused IRBuilder argument; NFC
Nikita Popov [Mon, 3 Feb 2020 18:12:57 +0000 (19:12 +0100)]
[SimplifyLibCalls] Remove unused IRBuilder argument; NFC

isLocallyOpenedFile() does not use IRBuilder.

4 years ago[IRBuilder] Add missing NoFolder::CreatePointerBitCastOrAddrSpaceCast(); NFC
Nikita Popov [Mon, 3 Feb 2020 18:10:20 +0000 (19:10 +0100)]
[IRBuilder] Add missing NoFolder::CreatePointerBitCastOrAddrSpaceCast(); NFC

Split out from D73835. This method was added to ConstantFolder and
TargetFolder, but not NoFolder.

4 years agoRevert "[CodeGenModule] Assume dso_local for -fpic -fno-semantic-interposition"
Fangrui Song [Mon, 3 Feb 2020 18:09:39 +0000 (10:09 -0800)]
Revert "[CodeGenModule] Assume dso_local for -fpic -fno-semantic-interposition"

This reverts commit 789a46f2d742e11edaade28cb59a0f4d2a1d770e.

Accidentally committed.

4 years ago[IRBuilder] Remove unnecessary NoFolder methods; NFCI
Nikita Popov [Mon, 3 Feb 2020 18:05:58 +0000 (19:05 +0100)]
[IRBuilder] Remove unnecessary NoFolder methods; NFCI

Split out from D73835: These methods are not part of the
ConstantFolder API and as such don't serve a purpose.

4 years ago[X86] getTargetShuffleMask - use getConstantOperandVal helper. NFCI.
Simon Pilgrim [Mon, 3 Feb 2020 17:50:32 +0000 (17:50 +0000)]
[X86] getTargetShuffleMask - use getConstantOperandVal helper. NFCI.

4 years ago[InstCombine] Add replaceOperand() helper
Nikita Popov [Fri, 31 Jan 2020 21:23:33 +0000 (22:23 +0100)]
[InstCombine] Add replaceOperand() helper

Adds a replaceOperand() helper, which is like Instruction.setOperand()
but adds the old operand to the worklist. This reduces the amount of
missing or incorrect worklist management.

This only applies the helper to a relatively small subset of
setOperand() calls in InstCombine, namely those of the pattern
`I.setOperand(); return &I;`, where it is most obviously applicable.

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

4 years ago[InstCombine] Rename worklist methods; NFC
Nikita Popov [Thu, 30 Jan 2020 21:32:46 +0000 (22:32 +0100)]
[InstCombine] Rename worklist methods; NFC

This renames Worklist.AddDeferred() to Worklist.add() and
Worklist.Add() to Worklist.push(). The intention here is that
Worklist.add() should be the go-to method for explicit worklist
management, while the raw Worklist.push() is mostly for
InstCombine internals. I will then migrate uses of Worklist.push()
to Worklist.add() in followup changes.

As suggested by spatel on D73411 I'm also changing the remaining
method names to lowercase first character, in line with current
coding standards.

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

4 years ago[CodeGenModule] Assume dso_local for -fpic -fno-semantic-interposition
Fangrui Song [Sun, 2 Feb 2020 20:23:47 +0000 (12:23 -0800)]
[CodeGenModule] Assume dso_local for -fpic -fno-semantic-interposition

Summary:
Clang -fpic defaults to -fno-semantic-interposition (GCC -fpic defaults
to -fsemantic-interposition).
Users need to specify -fsemantic-interposition to get semantic
interposition behavior.

Semantic interposition is currently a best-effort feature. There may
still be some cases where it is not handled well.

Reviewers: peter.smith, rnk, serge-sans-paille, sfertile, jfb, jdoerfert

Subscribers: dschuff, jyknight, dylanmckay, nemanjai, jvesely, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, arphaman, PkmX, jocewei, jsji, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, cfe-commits

Tags: #clang

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

4 years ago[ARM] Expand vector reduction intrinsics on soft float
Nikita Popov [Sun, 2 Feb 2020 17:44:18 +0000 (18:44 +0100)]
[ARM] Expand vector reduction intrinsics on soft float

Followup to D73135. If the target doesn't have hard float (default
for ARM), then we assert when trying to soften the result of vector
reduction intrinsics. This patch marks these for expansion as well.
(A bit odd to use vectors on a target without hard float ... but
that's where you end up if you expose target-independent vector types.)

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

4 years ago[Examples] Link BitReader in ThinLtoJIT example
Nikita Popov [Mon, 3 Feb 2020 17:46:59 +0000 (18:46 +0100)]
[Examples] Link BitReader in ThinLtoJIT example

D72486 broke the shared library build.

4 years ago[InstCombine] Fix unused variable warning; NFC
Nikita Popov [Mon, 3 Feb 2020 17:41:31 +0000 (18:41 +0100)]
[InstCombine] Fix unused variable warning; NFC

4 years ago[OPENMP][DOCS]Update status of conditional lastprivate, NFC.
Alexey Bataev [Mon, 3 Feb 2020 17:43:40 +0000 (12:43 -0500)]
[OPENMP][DOCS]Update status of conditional lastprivate, NFC.

4 years ago[OPENMP50]Codegen support for order(concurrent) clause.
Alexey Bataev [Mon, 3 Feb 2020 17:08:16 +0000 (12:08 -0500)]
[OPENMP50]Codegen support for order(concurrent) clause.

Emit llvm parallel access metadata for the loops if they are marked as
order(concurrent).

4 years ago[ThinLTO] More efficient export computation (NFC)
Teresa Johnson [Sun, 2 Feb 2020 16:06:43 +0000 (08:06 -0800)]
[ThinLTO] More efficient export computation (NFC)

Summary:
A recent change to enable more importing of global variables with
references exposed some efficiency issues with export computation.
See D73724 for more information and detailed analysis.

The first was specific to variable importing. The code was marking every
copy of a referenced value (from possibly thousands of files in the case
of linkonce_odr) as exported, and we only need to mark the copy in the
module containing the variable def being imported as exported. The
reason is that this is tracking what values are newly exported as a
result of importing. Anything that was defined in another module and
simply used in the exporting module is already exported, and would have
been identified by the caller (e.g. the LTO API implementations).

The second issue is that the code was re-adding previously exported
values (along with all references). It is easy to identify when a
variable was already imported into the same module (via the
import list insert call return value), and we already did this for
function importing. However, what we weren't doing for either function
or variable importing was avoiding a re-insertion when it was previously
exported into a different importing module. The reason we couldn't do
this is there was no way of telling from the export list whether it was
previously inserted there because its definition was exported (in which
case we already marked all its references as exported) from when it was
inserted there because it was referenced by another exported value (in
which case we haven't yet inserted its own references).

To address this we can restructure the way the export list is
constructed. This patch only adds the actual imported definitions
(variable or function) to the export list for its module during the
import computation. After import computation is complete, where we were
already post-processing the export list we go ahead and add all
references made by those exported values to the export list.

These changes speed up the thin link not only with constant variable
importing enabled, but also without (due to the efficiency improvement
in function importing).

Some thin link user time measurements for one large application, average
of 5 runs:

With constant variable importing enabled:
- without this patch: 479.5s
- with this patch: 74.6s

Without constant variable importing enabled:
- without this patch: 80.6s
- with this patch: 70.3s

Note I have not re-enabled constant variable importing here, as I would
like to do additional compile time measurements with these fixes first.

Reviewers: evgeny777

Subscribers: mehdi_amini, inglorion, hiraditya, dexonsmith, llvm-commits

Tags: #llvm

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

4 years ago[AMDGPU] getMemOperandsWithOffset: add resource operand for BUF instructions
Jay Foad [Mon, 6 Jan 2020 16:00:01 +0000 (16:00 +0000)]
[AMDGPU] getMemOperandsWithOffset: add resource operand for BUF instructions

Summary:
This prevents unwanted clustering of BUF instructions with the same
vaddr but different resource descriptors.

Reviewers: rampitec, arsenm, nhaehnle

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

Tags: #llvm

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

4 years ago[InstCombine] add tests for casted phi; NFC
Sanjay Patel [Mon, 3 Feb 2020 16:54:12 +0000 (11:54 -0500)]
[InstCombine] add tests for casted phi; NFC

4 years agoHexagonOptAddrMode::changeStore - fix null dereference warning (PR43463)
Simon Pilgrim [Mon, 3 Feb 2020 16:48:49 +0000 (16:48 +0000)]
HexagonOptAddrMode::changeStore - fix null dereference warning (PR43463)

As detailed on PR43463, this fixes a static analyzer null dereference warning by sinking Changed = true into the if() blocks where the MIB is actually created.

I did a quick check that suggested that one of those if() blocks is always guaranteed to be hit (so we could change it to if-else), but this seems like a safer approach

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

4 years ago[TargetLowering] SimplifyDemandedBits - add basic KnownBits ZEXTLoad handling
Simon Pilgrim [Mon, 3 Feb 2020 16:40:34 +0000 (16:40 +0000)]
[TargetLowering] SimplifyDemandedBits - add basic KnownBits ZEXTLoad handling

We have to be careful in SimplifyDemandedBits with loads in case we attempt to combine back to a constant (which then gets turned into a constant pool load again), but we can at least set the upper KnownBits for a ZEXTLoad to zero.

4 years ago[X86] BEXTR SimplifyDemandedBitsForTargetNode - length == 0 -> result = 0
Simon Pilgrim [Mon, 3 Feb 2020 16:11:29 +0000 (16:11 +0000)]
[X86] BEXTR SimplifyDemandedBitsForTargetNode - length == 0 -> result = 0

4 years agoActually, don't try to use __builtin_strlen in StringRef.h before VS 2019
Hans Wennborg [Mon, 3 Feb 2020 16:45:43 +0000 (17:45 +0100)]
Actually, don't try to use __builtin_strlen in StringRef.h before VS 2019

The fix in b3d7d1061dc375bb5ea725e6597382fcd37f41d6 compiled nicely,
but didn't link because at least the VS 2017 version I use doesn't
have the builtin yet. Instead, make use of the builtin with MSVC
conditional on VS 2019 or later.

4 years ago[libFuzzer] Make dataflow and focus functions more user friendly.
Max Moroz [Fri, 31 Jan 2020 21:19:03 +0000 (13:19 -0800)]
[libFuzzer] Make dataflow and focus functions more user friendly.

Summary:
- Fail loudly if SetFocusFunction failed when it should not. For more info see
  - https://github.com/google/oss-fuzz/issues/3311
  - https://github.com/google/sanitizers/issues/1190
- Fail loudly if CollectDataFlow is called without seed corpus.

Reviewers: kcc, metzman

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

4 years ago[Alignment][NFC] Use Align for getMemcpy/Memmove/Memset
Guillaume Chatelet [Mon, 3 Feb 2020 13:49:01 +0000 (14:49 +0100)]
[Alignment][NFC] Use Align for getMemcpy/Memmove/Memset

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: arsenm, dschuff, jyknight, sdardis, nemanjai, jvesely, nhaehnle, sbc100, jgravelle-google, hiraditya, aheejin, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, kerbowa, llvm-commits

Tags: #llvm

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

4 years agoDeclare __builtin_strlen in StringRef.h as constexpr
Hans Wennborg [Mon, 3 Feb 2020 15:56:15 +0000 (16:56 +0100)]
Declare __builtin_strlen in StringRef.h as constexpr

Otherwise Visual Studio 2017 will complain about
llvm::StringRef::strlen not being constexpr:

  StringRef.h(80): error C3615: constexpr function 'llvm::StringRef::strLen' cannot result in a constant expression
  StringRef.h(84): note: failure was caused by call of undefined function or one not declared 'constexpr'

4 years ago[VE] (fp)trunc+store & load+(fp)ext isel
Kazushi (Jam) Marukawa [Mon, 3 Feb 2020 15:55:25 +0000 (16:55 +0100)]
[VE] (fp)trunc+store & load+(fp)ext isel

Summary: load+sext/zext/fpext and (fp)trunc+store isel legalization and tests

Reviewers: arsenm, craig.topper, rengolin, k-ishizaka

Reviewed By: arsenm

Subscribers: merge_guards_bot, wdng, hiraditya, llvm-commits

Tags: #ve, #llvm

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

4 years ago[X86] computeKnownBitsForTargetNode - add BEXTR support (PR39153)
Simon Pilgrim [Mon, 3 Feb 2020 15:43:40 +0000 (15:43 +0000)]
[X86] computeKnownBitsForTargetNode - add BEXTR support (PR39153)

Add a KnownBits::extractBits helper

4 years agobuild_llvm_package.bat: Use a short form of the git revision
Hans Wennborg [Mon, 3 Feb 2020 15:39:18 +0000 (16:39 +0100)]
build_llvm_package.bat: Use a short form of the git revision

4 years ago[X86] FUCOMI/FCOMI instructions should Def FPSW not FPCW.
Craig Topper [Mon, 3 Feb 2020 15:13:57 +0000 (07:13 -0800)]
[X86] FUCOMI/FCOMI instructions should Def FPSW not FPCW.

These instructions can set the exception in FPSW. But I
don't think they can change FPCW. So this looks like a typo.

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

4 years ago[OPENMP50]Basic parsing/sema analysis for order(concurrent) clause.
Alexey Bataev [Fri, 31 Jan 2020 21:09:26 +0000 (16:09 -0500)]
[OPENMP50]Basic parsing/sema analysis for order(concurrent) clause.

Added parsing/sema/serialization support for order(concurrent) clause in
loop|simd-based directives.

4 years ago[InstCombine] regenerate complete test checks; NFC
Sanjay Patel [Mon, 3 Feb 2020 15:23:09 +0000 (10:23 -0500)]
[InstCombine] regenerate complete test checks; NFC

4 years ago[VE] vaarg functions callers and callees
Kazushi (Jam) Marukawa [Mon, 3 Feb 2020 13:29:01 +0000 (14:29 +0100)]
[VE] vaarg functions callers and callees

Summary: Isel patterns and tests for vaarg functions as callers and callees.

Reviewers: arsenm, rengolin, k-ishizaka

Subscribers: merge_guards_bot, wdng, hiraditya, llvm-commits

Tags: #ve, #llvm

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

4 years ago[clang-tidy] Fix a false positive about C++17 deduced class template types in unused...
Haojian Wu [Mon, 3 Feb 2020 12:59:46 +0000 (13:59 +0100)]
[clang-tidy] Fix a false positive about C++17 deduced class template types in unused-using-decl check.

Reviewers: gribozavr2

Subscribers: xazax.hun, cfe-commits

Tags: #clang

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

4 years ago[X86] Add some initial BEXTR combine tests
Simon Pilgrim [Mon, 3 Feb 2020 15:16:14 +0000 (15:16 +0000)]
[X86] Add some initial BEXTR combine tests

4 years ago[X86] Move BEXTR DemandedBits handling inside SimplifyDemandedBitsForTargetNode
Simon Pilgrim [Mon, 3 Feb 2020 14:01:12 +0000 (14:01 +0000)]
[X86] Move BEXTR DemandedBits handling inside SimplifyDemandedBitsForTargetNode

Some prep work for PR39153.

4 years agoAMDGPU: Fix extra type mangling on llvm.amdgcn.if.break
Matt Arsenault [Mon, 3 Feb 2020 14:07:36 +0000 (09:07 -0500)]
AMDGPU: Fix extra type mangling on llvm.amdgcn.if.break

These have to be the same mask type.

4 years agoRevert "[OpenMP][OMPIRBuilder] Add Directives (master and critical) to OMPBuilder."
Johannes Doerfert [Mon, 3 Feb 2020 14:58:24 +0000 (08:58 -0600)]
Revert "[OpenMP][OMPIRBuilder] Add Directives (master and critical) to OMPBuilder."

This reverts commit 1ca740387b9bbdc142ac81c8bdd6370a8813e328.

The bots break [0], investigation is needed.

[0] http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/22899

4 years ago[Concepts] Instantiate invented template type parameter type-constraint along with...
Saar Raz [Mon, 3 Feb 2020 13:44:33 +0000 (15:44 +0200)]
[Concepts] Instantiate invented template type parameter type-constraint along with function parameters

We previously instantiated type-constraints of template type parameters along with the type parameter itself,
this caused problems when the type-constraints created by abbreviated templates refreneced other parameters
in the abbreviated templates.

When encountering a template type parameter with a type constraint, if it is implicit, delay instantiation of
the type-constraint until the function parameter which created the invented template type parameter is
instantiated.

Reland after fixing bug caused by another flow reaching SubstParmVarDecl and instantiating the TypeConstraint
a second time.

4 years ago[OpenMP][OMPIRBuilder] Add Directives (master and critical) to OMPBuilder.
Fady Ghanim [Mon, 3 Feb 2020 14:38:43 +0000 (08:38 -0600)]
[OpenMP][OMPIRBuilder] Add Directives (master and critical) to OMPBuilder.

Add support for Master and Critical directive in the OMPIRBuilder. Both make use of a new common interface for emitting inlined OMP regions called `emitInlinedRegion` which was added in this patch as well.

Also this patch modifies clang to use the new directives when  `-fopenmp-enable-irbuilder` commandline option is passed.

Reviewed By: jdoerfert

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

4 years ago[FPEnv][AArch64] Add lowering of f128 STRICT_FSETCC
John Brawn [Tue, 28 Jan 2020 14:04:09 +0000 (14:04 +0000)]
[FPEnv][AArch64] Add lowering of f128 STRICT_FSETCC

These get lowered to function calls, like the non-strict versions.

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

4 years ago[Hexagon] Rename FeatureHasPreV65 to FeaturePreV65
Krzysztof Parzyszek [Mon, 3 Feb 2020 13:22:46 +0000 (07:22 -0600)]
[Hexagon] Rename FeatureHasPreV65 to FeaturePreV65

4 years ago[InstCombine] reassociate splatted vector ops
Sanjay Patel [Mon, 3 Feb 2020 13:55:43 +0000 (08:55 -0500)]
[InstCombine] reassociate splatted vector ops

bo (splat X), (bo Y, OtherOp) --> bo (splat (bo X, Y)), OtherOp

This patch depends on the splat analysis enhancement in D73549.
See the test with comment:
; Negative test - mismatched splat elements
...as the motivation for that first patch.

The motivating case for reassociating splatted ops is shown in PR42174:
https://bugs.llvm.org/show_bug.cgi?id=42174

In that example, a slight change in order-of-associative math results
in a big difference in IR and codegen. This patch gets all of the
unnecessary shuffles out of the way, but doesn't address the potential
scalarization (see D50992 or D73480 for that).

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

4 years agoRevert "[Concepts] Instantiate invented template type parameter type-constraint along...
Saar Raz [Mon, 3 Feb 2020 14:04:48 +0000 (16:04 +0200)]
Revert "[Concepts] Instantiate invented template type parameter type-constraint along with function parameters"

This temporarily reverts commit eacca4824463d8b96e2e1c9f8bbf886055218a16, which caused some test failures.

4 years agoReland "[lldb] Increase the rate at which ConstString's memory allocator scales the...
Raphael Isemann [Mon, 3 Feb 2020 13:22:24 +0000 (14:22 +0100)]
Reland "[lldb] Increase the rate at which ConstString's memory allocator scales the memory chunks it allocates""

The parent revision is now passing the sanitizer bots and landed as 46e5603c8a08de6c5983ed7eb4f12828bbfcbd78,
so this can now actually land.

4 years ago[Concepts] Instantiate invented template type parameter type-constraint along with...
Saar Raz [Mon, 3 Feb 2020 13:44:33 +0000 (15:44 +0200)]
[Concepts] Instantiate invented template type parameter type-constraint along with function parameters

We previously instantiated type-constraints of template type parameters along with the type parameter itself,
this caused problems when the type-constraints created by abbreviated templates refreneced other parameters
in the abbreviated templates.

When encountering a template type parameter with a type constraint, if it is implicit, delay instantiation of
the type-constraint until the function parameter which created the invented template type parameter is
instantiated.

4 years agoAMDGPU/GlobalISel: Reduce indentation
Matt Arsenault [Sat, 1 Feb 2020 16:19:38 +0000 (11:19 -0500)]
AMDGPU/GlobalISel: Reduce indentation

4 years agoAMDGPU/GlobalISel: Fix mem size in test
Matt Arsenault [Mon, 3 Feb 2020 01:15:54 +0000 (20:15 -0500)]
AMDGPU/GlobalISel: Fix mem size in test

This wasn't intended to tests an extload.

4 years ago[NFC][VE] format VEInstrInfo
Simon Moll [Mon, 3 Feb 2020 13:25:49 +0000 (14:25 +0100)]
[NFC][VE] format VEInstrInfo

4 years ago[NFC] unsigned->Register in storeRegTo/loadRegFromStack
Simon Moll [Mon, 3 Feb 2020 13:22:06 +0000 (14:22 +0100)]
[NFC] unsigned->Register in storeRegTo/loadRegFromStack

Summary:
This patch makes progress on the 'unsigned -> Register' rewrite for
`TargetInstrInfo::loadRegFromStack` and `TII::storeRegToStack`.

Reviewers: arsenm, craig.topper, uweigand, jpienaar, atanasyan, venkatra, robertlytton, dylanmckay, t.p.northover, kparzysz, tstellar, k-ishizaka

Reviewed By: arsenm

Subscribers: wuzish, merge_guards_bot, jyknight, sdardis, nemanjai, jvesely, wdng, nhaehnle, hiraditya, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, kerbowa, llvm-commits

Tags: #llvm

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

4 years ago[Alignment][NFC] Use Align for code creating MemOp
Guillaume Chatelet [Mon, 3 Feb 2020 12:09:53 +0000 (13:09 +0100)]
[Alignment][NFC] Use Align for code creating MemOp

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[FPEnv][ARM] Add lowering of STRICT_FSETCC and STRICT_FSETCCS
John Brawn [Wed, 22 Jan 2020 14:04:12 +0000 (14:04 +0000)]
[FPEnv][ARM] Add lowering of STRICT_FSETCC and STRICT_FSETCCS

These can be lowered to code sequences using CMPFP and CMPFPE which then get
selected to VCMP and VCMPE. The implementation isn't fully correct, as the chain
operand isn't handled correctly, but resolving that looks like it would involve
changes around FPSCR-handling instructions and how the FPSCR is modelled.

The fp-intrinsics test was already testing some of this but as the entire test
was being XFAILed it wasn't noticed. Un-XFAIL the test and instead leave the
cases where we aren't generating the right instruction sequences as FIXME.

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

4 years agoAllow modernize-use-using to apply to enumerations as well.
Karasev Nikita [Mon, 3 Feb 2020 12:53:08 +0000 (07:53 -0500)]
Allow modernize-use-using to apply to enumerations as well.

This addresses PR44528.

4 years ago[mlir] ConvertStandardToLLVM: do not rely on command line options internally
Alex Zinenko [Mon, 3 Feb 2020 12:49:21 +0000 (13:49 +0100)]
[mlir] ConvertStandardToLLVM: do not rely on command line options internally

The patterns for converting `std.alloc` and `std.dealoc` can be configured to
use `llvm.alloca` instead of calling `malloc` and `free`. This configuration
has been only possible through a command-line flag, despite the presence of a
(misleading) parameter in the pass constructor. Use the parameter instead and
only initalize it from the command line flags if the pass is constructed from
the mlir-opt registration.

4 years ago[clang] Add a missing change of bdbdf748225525bb18cd0ffeb51c3e713f7b8e1b, fix the...
Haojian Wu [Mon, 3 Feb 2020 12:43:26 +0000 (13:43 +0100)]
[clang] Add a missing change of bdbdf748225525bb18cd0ffeb51c3e713f7b8e1b, fix the buildbot.

4 years ago[lldb] Make the order in which ClusterManager calls destructors deterministic
Raphael Isemann [Mon, 3 Feb 2020 12:32:52 +0000 (13:32 +0100)]
[lldb] Make the order in which ClusterManager calls destructors deterministic

Summary:
ClusterManager is using a SmallPtrSet to store the objects in it. We always only add every object once so using a set is not necessary.
Furthermore having a set means that iterating over it is nondeterministic (at least with more than 16 objects in it), so the order in
which the destructors for the managed objects are called is currently also non-deterministic.

This just replaces the SmallPtrSet with a SmallVector.

Reviewers: labath, JDevlieghere

Reviewed By: labath

Subscribers: mgrang, abidh, lldb-commits

Tags: #lldb

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

4 years ago[mlir] Drop customization hooks from StandardToLLVM conversion
Alex Zinenko [Fri, 31 Jan 2020 18:52:40 +0000 (19:52 +0100)]
[mlir] Drop customization hooks from StandardToLLVM conversion

Summary:
These hooks were originally introduced to support passes deriving the
StandardToLLVM conversion, in particular converting types from different
dialects to LLVM types in a single-step conversion. They are no longer in use
since the pass and conversion infrastructure has evolved sufficiently to make
defining new passes with exactly the same functionality simple through the use
of populate* functions, conversion targets and type converters. Remove the
hooks. Any users of this hooks can call the dialect conversion infrastructure
directly instead, which is likely to require less LoC than these hooks.

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

4 years ago[DebugInfo][test] Adjust line table unit length to account for contents
James Henderson [Fri, 31 Jan 2020 10:51:10 +0000 (10:51 +0000)]
[DebugInfo][test] Adjust line table unit length to account for contents

Previously, if a debug line Prologue was created via
createBasicPrologue, its TotalLength field did not account for any
contents in the table itself. This change fixes this issue.

Reviewed by: probinson

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

4 years ago[mlir] Fix link to 'Getting started with MLIR'
Marius Brehler [Mon, 3 Feb 2020 12:00:04 +0000 (13:00 +0100)]
[mlir] Fix link to 'Getting started with MLIR'

The link in the toy example pointed to the 'tensorflow/mlir' repo and is
replaced with https://mlir.llvm.org.

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

4 years ago[ARM,MVE] Fix vreinterpretq in big-endian mode.
Simon Tatham [Mon, 3 Feb 2020 09:35:36 +0000 (09:35 +0000)]
[ARM,MVE] Fix vreinterpretq in big-endian mode.

Summary:
In big-endian MVE, the simple vector load/store instructions (i.e.
both contiguous and non-widening) don't all store the bytes of a
register to memory in the same order: it matters whether you did a
VSTRB.8, VSTRH.16 or VSTRW.32. Put another way, the in-register
formats of different vector types relate to each other in a different
way from the in-memory formats.

So, if you want to 'bitcast' or 'reinterpret' one vector type as
another, you have to carefully specify which you mean: did you want to
reinterpret the //register// format of one type as that of the other,
or the //memory// format?

The ACLE `vreinterpretq` intrinsics are specified to reinterpret the
register format. But I had implemented them as LLVM IR bitcast, which
is specified for all types as a reinterpretation of the memory format.
So a `vreinterpretq` intrinsic, applied to values already in registers,
would code-generate incorrectly if compiled big-endian: instead of
emitting no code, it would emit a `vrev`.

To fix this, I've introduced a new IR intrinsic to perform a
register-format reinterpretation: `@llvm.arm.mve.vreinterpretq`. It's
implemented by a trivial isel pattern that expects the input in an
MQPR register, and just returns it unchanged.

In the clang codegen, I only emit this new intrinsic where it's
actually needed: I prefer a bitcast wherever it will have the right
effect, because LLVM understands bitcasts better. So we still generate
bitcasts in little-endian mode, and even in big-endian when you're
casting between two vector types with the same lane size.

For testing, I've moved all the codegen tests of vreinterpretq out
into their own file, so that they can have a different set of RUN
lines to check both big- and little-endian.

Reviewers: dmgreen, MarkMurrayARM, miyuki, ostannard

Reviewed By: dmgreen

Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years ago[ARM,MVE] Add intrinsics for v[id]dupq and v[id]wdupq.
Simon Tatham [Fri, 31 Jan 2020 10:53:31 +0000 (10:53 +0000)]
[ARM,MVE] Add intrinsics for v[id]dupq and v[id]wdupq.

Summary:
These instructions generate a vector of consecutive elements starting
from a given base value and incrementing by 1, 2, 4 or 8. The `wdup`
versions also wrap the values back to zero when they reach a given
limit value. The instruction updates the scalar base register so that
another use of the same instruction will continue the sequence from
where the previous one left off.

At the IR level, I've represented these instructions as a family of
target-specific intrinsics with two return values (the constructed
vector and the updated base). The user-facing ACLE API provides a set
of intrinsics that throw away the written-back base and another set
that receive it as a pointer so they can update it, plus the usual
predicated versions.

Because the intrinsics return two values (as do the underlying
instructions), the isel has to be done in C++.

This is the first family of MVE intrinsics that use the `imm_1248`
immediate type in the clang Tablegen framework, so naturally, I found
I'd given it the wrong C integer type. Also added some tests of the
check that the immediate has a legal value, because this is the first
time those particular checks have been exercised.

Finally, I also had to fix a bug in MveEmitter which failed an
assertion when I nested two `seq` nodes (the inner one used to extract
the two values from the pair returned by the IR intrinsic, and the
outer one put on by the predication multiclass).

Reviewers: dmgreen, MarkMurrayARM, miyuki, ostannard

Reviewed By: dmgreen

Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years ago[ARM,MVE] Add intrinsics for vdupq.
Simon Tatham [Fri, 31 Jan 2020 10:53:11 +0000 (10:53 +0000)]
[ARM,MVE] Add intrinsics for vdupq.

Summary:
The unpredicated case of this is trivial: the clang codegen just makes
a vector splat of the input, and LLVM isel is already prepared to
handle that. For the predicated version, I've generated a `select`
between the same vector splat and the `inactive` input parameter, and
added new Tablegen isel rules to match that pattern into a predicated
`MVE_VDUP` instruction.

Reviewers: dmgreen, MarkMurrayARM, miyuki, ostannard

Reviewed By: dmgreen

Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years ago[clang][AST] Add an AST matcher for deducedTemplateSpeializationType.
Haojian Wu [Mon, 3 Feb 2020 11:10:56 +0000 (12:10 +0100)]
[clang][AST] Add an AST matcher for deducedTemplateSpeializationType.

Summary:
misc-unused-using clang-tidy check needs this matcher to fix a false
positive of C++17 deduced class template types.

Reviewers: gribozavr2

Reviewed By: gribozavr2

Subscribers: cfe-commits

Tags: #clang

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

4 years agoFix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI.
Simon Pilgrim [Mon, 3 Feb 2020 11:08:48 +0000 (11:08 +0000)]
Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI.

4 years agoReland "[llvm] Add a way to speed up the speed in which BumpPtrAllocator increases...
Raphael Isemann [Mon, 3 Feb 2020 10:13:51 +0000 (11:13 +0100)]
Reland "[llvm] Add a way to speed up the speed in which BumpPtrAllocator increases slab sizes""

Disable the red zone in the unit test allocator to fix the test errors in sanitizer builds.
The red zone changed the amount of allocated bytes which made the test fail as it
checked the number of allocated bytes of the allocator.

4 years ago[LLDB] Add missing declarations for linking to psapi
Martin Storsjö [Sat, 1 Feb 2020 20:45:28 +0000 (22:45 +0200)]
[LLDB] Add missing declarations for linking to psapi

This fixes building for mingw with BUILD_SHARED_LIBS. In static builds,
the psapi dependency gets linked in transitively from Support, but
when linking Support dynamically, it's revealed that these components
also need linking against psapi.

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

4 years ago[llvm-exegesis] Restrict the range of allowable rounding countrols.
Clement Courbet [Fri, 24 Jan 2020 11:51:39 +0000 (12:51 +0100)]
[llvm-exegesis] Restrict the range of allowable rounding countrols.

Summary:
It turns out that CUR_DIRECTION is just an internal placeholder, not an actual
valid encoded value.

Reviewers: gchatelet

Subscribers: tschuett, mstojanovic, llvm-commits

Tags: #llvm

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

4 years ago[MLIR][Linalg] Lower linalg.generic to ploops.
Alexander Belyaev [Fri, 31 Jan 2020 10:34:15 +0000 (11:34 +0100)]
[MLIR][Linalg] Lower linalg.generic to ploops.

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

4 years agoFixed a -Wunused-variable warning in no-assertion builds
Dmitri Gribenko [Mon, 3 Feb 2020 10:49:11 +0000 (11:49 +0100)]
Fixed a -Wunused-variable warning in no-assertion builds

4 years agoMake quick-append.test resilient to running in paths with '1.o' in the name
Hans Wennborg [Mon, 3 Feb 2020 10:34:36 +0000 (11:34 +0100)]
Make quick-append.test resilient to running in paths with '1.o' in the name

4 years ago[clangd] TUScheduler::run() (i.e. workspace/symbol) counts towards concurrent threads
Sam McCall [Mon, 3 Feb 2020 10:31:51 +0000 (11:31 +0100)]
[clangd] TUScheduler::run() (i.e. workspace/symbol) counts towards concurrent threads

This seems to just be an oversight.

4 years ago[clangd] Refactor TUScheduler options into a struct. NFC
Sam McCall [Mon, 3 Feb 2020 10:18:13 +0000 (11:18 +0100)]
[clangd] Refactor TUScheduler options into a struct. NFC

4 years agoRevert "[llvm] Add a way to speed up the speed in which BumpPtrAllocator increases...
Raphael Isemann [Mon, 3 Feb 2020 10:10:50 +0000 (11:10 +0100)]
Revert "[llvm] Add a way to speed up the speed in which BumpPtrAllocator increases slab sizes"

This reverts commit b848b510a8d52dbf50ee53a9a1ce844abb60d9bd as the unit tests
fail on the sanitizer bots:
/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/unittests/Support/AllocatorTest.cpp:145: Failure
      Expected: SlabSize
      Which is: 4096
To be equal to: Alloc.getTotalMemory()
      Which is: 4097

4 years agoRevert "[lldb] Increase the rate at which ConstString's memory allocator scales the...
Raphael Isemann [Mon, 3 Feb 2020 10:09:36 +0000 (11:09 +0100)]
Revert "[lldb] Increase the rate at which ConstString's memory allocator scales the memory chunks it allocates"

This reverts commit 500c324fa13eec2b171f4ea4dbed2ac1251f5aae because its parent commit
b848b510a8d52dbf50ee53a9a1ce844abb60d9bd is failing on the sanitizer bots.

4 years agoRevert "[libcxx] Force-cache LIBCXX_CXX_ABI_LIBRARY_PATH"
Sergej Jaskiewicz [Fri, 31 Jan 2020 11:35:43 +0000 (14:35 +0300)]
Revert "[libcxx] Force-cache LIBCXX_CXX_ABI_LIBRARY_PATH"

This reverts commit 41f4dfd63ea0fe995ddfba1838aa5ed972cc1377.

It broke standalone libc++ builds, which now try to use libc++abi from the wrong directory, instead of system instance.

(cherry picked from commit 3573526c0286c9461f0459be1a4592b2214594e7)

4 years agoFix broken invariant
Guillaume Chatelet [Fri, 31 Jan 2020 17:30:38 +0000 (18:30 +0100)]
Fix broken invariant

Summary:
A Copy with a source that is zeros is the same as a Set of zeros.
This fixes the invariant that SrcAlign should always be non-null.

Reviewers: courbet

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[lldb] Increase the rate at which ConstString's memory allocator scales the memory...
Raphael Isemann [Mon, 3 Feb 2020 08:12:38 +0000 (09:12 +0100)]
[lldb] Increase the rate at which ConstString's memory allocator scales the memory chunks it allocates

Summary:
We currently do far more malloc calls than necessary in the ConstString BumpPtrAllocator. This is due to the 256 BumpPtrAllocators
our ConstString implementation uses internally which end up all just receiving a small share of the total allocated memory
and therefore keep allocating memory in small chunks for far too long. This patch fixes this by increasing the rate at which we increase the
memory chunk size so that our collection of BumpPtrAllocators behaves in total similar to a single BumpPtrAllocator.

Reviewers: llunak

Reviewed By: llunak

Subscribers: abidh, JDevlieghere, lldb-commits

Tags: #lldb

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

4 years ago[llvm-exegesis] Add pfm counters for Zen2 (znver2).
Clement Courbet [Tue, 31 Dec 2019 10:28:40 +0000 (11:28 +0100)]
[llvm-exegesis] Add pfm counters for Zen2 (znver2).

Summary: There are no counters for individual ports, but this is already
enough to find a lot of issues in the current model (upcoming patch).

Reviewers: dblaikie, gchatelet

Subscribers: hiraditya, tschuett, RKSimon, llvm-commits

Tags: #llvm

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

4 years ago[AMDGPU] Don't remove short branches over kills
Jay Foad [Fri, 31 Jan 2020 10:42:20 +0000 (10:42 +0000)]
[AMDGPU] Don't remove short branches over kills

Summary:
D68092 introduced a new SIRemoveShortExecBranches optimization pass and
broke some graphics shaders. The problem is that it was removing
branches over KILL pseudo instructions, and the fix is to explicitly
check for that in mustRetainExeczBranch.

Reviewers: critson, arsenm, nhaehnle, cdevadas, hakzsam

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

Tags: #llvm

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

4 years ago[MLIR] Make gpu.launch implicitly capture uses of values defined above.
Stephan Herhut [Fri, 31 Jan 2020 09:29:29 +0000 (10:29 +0100)]
[MLIR] Make gpu.launch implicitly capture uses of values defined above.

Summary:
In the original design, gpu.launch required explicit capture of uses
and passing them as operands to the gpu.launch operation. This was
motivated by infrastructure restrictions rather than design. This
change lifts the requirement and removes the concept of kernel
arguments from gpu.launch. Instead, the kernel outlining
transformation now does the explicit capturing.

This is a breaking change for users of gpu.launch.

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

4 years ago[JumpThreading] Half the duplicate threshold at Oz
Sam Parker [Mon, 3 Feb 2020 08:02:12 +0000 (08:02 +0000)]
[JumpThreading] Half the duplicate threshold at Oz

Duplicating instructions can lead to code size increases but using
a threshold of 3 is good for reducing code size.

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

4 years ago[mlir] NFC: Fix trivial typo in comment
Kazuaki Ishizaki [Sun, 26 Jan 2020 15:13:26 +0000 (00:13 +0900)]
[mlir] NFC: Fix trivial typo in comment

Summary: Also, an exercise to merge this into the master myself after a reviewer gives LGTM.

Reviewers: nicolasvasilache, mehdi_amini

Reviewed By: mehdi_amini

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

Tags: #llvm

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

4 years ago[llvm] Add a way to speed up the speed in which BumpPtrAllocator increases slab sizes
Raphael Isemann [Mon, 3 Feb 2020 07:37:12 +0000 (08:37 +0100)]
[llvm] Add a way to speed up the speed in which BumpPtrAllocator increases slab sizes

Summary:
In D68549 we noticed that our BumpPtrAllocator we use for LLDB's ConstString implementation is growing its slabs at
a rate that is too slow for our use case. It causes that we spend a lot of time calling `malloc` for all the tiny slabs that our
ConstString BumpPtrAllocators create. We also can't just increase the slab size in the ConstString implementation
(which is what D68549 originally did) as this really increased the amount of (mostly unused) allocated memory
in any process using ConstString.

This patch adds a template argument for the BumpPtrAllocatorImpl that allows specifying a faster rate at which the
BumpPtrAllocator increases the slab size. This allows LLDB to specify a faster rate at which the slabs grow which
should keep both memory consumption and time spent calling malloc low.

Reviewers: george.karpenkov, chandlerc, NoQ

Subscribers: NoQ, llvm-commits, llunak

Tags: #llvm

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