Johannes Doerfert [Fri, 11 Oct 2019 01:45:32 +0000 (01:45 +0000)]
[Attributor][FIX] Do not replace musstail calls with constant
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374498
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 11 Oct 2019 01:28:27 +0000 (01:28 +0000)]
AMDGPU: Move SelectFlatOffset back into AMDGPUISelDAGToDAG
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374495
91177308-0d34-0410-b5e6-
96231b3b80d8
Volodymyr Sapsai [Fri, 11 Oct 2019 00:57:41 +0000 (00:57 +0000)]
[Stats] Add ALWAYS_ENABLED_STATISTIC enabled regardless of LLVM_ENABLE_STATS.
The intended usage is to measure relatively expensive operations. So the
cost of the statistic is negligible compared to the cost of a measured
operation and can be enabled all the time without impairing the
compilation time.
rdar://problem/
55715134
Reviewers: dsanders, bogner, rtereshin
Reviewed By: dsanders
Subscribers: hiraditya, jkorous, dexonsmith, ributzka, cfe-commits, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68252
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374490
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 11 Oct 2019 00:38:51 +0000 (00:38 +0000)]
[X86] Improve the AVX512 bailout in combineTruncateWithSat to allow pack instructions in more situations.
If we don't have VLX we won't end up selecting a saturating
truncate for 256-bit or smaller vectors so we should just use
the pack lowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374487
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 11 Oct 2019 00:38:41 +0000 (00:38 +0000)]
[X86] Update trunc_packus_v32i32_v32i8 test in min-legal-vector-width.ll to use a load for the large type and add the min-legal-vector-width attribute.
The attribute is needed to avoid zmm registers. Using memory
avoids argument splitting for large vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374486
91177308-0d34-0410-b5e6-
96231b3b80d8
GN Sync Bot [Thu, 10 Oct 2019 23:49:59 +0000 (23:49 +0000)]
gn build: Merge r374476
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374482
91177308-0d34-0410-b5e6-
96231b3b80d8
Vitaly Buka [Thu, 10 Oct 2019 23:49:10 +0000 (23:49 +0000)]
[tsan,msan] Insert module constructors in a module pass
Summary:
If we insert them from function pass some analysis may be missing or invalid.
Fixes PR42877.
Reviewers: eugenis, leonardchan
Reviewed By: leonardchan
Subscribers: hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D68832
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374481
91177308-0d34-0410-b5e6-
96231b3b80d8
Vitaly Buka [Thu, 10 Oct 2019 23:49:07 +0000 (23:49 +0000)]
[msan, NFC] Move option parsing into constructor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374480
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Liao [Thu, 10 Oct 2019 23:48:56 +0000 (23:48 +0000)]
Fix compilation warning due to typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374479
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Thu, 10 Oct 2019 23:37:51 +0000 (23:37 +0000)]
[JITLink] Add an initial implementation of JITLink for MachO/AArch64.
This implementation has support for all relocation types except TLV.
Compact unwind sections are not yet supported, so exceptions/unwinding will not
work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374476
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Thu, 10 Oct 2019 23:37:49 +0000 (23:37 +0000)]
[JITLink] Move MachO/x86 got test further down in the data section.
'named_data' should be the first symbol in the data section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374475
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Thu, 10 Oct 2019 23:36:06 +0000 (23:36 +0000)]
docs/DeveloperPolicy: Add instructions for requesting GitHub commit access
Subscribers: mehdi_amini, jtony, xbolva00, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66840
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374474
91177308-0d34-0410-b5e6-
96231b3b80d8
Alina Sbirlea [Thu, 10 Oct 2019 23:27:21 +0000 (23:27 +0000)]
[MemorySSA] Update Phi simplification.
When simplifying a Phi to the unique value found incoming, check that
there wasn't a Phi already created to break a cycle. If so, remove it.
Resolves PR43541.
Some additional nits included.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374471
91177308-0d34-0410-b5e6-
96231b3b80d8
Marcello Maggioni [Thu, 10 Oct 2019 21:51:30 +0000 (21:51 +0000)]
[GISel] Simplifying return from else in function. NFC
Forgot to integrate this little change in previous commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374463
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 10 Oct 2019 21:46:52 +0000 (21:46 +0000)]
[X86] Guard against leaving a dangling node in combineTruncateWithSat.
When handling the packus pattern for i32->i8 we do a two step
process using a packss to i16 followed by a packus to i8. If the
final i8 step is a type with less than 64-bits the packus step
will return SDValue(), but the i32->i16 step might have succeeded.
This leaves the nodes from the middle step dangling.
Guard against this by pre-checking that the number of elements is
at least 8 before doing the middle step.
With that check in place this should mean the only other
case the middle step itself can fail is when SSE2 is disabled. So
add an early SSE2 check then just assert that neither the middle
or final step ever fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374460
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 10 Oct 2019 21:46:44 +0000 (21:46 +0000)]
[X86] Add test cases for packus/ssat/usat 32i32->v32i8 test cases. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374459
91177308-0d34-0410-b5e6-
96231b3b80d8
Marcello Maggioni [Thu, 10 Oct 2019 21:46:26 +0000 (21:46 +0000)]
[GISel] Allow getConstantVRegVal() to return G_FCONSTANT values.
In GISel we have both G_CONSTANT and G_FCONSTANT, but because
in GISel we don't really have a concept of Float vs Int value
the only difference between the two is where the data originates
from.
What both G_CONSTANT and G_FCONSTANT return is just a bag of bits
with the constant representation in it.
By making getConstantVRegVal() return G_FCONSTANTs bit representation
as well we allow ConstantFold and other things to operate with
G_FCONSTANT.
Adding tests that show ConstantFolding to work on mixed G_CONSTANT
and G_FCONSTANT sources.
Differential Revision: https://reviews.llvm.org/D68739
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374458
91177308-0d34-0410-b5e6-
96231b3b80d8
Stanislav Mekhanoshin [Thu, 10 Oct 2019 21:32:41 +0000 (21:32 +0000)]
[AMDGPU] Handle undef old operand in DPP combine
It was missing an undef flag.
Differential Revision: https://reviews.llvm.org/D68813
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374455
91177308-0d34-0410-b5e6-
96231b3b80d8
Rong Xu [Thu, 10 Oct 2019 21:30:43 +0000 (21:30 +0000)]
[ValueTracking] Improve pointer offset computation for cases of same base
This patch improves the handling of pointer offset in GEP expressions where
one argument is the base pointer. isPointerOffset() is being used by memcpyopt
where current code synthesizes consecutive 32 bytes stores to one store and
two memset intrinsic calls. With this patch, we convert the stores to one
memset intrinsic.
Differential Revision: https://reviews.llvm.org/D67989
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374454
91177308-0d34-0410-b5e6-
96231b3b80d8
Evandro Menezes [Thu, 10 Oct 2019 21:29:10 +0000 (21:29 +0000)]
[InstCombine] Add test case for PR43617 (NFC)
Also, refactor check in `LibCallSimplifier::optimizeLog()`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374453
91177308-0d34-0410-b5e6-
96231b3b80d8
Julian Lettner [Thu, 10 Oct 2019 21:24:41 +0000 (21:24 +0000)]
[lit] Break main into smaller functions
This change is purely mechanical. I will do further cleanups of
parameter usages.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D68830
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374452
91177308-0d34-0410-b5e6-
96231b3b80d8
Alina Sbirlea [Thu, 10 Oct 2019 20:43:06 +0000 (20:43 +0000)]
[MemorySSA] Additional handling of unreachable blocks.
Summary:
Whenever we get the previous definition, the assumption is that the
recursion starts ina reachable block.
If the recursion starts in an unreachable block, we may recurse
indefinitely. Handle this case by returning LoE if the block is
unreachable.
Resolves PR43426.
Reviewers: george.burgess.iv
Subscribers: Prazek, sanjoy.google, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68809
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374447
91177308-0d34-0410-b5e6-
96231b3b80d8
David Greene [Thu, 10 Oct 2019 20:39:27 +0000 (20:39 +0000)]
[System Model] [TTI] Move default cache/prefetch implementations
Move the default implementations of cache and prefetch queries to
TargetTransformInfoImplBase and delete them from NoTIIImpl. This brings these
interfaces in line with how other TTI interfaces work.
Differential Revision: https://reviews.llvm.org/D68804
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374446
91177308-0d34-0410-b5e6-
96231b3b80d8
Greg Clayton [Thu, 10 Oct 2019 20:29:11 +0000 (20:29 +0000)]
Fix a documentation warning from GSYM commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374445
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 10 Oct 2019 20:25:51 +0000 (20:25 +0000)]
[PDB] Fix bug when using multiple PCH header objects with the same name.
A common pattern in Windows is to have all your precompiled headers
use an object named stdafx.obj. If you've got a project with many
different static libs, you might use a separate PCH for each one of
these.
During the final link step, a file from A might reference the PCH
object from A, but it will have the same name (stdafx.obj) as any
other PCH from another project. The only difference will be the
path. For example, A might be A/stdafx.obj while B is B/stdafx.obj.
The existing algorithm checks only the filename that was passed on
the command line (or stored in archive), but this is insufficient in
the case where relative paths are used, because depending on the
command line object file / library order, it might find the wrong
PCH object first resulting in a signature mismatch.
The fix here is to simply check whether the absolute path of the
PCH object (which is stored in the input obj file for the file that
references the PCH) *ends with* the full relative path of whatever
is specified on the command line (or is in the archive).
Differential Revision: https://reviews.llvm.org/D66431
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374442
91177308-0d34-0410-b5e6-
96231b3b80d8
Julian Lettner [Thu, 10 Oct 2019 20:23:28 +0000 (20:23 +0000)]
[lit] Add comment explaining the LIT_OPTS env var overrides command line options
Normally, command line options override environment variables. Add
comment to state that we are doing the reverse on purpose.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374441
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rose [Thu, 10 Oct 2019 20:22:53 +0000 (20:22 +0000)]
ADT: Save a word in every StringSet entry
Add a specialization to StringMap (actually StringMapEntry) for a
value type of NoneType (the type of llvm::None), and use it for
StringSet. This'll save us a word from every entry in a StringSet,
used for alignment with the size_t that stores the string length.
I could have gone all the way to some kind of empty base class
optimization, but that seemed like overkill. Someone can consider
adding that in the future, though.
https://reviews.llvm.org/D68586
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374440
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 10 Oct 2019 19:52:27 +0000 (19:52 +0000)]
[x86] reduce duplicate test assertions; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374436
91177308-0d34-0410-b5e6-
96231b3b80d8
Julian Lettner [Thu, 10 Oct 2019 19:43:57 +0000 (19:43 +0000)]
[lit] Bring back `--threads` option alias
Bring back `--threads` option which was lost in the move of the
command line argument parsing code to cl_arguments.py. Update docs
since `--workers` is preferred.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374432
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 10 Oct 2019 19:40:44 +0000 (19:40 +0000)]
[X86] Use packusdw+vpmovuswb to implement v16i32->V16i8 that clamps signed inputs to be between 0 and 255 when zmm registers are disabled on SKX.
If we've disable zmm registers, the v16i32 will need to be split. This split will propagate through min/max the truncate. This creates two sequences that need to be concatenated back to v16i8. We can instead use packusdw to do part of the clamping, truncating, and concatenating all at once. Then we can use a vpmovuswb to finish off the clamp.
Differential Revision: https://reviews.llvm.org/D68763
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374431
91177308-0d34-0410-b5e6-
96231b3b80d8
Joel E. Denny [Thu, 10 Oct 2019 19:25:39 +0000 (19:25 +0000)]
Revert r374388: "[lit] Make internal diff work in pipelines"
This breaks a Windows bot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374429
91177308-0d34-0410-b5e6-
96231b3b80d8
Jinsong Ji [Thu, 10 Oct 2019 19:25:30 +0000 (19:25 +0000)]
[PowerPC][docs] Update IBM official docs in Compiler Writers Info page
Summary:
Just realized that most of the links in this page are deprecated.
So update some important reference here:
* adding PowerISA 3.0B/2.7B
* adding P8/P9 User Manual
* ELFv2 ABI and errata
Move deprecated ones into "Other documents..".
Reviewers: #powerpc, hfinkel, nemanjai
Reviewed By: hfinkel
Subscribers: shchenz, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68817
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374428
91177308-0d34-0410-b5e6-
96231b3b80d8
Joel E. Denny [Thu, 10 Oct 2019 19:25:24 +0000 (19:25 +0000)]
Revert r374389: "[lit] Clean up internal diff's encoding handling"
This breaks a Windows bot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374427
91177308-0d34-0410-b5e6-
96231b3b80d8
Joel E. Denny [Thu, 10 Oct 2019 19:25:11 +0000 (19:25 +0000)]
Revert r374390: "[lit] Extend internal diff to support `-` argument"
This breaks a Windows bot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374426
91177308-0d34-0410-b5e6-
96231b3b80d8
Joel E. Denny [Thu, 10 Oct 2019 19:24:57 +0000 (19:24 +0000)]
Revert r374392: "[lit] Extend internal diff to support -U"
This breaks a Windows bot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374425
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Thu, 10 Oct 2019 18:57:23 +0000 (18:57 +0000)]
win: Move Parallel.h off concrt to cross-platform code
r179397 added Parallel.h and implemented it terms of concrt in 2013.
In 2015, a cross-platform implementation of the functions has appeared
and is in use everywhere but on Windows (r232419). r246219 hints that
<thread> had issues in MSVC2013, but r296906 suggests they've been fixed
now that we require 2015+.
So remove the concrt code. It's less code, and it sounds like concrt has
conceptual and performance issues, see PR41198.
I built blink_core.dll in a debug component build with full symbols and
in a release component build without any symbols. I couldn't measure a
performance difference for linking blink_core.dll before and after this
patch.
Differential Revision: https://reviews.llvm.org/D68820
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374421
91177308-0d34-0410-b5e6-
96231b3b80d8
Xiangling Liao [Thu, 10 Oct 2019 18:56:42 +0000 (18:56 +0000)]
[NFC][PowerPC]Clean up PPCAsmPrinter for TOC related pseudo opcode
Add a helper function getMCSymbolForTOCPseudoMO to clean up PPCAsmPrinter
a little bit.
Differential Revision: https://reviews.llvm.org/D68721
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374420
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 10 Oct 2019 18:31:57 +0000 (18:31 +0000)]
Print quoted backslashes in LLVM IR as \\ instead of \5C
This improves readability of Windows path string literals in LLVM IR.
The LLVM assembler has supported \\ in IR strings for a long time, but
the lexer doesn't tolerate escaped quotes, so they have to be printed as
\22 for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374415
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Thu, 10 Oct 2019 18:20:16 +0000 (18:20 +0000)]
Fix Windows build after r374381
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374413
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 10 Oct 2019 18:17:24 +0000 (18:17 +0000)]
Remove strings.h include to fix GSYM Windows build
Fifth time's the charm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374411
91177308-0d34-0410-b5e6-
96231b3b80d8
Greg Clayton [Thu, 10 Oct 2019 18:13:13 +0000 (18:13 +0000)]
Unbreak buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374410
91177308-0d34-0410-b5e6-
96231b3b80d8
Greg Clayton [Thu, 10 Oct 2019 18:11:49 +0000 (18:11 +0000)]
Fix buildbots by using memset instead of bzero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374409
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Liao [Thu, 10 Oct 2019 18:04:52 +0000 (18:04 +0000)]
Fix build by adding the missing dependency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374406
91177308-0d34-0410-b5e6-
96231b3b80d8
Julian Lettner [Thu, 10 Oct 2019 18:03:37 +0000 (18:03 +0000)]
[lit] Leverage argparse features to remove some code
Reviewed By: rnk, serge-sans-paille
Differential Revision: https://reviews.llvm.org/D68589
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374405
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 10 Oct 2019 18:01:27 +0000 (18:01 +0000)]
Fix test to avoid check-not matching the temp file absolute path
Fix for PR43636
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374404
91177308-0d34-0410-b5e6-
96231b3b80d8
Julian Lettner [Thu, 10 Oct 2019 17:58:38 +0000 (17:58 +0000)]
[lit] Move argument parsing/validation to separate file
Reviewed By: serge-sans-paille
Differential Revision: https://reviews.llvm.org/D68529
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374400
91177308-0d34-0410-b5e6-
96231b3b80d8
Greg Clayton [Thu, 10 Oct 2019 17:52:33 +0000 (17:52 +0000)]
Unbreak llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast buildbot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374398
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 10 Oct 2019 17:52:02 +0000 (17:52 +0000)]
[DAGCombiner] fold select-of-constants to shift
This reverses the scalar canonicalization proposed in D63382.
Pre: isPowerOf2(C1)
%r = select i1 %cond, i32 C1, i32 0
=>
%z = zext i1 %cond to i32
%r = shl i32 %z, log2(C1)
https://rise4fun.com/Alive/Z50
x86 already tries to fold this pattern, but it isn't done
uniformly, so we still see a diff. AArch64 probably should
enable the TLI hook to benefit too, but that's a follow-on.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374397
91177308-0d34-0410-b5e6-
96231b3b80d8
Greg Clayton [Thu, 10 Oct 2019 17:49:33 +0000 (17:49 +0000)]
Unbreak windows buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374396
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Thu, 10 Oct 2019 17:47:18 +0000 (17:47 +0000)]
gn build: restore tablegen restat optimization after r373664
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374395
91177308-0d34-0410-b5e6-
96231b3b80d8
Joel E. Denny [Thu, 10 Oct 2019 17:40:12 +0000 (17:40 +0000)]
[lit] Extend internal diff to support -U
When using lit's internal shell, RUN lines like the following
accidentally execute an external `diff` instead of lit's internal
`diff`:
```
# RUN: program | diff -U1 file -
```
Such cases exist now, in `clang/test/Analysis` for example. We are
preparing patches to ensure lit's internal `diff` is called in such
cases, which will then fail because lit's internal `diff` doesn't
recognize `-U` as a command-line option. This patch adds `-U`
support.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D68668
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374392
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Thu, 10 Oct 2019 17:40:00 +0000 (17:40 +0000)]
gn build: merge r374381 more (effectively a no-op)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374391
91177308-0d34-0410-b5e6-
96231b3b80d8
Joel E. Denny [Thu, 10 Oct 2019 17:39:57 +0000 (17:39 +0000)]
[lit] Extend internal diff to support `-` argument
When using lit's internal shell, RUN lines like the following
accidentally execute an external `diff` instead of lit's internal
`diff`:
```
# RUN: program | diff file -
```
Such cases exist now, in `clang/test/Analysis` for example. We are
preparing patches to ensure lit's internal `diff` is called in such
cases, which will then fail because lit's internal `diff` doesn't
recognize `-` as a command-line option. This patch adds support for
`-` to mean stdin.
Reviewed By: probinson, rnk
Differential Revision: https://reviews.llvm.org/D67643
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374390
91177308-0d34-0410-b5e6-
96231b3b80d8
Joel E. Denny [Thu, 10 Oct 2019 17:39:41 +0000 (17:39 +0000)]
[lit] Clean up internal diff's encoding handling
As suggested by rnk at D67643#
1673043, instead of reading files
multiple times until an appropriate encoding is found, read them once
as binary, and then try to decode what was read.
For python >= 3.5, don't fail when attempting to decode the
`diff_bytes` output in order to print it.
Finally, add some tests for encoding handling.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D68664
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374389
91177308-0d34-0410-b5e6-
96231b3b80d8
Joel E. Denny [Thu, 10 Oct 2019 17:39:24 +0000 (17:39 +0000)]
[lit] Make internal diff work in pipelines
When using lit's internal shell, RUN lines like the following
accidentally execute an external `diff` instead of lit's internal
`diff`:
```
# RUN: program | diff file -
# RUN: not diff file1 file2 | FileCheck %s
```
Such cases exist now, in `clang/test/Analysis` for example. We are
preparing patches to ensure lit's internal `diff` is called in such
cases, which will then fail because lit's internal `diff` cannot
currently be used in pipelines and doesn't recognize `-` as a
command-line option.
To enable pipelines, this patch moves lit's `diff` implementation into
an out-of-process script, similar to lit's `cat` implementation. A
follow-up patch will implement `-` to mean stdin.
Reviewed By: probinson, stella.stamenova
Differential Revision: https://reviews.llvm.org/D66574
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374388
91177308-0d34-0410-b5e6-
96231b3b80d8
GN Sync Bot [Thu, 10 Oct 2019 17:14:20 +0000 (17:14 +0000)]
gn build: Merge r374381
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374383
91177308-0d34-0410-b5e6-
96231b3b80d8
Greg Clayton [Thu, 10 Oct 2019 17:10:11 +0000 (17:10 +0000)]
Add GsymCreator and GsymReader.
This patch adds the ability to create GSYM files with GsymCreator, and read them with GsymReader. Full testing has been added for both new classes.
This patch differs from the original patch https://reviews.llvm.org/D53379 in that is uses a StringTableBuilder class from llvm instead of a custom version. Support for big and little endian files has been added. If the endianness matches the current host, we use efficient extraction for the header, address table and address info offset tables.
Differential Revision: https://reviews.llvm.org/D68744
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374381
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Devlieghere [Thu, 10 Oct 2019 16:37:38 +0000 (16:37 +0000)]
[dsymutil] Move CommonSymbols.clear() in resetParserState.
This seems like a more natural place to clear the vector, especially
since this method is clearing other data structures as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374378
91177308-0d34-0410-b5e6-
96231b3b80d8
David Green [Thu, 10 Oct 2019 16:34:30 +0000 (16:34 +0000)]
[ARM] VQSUB instruction
Same as VQADD, VQSUB can be selected from llvm.ssub.sat intrinsics.
Differential Revision: https://reviews.llvm.org/D68567
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374377
91177308-0d34-0410-b5e6-
96231b3b80d8
David Green [Thu, 10 Oct 2019 16:04:49 +0000 (16:04 +0000)]
[Codegen] Alter the default promotion for saturating adds and subs
The default promotion for the add_sat/sub_sat nodes currently does:
1. ANY_EXTEND iN to iM
2. SHL by M-N
3. [US][ADD|SUB]SAT
4. L/ASHR by M-N
If the promoted add_sat or sub_sat node is not legal, this can produce code
that effectively does a lot of shifting (and requiring large constants to be
materialised) just to use the overflow flag. It is simpler to just do the
saturation manually, using the higher bitwidth addition and a min/max against
the saturating bounds. That is what this patch attempts to do.
Differential Revision: https://reviews.llvm.org/D68643
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374373
91177308-0d34-0410-b5e6-
96231b3b80d8
Kadir Cetinkaya [Thu, 10 Oct 2019 16:04:45 +0000 (16:04 +0000)]
Fix assertions disabled builds after rL374367
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374372
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 10 Oct 2019 15:38:29 +0000 (15:38 +0000)]
[DAGCombiner] reduce code duplication; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374370
91177308-0d34-0410-b5e6-
96231b3b80d8
Guillaume Chatelet [Thu, 10 Oct 2019 15:38:22 +0000 (15:38 +0000)]
[Alignment][NFC] Use llv::Align in GISelKnownBits
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/D68786
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374369
91177308-0d34-0410-b5e6-
96231b3b80d8
Yonghong Song [Thu, 10 Oct 2019 15:33:09 +0000 (15:33 +0000)]
[BPF] Remove relocation for patchable externs
Previously, patchable extern relocations are introduced to patch
external variables used for multi versioning in
compile once, run everywhere use case. The load instruction
will be converted into a move with an patchable immediate
which can be changed by bpf loader on the host.
The kernel verifier has evolved and is able to load
and propagate constant values, so compiler relocation
becomes unnecessary. This patch removed codes related to this.
Differential Revision: https://reviews.llvm.org/D68760
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374367
91177308-0d34-0410-b5e6-
96231b3b80d8
Stanislav Mekhanoshin [Thu, 10 Oct 2019 15:28:52 +0000 (15:28 +0000)]
[AMDGPU] Fixed dpp_combine.mir with expensive checks. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374365
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 10 Oct 2019 15:25:16 +0000 (15:25 +0000)]
Fix Wdocumentation warnings. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374364
91177308-0d34-0410-b5e6-
96231b3b80d8
Roman Lebedev [Thu, 10 Oct 2019 14:46:21 +0000 (14:46 +0000)]
[MCA] Show aggregate over Average Wait times for the whole snippet (PR43219)
Summary:
As disscused in https://bugs.llvm.org/show_bug.cgi?id=43219,
i believe it may be somewhat useful to show //some// aggregates
over all the sea of statistics provided.
Example:
```
Average Wait times (based on the timeline view):
[0]: Executions
[1]: Average time spent waiting in a scheduler's queue
[2]: Average time spent waiting in a scheduler's queue while ready
[3]: Average time elapsed from WB until retire stage
[0] [1] [2] [3]
0. 3 1.0 1.0 4.7 vmulps %xmm0, %xmm1, %xmm2
1. 3 2.7 0.0 2.3 vhaddps %xmm2, %xmm2, %xmm3
2. 3 6.0 0.0 0.0 vhaddps %xmm3, %xmm3, %xmm4
3 3.2 0.3 2.3 <total>
```
I.e. we average the averages.
Reviewers: andreadb, mattd, RKSimon
Reviewed By: andreadb
Subscribers: gbedwell, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68714
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374361
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Thu, 10 Oct 2019 14:27:14 +0000 (14:27 +0000)]
Revert "[FileCheck] Implement --ignore-case option."
This reverts commit r374339. It broke tests:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/19066
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374359
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Thu, 10 Oct 2019 14:26:54 +0000 (14:26 +0000)]
Revert "[Tests] Output of od can be lower or upper case (llvm-objcopy/yaml2obj)."
This reverts commit r374343. It broke tests:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/19066
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374358
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Thu, 10 Oct 2019 14:16:58 +0000 (14:16 +0000)]
Revert "Fix OCaml/core.ml fneg check"
This reverts commit r374346. It attempted to fix OCaml tests, but is
does not actually fix them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374357
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 10 Oct 2019 14:14:12 +0000 (14:14 +0000)]
[X86] combineFMA - Convert to use isNegatibleForFree/GetNegatedExpression.
Split off from D67557.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374356
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 10 Oct 2019 14:13:55 +0000 (14:13 +0000)]
Fix OCaml/core.ml fneg check (try 2)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374355
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Thu, 10 Oct 2019 14:13:54 +0000 (14:13 +0000)]
Revert "[IRBuilder] Update IRBuilder::CreateFNeg(...) to return a UnaryOperator"
This reverts commit r374240. It broke OCaml tests:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/19014
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374354
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 10 Oct 2019 13:46:44 +0000 (13:46 +0000)]
[X86] combineFMADDSUB - Convert to use isNegatibleForFree/GetNegatedExpression.
Split off from D67557, fixes the compile time regression mentioned in rL372756
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374351
91177308-0d34-0410-b5e6-
96231b3b80d8
Thomas Preud'homme [Thu, 10 Oct 2019 13:39:12 +0000 (13:39 +0000)]
Revert "[test] Use system locale for mri-utf8.test"
This reverts commit r374318 /
b6f1d1fa0e3ee0e25f22414bf97c05276b934507.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374349
91177308-0d34-0410-b5e6-
96231b3b80d8
Jay Foad [Thu, 10 Oct 2019 13:34:31 +0000 (13:34 +0000)]
Revert "[AMDGPU] Run `unreachable-mbb-elimination` after isel to clean up PHIs."
Summary:
This has been superseded by "[AMDGPU]: PHI Elimination hooks added for custom COPY insertion."
This reverts the code changes from commit
53f967f2bdb6aa7b08596880c3689d1ecad6f0ff
but keeps the test case.
Reviewers: hliao, arsenm, tpr, dstuttard
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68769
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374347
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 10 Oct 2019 13:29:47 +0000 (13:29 +0000)]
Fix OCaml/core.ml fneg check
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374346
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 10 Oct 2019 13:29:35 +0000 (13:29 +0000)]
[DAG][X86] Add isNegatibleForFree/GetNegatedExpression override placeholders. NFCI.
Continuing to undo the rL372756 reversion.
Differential Revision: https://reviews.llvm.org/D67557
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374345
91177308-0d34-0410-b5e6-
96231b3b80d8
George Rimar [Thu, 10 Oct 2019 13:26:26 +0000 (13:26 +0000)]
[llvm-readelf] - Do not enter an infinite loop when printing histogram.
This is similar to D68086.
We are entering an infinite loop when dumping a histogram for a specially crafted
.hash section with a loop in a chain.
Differential revision: https://reviews.llvm.org/D68771
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374344
91177308-0d34-0410-b5e6-
96231b3b80d8
Kai Nacke [Thu, 10 Oct 2019 13:24:00 +0000 (13:24 +0000)]
[Tests] Output of od can be lower or upper case (llvm-objcopy/yaml2obj).
The command `od -t x` is used to dump data in hex format.
The LIT tests assumes that the hex characters are in lowercase.
However, there are also platforms which use uppercase letter.
To solve this issue the tests are updated to use the new
`--ignore-case` option of FileCheck.
Reviewers: Bigcheese, jakehehrlich, rupprecht, espindola, alexshap, jhenderson
Differential Revision: https://reviews.llvm.org/D68693
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374343
91177308-0d34-0410-b5e6-
96231b3b80d8
Amaury Sechet [Thu, 10 Oct 2019 13:20:10 +0000 (13:20 +0000)]
[DAGCombine] Match more patterns for half word bswap
Summary: It ensures that the bswap is generated even when a part of the subtree already matches a bswap transform.
Reviewers: craig.topper, efriedma, RKSimon, lebedev.ri
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68250
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374340
91177308-0d34-0410-b5e6-
96231b3b80d8
Kai Nacke [Thu, 10 Oct 2019 13:15:41 +0000 (13:15 +0000)]
[FileCheck] Implement --ignore-case option.
The FileCheck utility is enhanced to support a `--ignore-case`
option. This is useful in cases where the output of Unix tools
differs in case (e.g. case not specified by Posix).
Reviewers: Bigcheese, jakehehrlich, rupprecht, espindola, alexshap, jhenderson, MaskRay
Differential Revision: https://reviews.llvm.org/D68146
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374339
91177308-0d34-0410-b5e6-
96231b3b80d8
Florian Hahn [Thu, 10 Oct 2019 13:07:01 +0000 (13:07 +0000)]
[LV][NFC] Factor out calculation of "best" estimated trip count.
This is just small refactoring to minimize changes in upcoming patch.
In the next path I'm going to introduce changes into heuristic for vectorization of "tiny trip count" loops.
Patch by Evgeniy Brevnov <evgueni.brevnov@gmail.com>
Reviewers: hsaito, Ayal, fhahn, reames
Reviewed By: hsaito
Differential Revision: https://reviews.llvm.org/D67690
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374338
91177308-0d34-0410-b5e6-
96231b3b80d8
Pavel Labath [Thu, 10 Oct 2019 13:05:46 +0000 (13:05 +0000)]
MinidumpYAML: Add support for the memory info list stream
Summary:
The implementation is fairly straight-forward and uses the same patterns
as the existing streams. The yaml form does not attempt to preserve the
data in the "gaps" that can be created by setting a larger-than-required
header or entry size in the stream header, because the existing consumer
(lldb) does not make use of the information in the gap in any way, and
attempting to preserve that would make the implementation more
complicated.
Reviewers: amccarth, jhenderson, clayborg
Subscribers: llvm-commits, lldb-commits, markmentovai, zturner, JosephTremoulet
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68645
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374337
91177308-0d34-0410-b5e6-
96231b3b80d8
David Green [Thu, 10 Oct 2019 13:05:04 +0000 (13:05 +0000)]
[ARM] VQADD instructions
This selects MVE VQADD from the vector llvm.sadd.sat or llvm.uadd.sat
intrinsics.
Differential Revision: https://reviews.llvm.org/D68566
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374336
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 10 Oct 2019 12:53:24 +0000 (12:53 +0000)]
[AArch64][x86] add tests for (v)select bit magic; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374334
91177308-0d34-0410-b5e6-
96231b3b80d8
Guillaume Chatelet [Thu, 10 Oct 2019 12:35:04 +0000 (12:35 +0000)]
[Alignment][NFC] Make VectorUtils uas llvm::Align
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, rogfer01, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68784
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374330
91177308-0d34-0410-b5e6-
96231b3b80d8
Roman Lebedev [Thu, 10 Oct 2019 12:22:33 +0000 (12:22 +0000)]
[ADR] ArrayRefTest: disable SizeTSizedOperations test - it's UB.
This test is not defined.
FAIL: LLVM-Unit :: ADT/./ADTTests/ArrayRefTest.SizeTSizedOperations (178 of 33926)
******************** TEST 'LLVM-Unit :: ADT/./ADTTests/ArrayRefTest.SizeTSizedOperations' FAILED ********************
Note: Google Test filter = ArrayRefTest.SizeTSizedOperations
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from ArrayRefTest
[ RUN ] ArrayRefTest.SizeTSizedOperations
/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:180:32: runtime error: applying non-zero offset
9223372036854775806 to null pointer
#0 0x5ae8dc in llvm::ArrayRef<char>::slice(unsigned long, unsigned long) const /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:180:32
#1 0x5ae44c in (anonymous namespace)::ArrayRefTest_SizeTSizedOperations_Test::TestBody() /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/unittests/ADT/ArrayRefTest.cpp:85:3
#2 0x928a96 in testing::Test::Run() /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/googletest/src/gtest.cc:2474:5
#3 0x929793 in testing::TestInfo::Run() /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/googletest/src/gtest.cc:2656:11
#4 0x92a152 in testing::TestCase::Run() /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/googletest/src/gtest.cc:2774:28
#5 0x9319d2 in testing::internal::UnitTestImpl::RunAllTests() /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/googletest/src/gtest.cc:4649:43
#6 0x931416 in testing::UnitTest::Run() /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/googletest/src/gtest.cc:4257:10
#7 0x920ac3 in RUN_ALL_TESTS /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/googletest/include/gtest/gtest.h:2233:46
#8 0x920ac3 in main /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/UnitTestMain/TestMain.cpp:50:10
#9 0x7f66135b72e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
#10 0x472c19 in _start (/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/unittests/ADT/ADTTests+0x472c19)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:180:32 in
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374327
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 10 Oct 2019 12:21:52 +0000 (12:21 +0000)]
Fix -Wparentheses warning. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374326
91177308-0d34-0410-b5e6-
96231b3b80d8
Mirko Brkusanin [Thu, 10 Oct 2019 12:02:14 +0000 (12:02 +0000)]
[Mips] Fix 374055
EXPENSIVE_CHECKS build was failing on new test.
This is fixed by marking $ra register as undef.
Test now has -verify-machineinstrs to check for operand flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374320
91177308-0d34-0410-b5e6-
96231b3b80d8
Thomas Preud'homme [Thu, 10 Oct 2019 11:48:30 +0000 (11:48 +0000)]
[test] Use system locale for mri-utf8.test
Summary:
llvm-ar's mri-utf8.test test relies on the en_US.UTF-8 locale to be
installed for its last RUN line to work. If not installed, the unicode
string gets encoded (interpreted) as ascii which fails since the most
significant byte is non zero. This commit changes the test to only rely
on the system being able to encode the pound sign in its default
encoding (e.g. UTF-16 for Microsoft Windows) by always opening the file
via input/output redirection. This avoids forcing a given locale to be
present and supported. A Byte Order Mark is also added to help
recognizing the encoding of the file and its endianness.
Reviewers: gbreynoo, MaskRay, rupprecht, JamesNagurne, jfb
Subscribers: dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68472
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374318
91177308-0d34-0410-b5e6-
96231b3b80d8
Oliver Stannard [Thu, 10 Oct 2019 09:58:28 +0000 (09:58 +0000)]
[IfCvt][ARM] Optimise diamond if-conversion for code size
Currently, the heuristics the if-conversion pass uses for diamond if-conversion
are based on execution time, with no consideration for code size. This adds a
new set of heuristics to be used when optimising for code size.
This is mostly target-independent, because the if-conversion pass can
see the code size of the instructions which it is removing. For thumb,
there are a few passes (insertion of IT instructions, selection of
narrow branches, and selection of CBZ instructions) which are run after
if conversion and affect these heuristics, so I've added target hooks to
better predict the code-size effect of a proposed if-conversion.
Differential revision: https://reviews.llvm.org/D67350
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374301
91177308-0d34-0410-b5e6-
96231b3b80d8
Roman Lebedev [Thu, 10 Oct 2019 09:25:02 +0000 (09:25 +0000)]
[UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour
Summary:
Quote from http://eel.is/c++draft/expr.add#4:
```
4 When an expression J that has integral type is added to or subtracted
from an expression P of pointer type, the result has the type of P.
(4.1) If P evaluates to a null pointer value and J evaluates to 0,
the result is a null pointer value.
(4.2) Otherwise, if P points to an array element i of an array object x with n
elements ([dcl.array]), the expressions P + J and J + P
(where J has the value j) point to the (possibly-hypothetical) array
element i+j of x if 0≤i+j≤n and the expression P - J points to the
(possibly-hypothetical) array element i−j of x if 0≤i−j≤n.
(4.3) Otherwise, the behavior is undefined.
```
Therefore, as per the standard, applying non-zero offset to `nullptr`
(or making non-`nullptr` a `nullptr`, by subtracting pointer's integral value
from the pointer itself) is undefined behavior. (*if* `nullptr` is not defined,
i.e. e.g. `-fno-delete-null-pointer-checks` was *not* specified.)
To make things more fun, in C (6.5.6p8), applying *any* offset to null pointer
is undefined, although Clang front-end pessimizes the code by not lowering
that info, so this UB is "harmless".
Since rL369789 (D66608 `[InstCombine] icmp eq/ne (gep inbounds P, Idx..), null -> icmp eq/ne P, null`)
LLVM middle-end uses those guarantees for transformations.
If the source contains such UB's, said code may now be miscompiled.
Such miscompilations were already observed:
* https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-
20190826/687838.html
* https://github.com/google/filament/pull/1566
Surprisingly, UBSan does not catch those issues
... until now. This diff teaches UBSan about these UB's.
`getelementpointer inbounds` is a pretty frequent instruction,
so this does have a measurable impact on performance;
I've addressed most of the obvious missing folds (and thus decreased the performance impact by ~5%),
and then re-performed some performance measurements using my [[ https://github.com/darktable-org/rawspeed | RawSpeed ]] benchmark:
(all measurements done with LLVM ToT, the sanitizer never fired.)
* no sanitization vs. existing check: average `+21.62%` slowdown
* existing check vs. check after this patch: average `22.04%` slowdown
* no sanitization vs. this patch: average `48.42%` slowdown
Reviewers: vsk, filcab, rsmith, aaron.ballman, vitalybuka, rjmccall, #sanitizers
Reviewed By: rsmith
Subscribers: kristof.beyls, nickdesaulniers, nikic, ychen, dtzWill, xbolva00, dberris, arphaman, rupprecht, reames, regehr, llvm-commits, cfe-commits
Tags: #clang, #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D67122
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374293
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Tatham [Thu, 10 Oct 2019 08:25:34 +0000 (08:25 +0000)]
[update_cc_test_checks] Support 'clang | opt | FileCheck'
Some clang lit tests use a pipeline of the form
// RUN: %clang [args] -O0 %s | opt [specific optimizations] | FileCheck %s
to make the expected test output depend on as few optimization phases
as possible, for stability. But when you write a RUN line of this
form, you lose the ability to use update_cc_test_checks.py to
automatically generate the expected output, because it only supports
two-stage pipelines consisting of '%clang | FileCheck' (or %clang_cc1).
This change extends the set of supported RUN lines so that pipelines
with an invocation of `opt` in the middle can still be automatically
handled.
To implement it, I've adjusted `get_function_body()` so that it can
cope with an arbitrary sequence of intermediate pipeline commands. But
the code that decides which RUN lines to consider is more
conservative: it only adds clang | opt | FileCheck to the set of
supported lines, because I didn't want to accidentally include some
other kind of line that doesn't output IR at all.
(Also in this commit is the minimal change to make this script work at
all, after r373912 added an extra parameter to `add_ir_checks`.)
Reviewers: MaskRay, xbolva00
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68406
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374287
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 10 Oct 2019 07:11:33 +0000 (07:11 +0000)]
AMDGPU: Use SGPR_128 instead of SReg_128 for vregs
SGPR_128 only includes the real allocatable SGPRs, and SReg_128 adds
the additional non-allocatable TTMP registers. There's no point in
allocating SReg_128 vregs. This shrinks the size of the classes
regalloc needs to consider, which is usually good.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374284
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 10 Oct 2019 06:25:00 +0000 (06:25 +0000)]
[X86] Add test case for trunc_packus_v16i32_v16i8 with avx512vl+avx512bw and prefer-vector-width=256 and min-legal-vector-width=256. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374283
91177308-0d34-0410-b5e6-
96231b3b80d8
Johannes Doerfert [Thu, 10 Oct 2019 05:34:21 +0000 (05:34 +0000)]
[Attributor][NFC] clang format
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374281
91177308-0d34-0410-b5e6-
96231b3b80d8
Johannes Doerfert [Thu, 10 Oct 2019 05:33:21 +0000 (05:33 +0000)]
[Attributor] Handle `null` differently in capture and alias logic
Summary:
`null` in the default address space (=AS 0) cannot be captured nor can
it alias anything. We make this clear now as it can be important for
callbacks and other cases later on. In addition, this patch improves the
debug output for noalias deduction.
Reviewers: sstefan1, uenoku
Subscribers: hiraditya, bollu, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68624
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374280
91177308-0d34-0410-b5e6-
96231b3b80d8
GN Sync Bot [Thu, 10 Oct 2019 04:29:49 +0000 (04:29 +0000)]
gn build: Merge r374277
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374278
91177308-0d34-0410-b5e6-
96231b3b80d8
Cyndy Ishida [Thu, 10 Oct 2019 04:24:44 +0000 (04:24 +0000)]
Reland "[TextAPI] Introduce TBDv4"
Original Patch broke for compilations w/ gcc and exposed asan fail.
This reland repairs those bugs.
Differential Revision: https://reviews.llvm.org/D67529
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374277
91177308-0d34-0410-b5e6-
96231b3b80d8