River Riddle [Sun, 5 Apr 2020 23:21:07 +0000 (16:21 -0700)]
[mlir] Refactor and cleanup the translation facilities.
Summary:
This revision performs several cleanups on the translation infra:
* Removes the TranslateCLParser library and consolidates into Translation
- This was a weird library that existed in Support, and didn't really justify being a standalone library.
* Cleans up the internal registration and consolidates all of the translation functions within one registry.
Differential Revision: https://reviews.llvm.org/D77514
River Riddle [Sun, 5 Apr 2020 23:16:54 +0000 (16:16 -0700)]
[mlir] Only number the parent operation in Block::printAsOperand
Summary: Blocks are numbered locally within a region, so numbering above the parent region is unnecessary.
Differential Revision: https://reviews.llvm.org/D77510
Richard Smith [Sun, 5 Apr 2020 22:35:32 +0000 (15:35 -0700)]
Permit constant evaluation of mixed __builtin_memcmp between char and
char8_t.
Richard Smith [Sun, 5 Apr 2020 22:23:53 +0000 (15:23 -0700)]
Add documentation and testing for
2c88a485c71155c19e512f22c54e63ee337282a3.
Also extend it to cover memchr for consistency.
Simon Pilgrim [Sun, 5 Apr 2020 22:11:24 +0000 (23:11 +0100)]
Remove unused function 'isInRange'. NFCI.
Simon Pilgrim [Sun, 5 Apr 2020 21:13:53 +0000 (22:13 +0100)]
[X86][SSE] Combine unary shuffle(HORIZOP,HORIZOP) -> HORIZOP
We had previously limited the shuffle(HORIZOP,HORIZOP) combine to binary shuffles, but we can often merge unary shuffles just as well, folding in UNDEF/ZERO values into the 64-bit half lanes.
For the (P)HADD/HSUB cases this is limited to fast-horizontal cases but PACKSS/PACKUS combines under all cases.
Uday Bondhugula [Sun, 5 Apr 2020 19:13:07 +0000 (00:43 +0530)]
[MLIR][NFC] Make AsmPrinter messages on null structures consistent
Make AsmPrinter messages on null structures consistent: use <<NULL ...>>.
Differential Revision: https://reviews.llvm.org/D77509
River Riddle [Sun, 5 Apr 2020 19:11:51 +0000 (12:11 -0700)]
[mlir] Update the documentation on Canonicalization
Summary: This updates the canonicalization documentation, and properly documents the different ways of canonicalizing operations.
Differential Revision: https://reviews.llvm.org/D77490
River Riddle [Sun, 5 Apr 2020 18:50:05 +0000 (11:50 -0700)]
[mlir][Pass] Add documentation for the declarative pass specification
Summary:
This revision adds a section to WritingAPass to document the declarative specification, and how to use it.
Differential Revision: https://reviews.llvm.org/D77102
Anna Thomas [Thu, 2 Apr 2020 21:05:35 +0000 (17:05 -0400)]
[InlineFunction] Update metadata on loads that are return values
This patch builds upon D76140 by updating metadata on pointer typed
loads in inlined functions, when the load is the return value, and the
callsite contains return attributes which can be updated as metadata on
the load.
Added test cases show this for nonnull, dereferenceable,
dereferenceable_or_null
Reviewed-By: jdoerfert
Differential Revision: https://reviews.llvm.org/D76792
Sourabh Singh Tomar [Sat, 4 Apr 2020 19:29:11 +0000 (00:59 +0530)]
[DebugInfo]: Allow DwarfCompileUnit to have line table symbol
Previously line table symbol was represented as `DIE::value_iterator`
inside `DwarfCompileUnit` and subsequent function `intStmtList`
was used to create a local `MCSymbol` to initialize it.
This patch removes `DIE::value_iterator` from `DwarfCompileUnit`
and intoduce `MCSymbol` for representing this units symbol for
`debug_line` section. As a result `applyStmtList` is also modified
to utilize this. Further more a helper function `getLineTableStartSym`
is also introduced to get this symbol, this would be used by clients
which need to access this line table, i.e `debug_macro`.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D77489
Mehdi Amini [Sun, 5 Apr 2020 03:01:21 +0000 (03:01 +0000)]
Make the AsmPrinter print "<<NULL TYPE>>" instead of crashing on null types
Even if this indicates in general a problem at call sites, the printer
is used for debugging and avoiding crashing is friendlier for example
when used in diagnostics or other printer.
Differential Revision: https://reviews.llvm.org/D77481
Fangrui Song [Sun, 5 Apr 2020 16:25:00 +0000 (09:25 -0700)]
[ELF][test] Reorganize warn-backrefs.s
Nico Weber [Sun, 5 Apr 2020 17:07:50 +0000 (13:07 -0400)]
make
ccabe93298 more robust
Nico Weber [Sun, 5 Apr 2020 16:54:27 +0000 (12:54 -0400)]
clang: Make tests using symlinks more consistent.
Instead of checking if each symlink exists before removing it,
remove the whole temp dir housing the symlinks before recreating it.
This is a bit shorter, conceptually simpler (in that the first
and consecutive test runs have more similar behavior), it's what we're
already doing in almost all places where we do it, and it works if the
symlink exists but is a dead link (e.g. when it points into the build
dir but the build dir is renamed).
No intended behavior change.
Zuojian Lin [Sun, 5 Apr 2020 15:21:37 +0000 (11:21 -0400)]
Remove the additional constant which requires an extra register for statepoint lowering.
The newly-created constant zero will need an extra register to hold it
in the current statepoint lowering implementation. Remove it if there
exists one.
Apelete Seketeli [Sun, 5 Apr 2020 15:09:19 +0000 (11:09 -0400)]
[scan-build] fix dead store warnings emitted on LLVM AMDGPU code base
This fixes dead store warnings of the type "dead assignment" reported
by Clang Static Analyzer.
Muhammad Omair Javaid [Sun, 5 Apr 2020 15:16:43 +0000 (20:16 +0500)]
Fix typo in xfail decorator for lldb thread plan list tests
Matt Arsenault [Sun, 5 Apr 2020 14:53:47 +0000 (10:53 -0400)]
AMDGPU/GlobalISel: Add some G_INSERT/G_EXTRACT select tests
Oliver Stannard [Sun, 5 Apr 2020 14:21:00 +0000 (15:21 +0100)]
[ARM] Add data gathering hint instruction
Summary:
This patch upstreams support the optional ARMv8.0 Data Gathering Hint (DGH)
extension, which adds the Data Gathering Hint instruction to the hint
space.
See ARMv8.0-DGH in the Arm Architecture Reference Manual Armv8 for more
information.
Reviewers: t.p.northover, rengolin, SjoerdMeijer, ab, danielkiss, samparker
Reviewed By: SjoerdMeijer
Subscribers: LukeGeeson, ostannard, kristof.beyls, hiraditya, danielkiss, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77097
Oliver Stannard [Sun, 5 Apr 2020 13:49:49 +0000 (14:49 +0100)]
[ARM] Add enhanced counter virtualization system registers
Summary:
This patch upstreams support for the ARMv8.6A Enhanced Counter Virtualization
(ECV) extension, which adds 6 new system registers.
See ARMv8.6-ECV in the Arm Architecture Reference Manual Armv8 for more
information.
Reviewers: t.p.northover, rengolin, SjoerdMeijer, pcc, ab, chill
Reviewed By: SjoerdMeijer
Subscribers: LukeGeeson, ostannard, kristof.beyls, hiraditya, danielkiss, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77094
Uday Bondhugula [Mon, 30 Mar 2020 19:45:40 +0000 (01:15 +0530)]
[MLIR] Add pattern rewriter util to erase block; remove dead else
Add a pattern rewriter utility to erase blocks (while notifying the
pattern rewriting driver of the erased ops). Use this to remove trivial
else blocks in affine.if ops.
Differential Revision: https://reviews.llvm.org/D77083
Sanjay Patel [Sun, 5 Apr 2020 13:46:22 +0000 (09:46 -0400)]
[InstCombine] convert bitcast-shuffle to vector trunc
As discussed in D76983, that patch can turn a chain of insert/extract
with scalar trunc ops into bitcast+extract and existing instcombine
vector transforms end up creating a shuffle out of that (see the
PhaseOrdering test for an example). Currently, that process requires
at least this sequence: -instcombine -early-cse -instcombine.
Before D76983, the sequence of insert/extract would reach the SLP
vectorizer and become a vector trunc there.
Based on a small sampling of public targets/types, converting the
shuffle to a trunc is better for codegen in most cases (and a
regression of that form is the reason this was noticed). The trunc is
clearly better for IR-level analysis as well.
This means that we can induce "spontaneous vectorization" without
invoking any explicit vectorizer passes (at least a vector cast op
may be created out of scalar casts), but that seems to be the right
choice given that we started with a chain of insert/extract, and the
backend would expand back to that chain if a target does not support
the op.
Differential Revision: https://reviews.llvm.org/D77299
Uday Bondhugula [Sun, 5 Apr 2020 05:07:08 +0000 (10:37 +0530)]
[MLIR][NFC] fix name operand -> userOp
The wrong name was confusing to read. value.getUsers() yields
Operation *s.
Differential Revision: https://reviews.llvm.org/D77486
Uday Bondhugula [Sun, 5 Apr 2020 02:59:52 +0000 (08:29 +0530)]
[MLIR] fix greedy pattern rewrite driver iteration on change
Removing dead ops should make the outer loop of the pattern rewriting
driver run again. Although its operands are added to the worklist, if no
changes happenned to them or remaining ops in the worklist, the driver
wouldn't run once again - but it should be.
Differential Revision: https://reviews.llvm.org/D77483
Oliver Stannard [Sun, 5 Apr 2020 12:58:00 +0000 (13:58 +0100)]
[ARM] Add ARMv8.6 Fine Grain Traps system registers
Summary:
This patch upstreams support for the ARMv8.6A Fine Grain Traps (FGT)
extension, which adds 5 new system registers.
See ARMv8.6-FGT in the Arm Architecture Reference Manual Armv8 for more
information.
Reviewers: t.p.northover, rengolin, SjoerdMeijer, ab, momchil.velikov
Reviewed By: SjoerdMeijer
Subscribers: LukeGeeson, ostannard, kristof.beyls, hiraditya, danielkiss, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76991
Sanjay Patel [Sun, 5 Apr 2020 13:16:19 +0000 (09:16 -0400)]
[InstCombine] enhance freelyNegateValue() by handling 'not'
This patch extends D77230. If we have a 'not' instruction inside a
negated expression, we can ignore extra uses of that op because the
negation has a one-to-one replacement: negate becomes increment.
Alive2 examples of the test cases:
http://volta.cs.utah.edu:8080/z/T5-u9P
http://volta.cs.utah.edu:8080/z/eT89L6
Differential Revision: https://reviews.llvm.org/D77459
Sanjay Patel [Sun, 5 Apr 2020 12:51:29 +0000 (08:51 -0400)]
[ValueTracking] enhance matching of smin/smax with 'not' operands
The cmyk tests are based on the known regression that resulted from:
rGf2fbdf76d8d0
So this improvement in analysis might be enough to restore that commit.
Diogo Sampaio [Sun, 5 Apr 2020 11:39:59 +0000 (12:39 +0100)]
[ARM] add ARMv8.6-A Activity monitors virtualization extension
Summary:
This patch upstreams v8.6A activity monitors virtualization
assembler support, which consists of 32 new system
registers (two groups, each with 16 numbered registers).
See ARMv8.6-AMU in the Arm Architecture Reference Manual Armv8 for more
information.
Reviewers: t.p.northover, rengolin, SjoerdMeijer, ab, john.brawn, ostannard
Reviewed By: ostannard
Subscribers: LukeGeeson, dnsampaio, ostannard, kristof.beyls, hiraditya, danielkiss, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76998
Benjamin Kramer [Sun, 5 Apr 2020 11:59:33 +0000 (13:59 +0200)]
[X86] Roll some loops. NFCI.
Florian Hahn [Sun, 5 Apr 2020 11:12:33 +0000 (12:12 +0100)]
[ValueTracking] Use Inst::comesBefore in isValidAssumeForCtx (NFC).
D51664 added Instruction::comesBefore which should provide better
performance than the manual check.
Reviewers: rnk, nikic, spatel
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D76228
David Zarzycki [Sun, 5 Apr 2020 10:58:29 +0000 (06:58 -0400)]
Revert "[libc++] Enable the new libc++ testing format by default"
This reverts commit
1580c76c4a08e24adc34ae0a4ff4f97969188268.
This causes libcxx/selftest/newformat/sh.cpp/substitutions.sh.cpp to
fail with a linker error on Fedora 31 (x86-64) release (no assert)
builds.
David Zarzycki [Sun, 5 Apr 2020 10:15:18 +0000 (06:15 -0400)]
[clang] Make libcxx test suite pass again after memcmp changes
David Zarzycki [Sat, 4 Apr 2020 12:13:54 +0000 (08:13 -0400)]
Revert "Test had incorrect check for nonzero count"
This reverts commit
210f40fe9a30212396311d265904b2d73859c53d.
Simon Pilgrim [Sun, 5 Apr 2020 11:09:19 +0000 (12:09 +0100)]
[X86][SSE] Generalize shuffle(HORIZOP,HORIZOP) -> HORIZOP combine
Our existing combine allows to merge the shuffle of 2 similar 64-bit wide 'horizontal ops' (HADD/PACK/etc.) if the shuffle was a UNPCK/MOVSD.
This patch generalizes this to decode any target shuffle mask that can be widened to a 128-bit repeating v2*64 mask, which helps us catch PBLENDW/PBLENDD cases.
Simon Pilgrim [Sun, 5 Apr 2020 10:47:15 +0000 (11:47 +0100)]
[X86][SSE] truncateVectorWithPACK - upper undef for 128->64 packing
If we're packing from 128-bits to 64-bits then we don't need the RHS argument. This helps with register allocation, especially as we avoid repeating a use of the input value.
Alexander Belyaev [Fri, 3 Apr 2020 15:57:41 +0000 (17:57 +0200)]
[MLIR] Don't insert YieldOp for non-void loop.for by default.
The ForOp::build ensures that there is a block terminator which is great for
the default use case when there are no iter_args and loop.for returns no
results. In non-zero results case we always need to call replaceOpWithNewOp
which is not the nicest thing in the world. We can stop inserting YieldOp when
iter_args is non-empty. IfOp::build already behaves similarly.
River Riddle [Sun, 5 Apr 2020 08:03:24 +0000 (01:03 -0700)]
[mlir][ODS] Add support for variadic regions.
Summary: This revision adds support for marking the last region as variadic in the ODS region list with the VariadicRegion directive.
Differential Revision: https://reviews.llvm.org/D77455
Kazuaki Ishizaki [Sun, 5 Apr 2020 06:28:11 +0000 (15:28 +0900)]
[clang-tools-extra] NFC: Fix trivial typo in documents and comments
Differential Revision: https://reviews.llvm.org/D77458
vgxbj [Sun, 5 Apr 2020 04:31:22 +0000 (12:31 +0800)]
[llvm-objdump] Simplify conditional statements (isa<...>(Obj) => Obj->isSomeFile())
Summary: Simplify some conditional statements.
Reviewers: jhenderson, MaskRay, rupprecht
Reviewed By: MaskRay, rupprecht
Subscribers: rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75899
vgxbj [Sun, 5 Apr 2020 04:15:06 +0000 (12:15 +0800)]
[llvm-nm] Add test for `--debug-syms --dynamic`
Summary: This test ensures that `llvm-nm` will omit NULL symbol.
Reviewers: jhenderson, MaskRay, grimar
Reviewed By: jhenderson, grimar
Subscribers: rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76213
vgxbj [Sun, 5 Apr 2020 03:47:27 +0000 (11:47 +0800)]
[llvm-objdump][test] Recommit unimplemented-features.test
Recommit test case that removed by rG685bf42e9e0cc79cff6d26cf44749db98f148270
vgxbj [Sun, 5 Apr 2020 03:03:34 +0000 (11:03 +0800)]
[llvm-objdump][test] Remove unimplemented-features.test
Seems that this test breaks build bots.
http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/41418
Commit it later.
vgxbj [Sun, 5 Apr 2020 01:58:53 +0000 (09:58 +0800)]
[llvm-objdump] Teach `llvm-objdump` dump dynamic symbols.
Summary:
This patch is to teach `llvm-objdump` dump dynamic symbols (`-T` and `--dynamic-syms`). Currently, this patch is not fully compatible with `gnu-objdump`, but I would like to continue working on this in next few patches. It has two issues.
1. Some symbols shouldn't be marked as global(g). (`-t/--syms` has same issue as well) (Fixed by D75659)
2. `gnu-objdump` can dump version information and *dynamically* insert before symbol name field.
`objdump -T a.out` gives:
```
DYNAMIC SYMBOL TABLE:
0000000000000000 w D *UND*
0000000000000000 _ITM_deregisterTMCloneTable
0000000000000000 DF *UND*
0000000000000000 GLIBC_2.2.5 printf
0000000000000000 DF *UND*
0000000000000000 GLIBC_2.2.5 __libc_start_main
0000000000000000 w D *UND*
0000000000000000 __gmon_start__
0000000000000000 w D *UND*
0000000000000000 _ITM_registerTMCloneTable
0000000000000000 w DF *UND*
0000000000000000 GLIBC_2.2.5 __cxa_finalize
```
`llvm-objdump -T a.out` gives:
```
DYNAMIC SYMBOL TABLE:
0000000000000000 w D *UND*
0000000000000000 _ITM_deregisterTMCloneTable
0000000000000000 g DF *UND*
0000000000000000 printf
0000000000000000 g DF *UND*
0000000000000000 __libc_start_main
0000000000000000 w D *UND*
0000000000000000 __gmon_start__
0000000000000000 w D *UND*
0000000000000000 _ITM_registerTMCloneTable
0000000000000000 w DF *UND*
0000000000000000 __cxa_finalize
```
Reviewers: jhenderson, grimar, MaskRay, espindola
Reviewed By: jhenderson, grimar
Subscribers: emaste, rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75756
Kazuaki Ishizaki [Sun, 5 Apr 2020 02:30:01 +0000 (11:30 +0900)]
[mlir] NFC: Fix trivial typo
Differential Revision: https://reviews.llvm.org/D77473
Kazuaki Ishizaki [Sun, 5 Apr 2020 02:25:24 +0000 (11:25 +0900)]
[clang-tools-extra] NFC: Fix trivial typo in documents and comments
Differential Revision: https://reviews.llvm.org/D77458
Matt Arsenault [Tue, 11 Sep 2018 04:32:54 +0000 (11:32 +0700)]
AMDGPU: Fix annotate kernel features through casted calls
I thought I was testing this before, but the workitem id x
case isn't great since it's mandatory in the parent kernel.
Shinji Okumura [Sun, 5 Apr 2020 00:15:26 +0000 (19:15 -0500)]
[Attributor] AAReachability : use isPotentiallyReachable in isKnownReachable
`isKnownReachable` had only interface (always returns true).
Changed it to call `isPotentiallyReachable`.
This change enables deductions of other Abstract Attributes depending on
AAReachability to use reachability information obtained from CFG, and it
can make them stronger.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D76210
Shinji Okumura [Sat, 4 Apr 2020 16:38:09 +0000 (11:38 -0500)]
[Attributor] Make use of analysis in the MustBeExecutedExplorer
This commit was made to settle [[ https://github.com/llvm/llvm-project/issues/175 | this issue on GitHub ]].
I added analysis getters for LoopInfo, DominatorTree, and
PostDominatorTree. And I added a test to show an improvement of the
deduction of `dereferenceable` attribute.
Reviewed By: jdoerfert, uenoku
Differential Revision: https://reviews.llvm.org/D76378
Matt Arsenault [Wed, 15 Aug 2018 19:45:04 +0000 (22:45 +0300)]
AMDGPU: Add feature for fast f32 denormals
Stefanos Baziotis [Sat, 4 Apr 2020 23:46:26 +0000 (02:46 +0300)]
[Attributor] AAUndefinedBehavior: Use AAValueSimplify in memory accessing instructions.
Query AAValueSimplify on pointers in memory accessing instructions to take
advantage of the constant propagation (or any other value simplification) of such values.
Kamil Rytarowski [Sat, 4 Apr 2020 22:54:55 +0000 (00:54 +0200)]
[compiler-rt] Fix build on NetBSD 9.99.52+
Add a fallback definition of the netsmb device driver that
was removed.
Simon Pilgrim [Sat, 4 Apr 2020 21:46:36 +0000 (22:46 +0100)]
[CostModel][X86] Add some insert subvector cost tests for vXf32/vXi32/vXi16/vXi8 types
Simon Pilgrim [Sat, 4 Apr 2020 19:13:54 +0000 (20:13 +0100)]
[X86] Cleanup vectorcall test checks
PR32397 still needs to be fixed for the update script to process this
Louis Dionne [Sat, 4 Apr 2020 20:53:35 +0000 (16:53 -0400)]
[libc++] Enable the new libc++ testing format by default
Both test formats are equivalent, so this *should* not be a problem.
However, I'm taking advantage of the week-end to test this and see if
there are any failures. If so, it should be fine to revert this until
the failures have been addressed.
For the time being, it is still possible to use the old format by passing
`--param=use_old_format=True` when running Lit.
Brian Gesiak [Sat, 4 Apr 2020 17:01:32 +0000 (13:01 -0400)]
libcxx 'LLVM_USE_SANITIZER=Address;Undefined'
Summary:
Allow users to simultaneously enable address and undefined behavior
sanitizers, in the same manner that LLVM's 'HandleLLVMOptions.cmake'
allows.
Prior to this patch, `cmake -DLLVM_USE_SANITIZER="Address;Undefined"`
would succeed and the build would build most of the LLVM project with
`-fsanitize=address,undefined`, but a warning would be printed by
libcxx's CMake, and the build would use neither sanitizer. This
patch results in no warning being printed, and both sanitizers are used
in building libcxx.
Reviewers: jroelofs, EricWF, ldionne, #libc!
Subscribers: mgorny, dexonsmith, llvm-commits, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D77466
Jonathan Roelofs [Sat, 4 Apr 2020 19:47:22 +0000 (13:47 -0600)]
Revert "[DAG] Fix PR45049: LegalizeTypes crash"
This reverts commit
17673ae0b2cbf8d48973b673d413fb8591d8aae7.
Jonathan Roelofs [Sat, 28 Mar 2020 18:55:51 +0000 (12:55 -0600)]
[DAG] Fix PR45049: LegalizeTypes crash
Sometimes LegalizeTypes knows about common subexpressions before SelectionDAG
does, leading to accidental SDValue removal before its reference count was
truly zero.
Fixes: https://bugs.llvm.org/show_bug.cgi?id=45049
https://reviews.llvm.org/D76994
Fangrui Song [Fri, 27 Mar 2020 04:20:13 +0000 (21:20 -0700)]
[ELF][PPC64] Enable R_PPC64_REL14 trunks
The thunk implementation is available but an assertion disallows it.
Linux kernel has such a use case: in arch/powerpc/kernel/exceptions-64s.S:handle_page_fault,
beq+ ret_from_except_lite may get out of range.
Link: https://github.com/ClangBuiltLinux/linux/issues/951
Differential Revision: https://reviews.llvm.org/D76904
Fangrui Song [Sat, 4 Apr 2020 17:24:48 +0000 (10:24 -0700)]
[ELF][test] Test that thunks are processed before finalizeSynthetic(in.symTab)
finalizeSynthetic(in.symTab) calls sortSymTabSymbols() to order local
symbols before non-local symbols.
The newly added tests ensure that thunk symbols are added before
finalizeSynthetic(in.symTab), otherwise .symtab would be out of order.
Sanjay Patel [Sat, 4 Apr 2020 17:43:27 +0000 (13:43 -0400)]
[ValueTracking] add tests for smin/smax; NFC
Sanjay Patel [Sat, 4 Apr 2020 15:36:12 +0000 (11:36 -0400)]
[InstCombine] add more tests for min/max folding; NFC
Florian Hahn [Sat, 4 Apr 2020 14:19:20 +0000 (15:19 +0100)]
[LV] Simplify tryToWiden as recipes are not re-used (NFC).
After
49d00824bbbb, VPWidenRecipe only stores a single instruction.
tryToWiden can simply return the widen recipe, like other helpers in
VPRecipeBuilder.
Jean-Michel Gorius [Sat, 4 Apr 2020 17:15:44 +0000 (17:15 +0000)]
[mlir] Add an out-of-tree dialect example
This adds a minimal out-of-tree dialect template which can be used to start work on a standalone dialect implementation without having to integrate it in the main LLVM tree.
It mostly sets up the directory structure and provides CMakeLists.txt files to build a dialect library, an opt-like tool to operate on that dialect as well as tests. It could be expanded in the future to add examples of more user-defined operations, types, attributes, generated enums, transforms, etc. and linked to a tutorial.
Differential Revision: https://reviews.llvm.org/D77133
Heejin Ahn [Sat, 4 Apr 2020 16:45:47 +0000 (09:45 -0700)]
[WebAssembly] Fix a sanitizer error in WasmEHPrepare
Summary:
D77423 started using a dominator tree in WasmEHPrepare, but we deleted
BBs in `prepareThrows` before we used the domtree in `prepareEHPads`,
and those CFG changes were not reflected in the domtree. This uses
`DomTreeUpdater` to make sure we update the domtree every time we delete
BBs from the CFG. This fixes ubsan/msan/expensive_check errors caught in
LLVM buildbots.
Reviewers: dschuff
Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77465
Nico Weber [Sat, 4 Apr 2020 16:52:37 +0000 (12:52 -0400)]
fix typo in comment to cycle bots
Nikita Popov [Wed, 1 Apr 2020 20:56:53 +0000 (22:56 +0200)]
[InstCombine] Don't limit uses in eraseInstFromFunction()
eraseInstFromFunction() adds the operands of the erased instructions,
as those might now be dead as well. However, this is limited to
instructions with less than 8 operands.
This check doesn't make a lot of sense to me. As the instruction
gets removed afterwards, I don't see a potential for anything
overly pathological happening here (as we can only add those
operands to the worklist once). The impact on CTMark is in
the noise. We also have the same code in instruction sinking
and don't limit the operand count there.
Differential Revision: https://reviews.llvm.org/D77325
Luofan Chen [Sat, 4 Apr 2020 16:32:36 +0000 (11:32 -0500)]
[Attributor] Deduce attributes for non-exact functions
This patch is based on D63312 and D63319. For now we create shallow wrappers for all functions that are IPO amendable.
See also [this github issue](https://github.com/llvm/llvm-project/issues/172).
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D76404
Johannes Doerfert [Sun, 29 Mar 2020 20:55:52 +0000 (15:55 -0500)]
[OpenMP][NFC] Remove unnecessary argument
Nico Weber [Sat, 4 Apr 2020 16:34:20 +0000 (12:34 -0400)]
Disable relative paths in lit.site.cfg in presence of symlinks
See https://reviews.llvm.org/D77184#1961208
Tamás Zolnai [Sat, 4 Apr 2020 15:17:52 +0000 (17:17 +0200)]
[clang-tidy]: fix false positive of cert-oop54-cpp check.
Summary:
It seems we need a different matcher for binary operator
in a template context.
Fixes this issue:
https://bugs.llvm.org/show_bug.cgi?id=44499
Reviewers: aaron.ballman, alexfh, hokein, njames93
Reviewed By: aaron.ballman
Subscribers: xazax.hun, cfe-commits
Tags: #clang, #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D76990
Heejin Ahn [Tue, 31 Mar 2020 23:08:01 +0000 (16:08 -0700)]
[WebAssembly] Fix wasm.lsda() optimization in WasmEHPrepare
Summary:
When we insert a call to the personality function wrapper
(`_Unwind_CallPersonality`) for a catch pad, we store some necessary
info in `__wasm_lpad_context` struct and pass it. One of the info is the
LSDA address for the function. For this, we insert a call to
`wasm.lsda()`, which will be lowered down to the address of LSDA, and
store it in a field in `__wasm_lpad_context`.
There are exceptions to this personality call insertion: catchpads for
`catch (...)` and cleanuppads (for destructors) don't need personality
function calls, because we don't need to figure out whether the current
exception should be caught or not. (They always should.)
There was a little optimization to `wasm.lsda()` call insertion. Because
the LSDA address is the same throughout a function, we don't need to
insert a store of `wasm.lsda()` return value in every catchpad. For
example:
```
try {
foo();
} catch (int) {
// wasm.lsda() call and a store are inserted here, like, in
// pseudocode,
// %lsda = wasm.lsda();
// store %lsda to a field in __wasm_lpad_context
try {
foo();
} catch (int) {
// We don't need to insert the wasm.lsda() and store again, because
// to arrive here, we have already stored the LSDA address to
// __wasm_lpad_context in the outer catch.
}
}
```
So the previous algorithm checked if the current catch has a parent EH
pad, we didn't insert a call to `wasm.lsda()` and its store.
But this was incorrect, because what if the outer catch is `catch (...)`
or a cleanuppad?
```
try {
foo();
} catch (...) {
// wasm.lsda() call and a store are NOT inserted here
try {
foo();
} catch (int) {
// We need wasm.lsda() here!
}
}
```
In this case we need to insert `wasm.lsda()` in the inner catchpad,
because the outer catchpad does not have one.
To minimize the number of inserted `wasm.lsda()` calls and stores, we
need a way to figure out whether we have encountered `wasm.lsda()` call
in any of EH pads that dominates the current EH pad. To figure that
out, we now visit EH pads in BFS order in the dominator tree so that we
visit parent BBs first before visiting its child BBs in the domtree.
We keep a set named `ExecutedLSDA`, which basically means "Do we have
`wasm.lsda()` either in the current EH pad or any of its parent EH
pads in the dominator tree?". This is to prevent scanning the domtree up
to the root in the worst case every time we examine an EH pad: each EH
pad only needs to examine its immediate parent EH pad.
- If any of its parent EH pads in the domtree has `wasm.lsda()`, this
means we don't need `wasm.lsda()` in the current EH pad. We also insert
the current EH pad in `ExecutedLSDA` set.
- If none of its parent EH pad has `wasm.lsda()`
- If the current EH pad is a `catch (...)` or a cleanuppad, done.
- If the current EH pad is neither a `catch (...)` nor a cleanuppad,
add `wasm.lsda()` and the store in the current EH pad, and add the
current EH pad to `ExecutedLSDA` set.
Reviewers: dschuff
Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77423
Simon Pilgrim [Sat, 4 Apr 2020 12:08:01 +0000 (13:08 +0100)]
[CostModel][X86] Add shuffle cost tests for sub-128bit vectors
Simon Pilgrim [Sat, 4 Apr 2020 11:44:56 +0000 (12:44 +0100)]
[CostModel][X86] Add insert/extract cost tests for sub-128bit vXi8/vXi16 vectors
Simon Pilgrim [Sat, 4 Apr 2020 10:42:06 +0000 (11:42 +0100)]
[X86][SSE] lowerV8I16Shuffle - lower compaction shuffles using PACKUSDW(PBLENDW,PBLENDW) on SSE41+
Similar to the lowerV16I8Shuffle implementation, for binary compaction v8i16 shuffles we can avoid the PUNPCKLDQ(PSHUFB,PSHUFB) pattern on SSE41+ targets by using PACKUSDW and PBLENDW. Before SSE41 we would need to use PACKSSDW but that requires sign extension that seems to destroy any gains, even on targets without PSHUFB.
This is a bigger gain on AMD than Intel targets but should never be a regression, and avoiding the shuffle mask load(s) is always useful.
Noticed in codegen while dealing with PR31443.
Nikita Popov [Thu, 2 Apr 2020 19:35:24 +0000 (21:35 +0200)]
[IRBuilder] Move some code into the cpp file; NFC
Since D73835 we no longer need to define the whole IRBuilder
implementation in the header. This patch moves some of the larger
methods out of line, into the C++ file.
Differential Revision: https://reviews.llvm.org/D77332
Nikita Popov [Sat, 4 Apr 2020 10:40:09 +0000 (12:40 +0200)]
[VNCoercion] Use IRBuilderBase; NFC
And remove include from header.
vgxbj [Sat, 4 Apr 2020 10:17:58 +0000 (18:17 +0800)]
[Object] object::ELFObjectFile::dynamic_symbol_begin(): skip symbol index 0
Summary:
Note: This revision is very similar to D62296.
In D75756, we need `getDynamicSymbolIterators()` to skip first NULL symbol in `.dynsym`. And I believe it might be worth pointing this out in a separate patch to gather you experts' opinions.
I have checked that current code base will not be affected by this change.
```
dynamic_symbol_begin()
|- dynamic_symbol_end(): Ok
`- getDynamicSymbolIterators()
|- addDynamicElfSymbols(): llvm/tools/llvm-objdump/llvm-objdump.cpp, Line 934
| Ok, NULL symbol will be omitted by Line 945-947
| StringRef Name = unwrapOrError(Symbol.getName(), Obj->getName());
| if (Name.empty()) continue;
|- dumpSymbolNameFromObject(): llvm/tools/llvm-nm/llvm-nm.cpp, Line 1192
| There's no test for dumping dynamic debugging symbol. This patch helps improve llvm-nm behavior. (we should add test for this later)
`- computeSymbolSizes(): llvm/lib/Object/SymbolSize.cpp, Line 52
|- OProfileJITEventListener::notifyObjectLoaded(): llvm/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp, Line 92
| Ok, NULL symbol will be omitted by Line 94-95
| if (!Sym.getType() || *Sym.getType() != SF_Function) continue;
|- IntelJITEventListener::notifyObjectLoaded(): llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp, Line 98
| Ok, NULL symbol will be omitted by Line 124-126 (same as previous one)
|- PerfJITEventListener::notifyObjectLoaded(): llvm/lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp, Line 244
| Ok, NULL symbol will be omitted by Line 254-256, (same as previous one)
|- SymbolizableObjectFile::create(): llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp, Line 73
| Ok, NULL symbol will be omitted by Line 75
| res->addSymbol()
| In addSymbol(), Line 167-168
| if (!Sec || (Obj && Obj->section_end() == *Sec)) return std::error_code();
|- dumpCXXData(): llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp, Line 189
| Ok, NULL symbol will be omitted by Line 199-202
| object::section_iterator SecI = *SecIOrErr;
| // Skip external symbols.
| if (SecI == Obj->section_end())
| continue;
`- printLineInfoForInput(): llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp, Line 418
Ok, NULL symbol will be omitted by Line 430-477
if (Type == object::SymbolRef::ST_Function) {
...
}
```
Reviewers: grimar, jhenderson, MaskRay
Reviewed By: jhenderson, MaskRay
Subscribers: rupprecht, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76081
Nikita Popov [Sat, 4 Apr 2020 10:34:16 +0000 (12:34 +0200)]
[Reassociate] Use IRBuilderBase; NFC
And remove now unnecessary IRBuilder.h include in header.
Nikita Popov [Sat, 4 Apr 2020 10:02:21 +0000 (12:02 +0200)]
[IVDescriptors] Remove IRBuilder.h include; NFC
IVDescriptors.h itself does not reference IRBuilder at all.
Move the include into transformation passes that do.
Nikita Popov [Sat, 4 Apr 2020 09:51:06 +0000 (11:51 +0200)]
[IVDescriptors] Remove unnecessary DemandedBits.h include; NFC
Forward declare DemandedBits in IVDescriptors, and move include
into the cpp file. Also drop the include from LoopUtils, which
does not need it at all.
Eric Fiselier [Sat, 4 Apr 2020 07:18:01 +0000 (03:18 -0400)]
[libc++] Attempt to workaround module invalidation bug
Sam McCall [Sat, 4 Apr 2020 06:06:24 +0000 (08:06 +0200)]
[clangd] Tweak parseDocumentation loop to use raw lines. NFC
This clears the way for the raw lines themselves to be parsed easily.
(Okay, one functional change: fix punctuation linebreaks with trailing WS)
Sam McCall [Fri, 3 Apr 2020 15:09:38 +0000 (17:09 +0200)]
[clang] Annotate trivial getters and setters on hover.
Summary: (Only if their definitions are visible and they have no other docs)
Reviewers: kadircet
Subscribers: jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77408
Frederik Gossen [Sat, 4 Apr 2020 04:33:58 +0000 (04:33 +0000)]
[MLIR] Fix shape inference in toy tutorial
The implementation of shape inference in the toy tutorial did not conform to the correct algorithmic description.
The result was only correct because all operations appear to be processed in sequence.
Differential Revision: https://reviews.llvm.org/D77382
Matt Arsenault [Sat, 4 Apr 2020 03:17:28 +0000 (23:17 -0400)]
AMDGPU: Fix a few more tests with old denormal subtarget features
Mehdi Amini [Sat, 4 Apr 2020 03:21:12 +0000 (03:21 +0000)]
Add mention of advantages of `arc` in the Phabricator doc.
Differential Revision: https://reviews.llvm.org/D76952
Richard Smith [Sat, 4 Apr 2020 03:17:43 +0000 (20:17 -0700)]
Don't treat a CXXScopeSpec with a nested name specifier but no location
as invalid.
We create those when forming trivial type source information with no
associated location, which, unfortunately, we do create in some cases
(when a TreeTransform with no base location is used to transform a
QualType).
This would previously lead to rejects-valid bugs when we misinterpreted
these constructs as having no nested-name-specifier.
Frederik Gossen [Sat, 4 Apr 2020 03:17:15 +0000 (03:17 +0000)]
Fix typos in toy tutorial
Fix two typos throughout the chapters.
Differential Revision: https://reviews.llvm.org/D77397
Kazuaki Ishizaki [Sat, 4 Apr 2020 03:06:29 +0000 (12:06 +0900)]
[OpenMP] NFC: Fix trivial typo
Differential Revision: https://reviews.llvm.org/D77430
Jim Ingham [Sat, 4 Apr 2020 02:58:56 +0000 (19:58 -0700)]
The thread plan list test is failing at least on Ubuntu Linux.
Mark it expected fail for now.
The test output shows that the "internal" thread listing isn't showing the
step out plan that we use to step back out of a function we're stepping into.
The internal plan listing code has nothing platform specific in it, so that
isn't the problem.
I am pretty sure the difference is that on MacOS we step into the function and then need to
step back out again so we push the internal plan the test is checking for. But on Linux we
are able to step past the function without stepping into it.
So nothing is actually going wrong here, I just need to find a better test case where I
can ensure we are going to have to push a private plan. It's probably better to test this
using a custom thread plan, then I can control the state of the plan stack better.
That's for Monday...
Walter Erquinigo [Sat, 4 Apr 2020 02:49:07 +0000 (19:49 -0700)]
Fix LLDB debug builds
Summary:
A recent change in ThreadPlans introduced this little compilation error.
Seems to be related to the work around https://reviews.llvm.org/D76814.
Reviewers: clayborg, labath, jingham
Reviewed By: jingham
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D77450
River Riddle [Sat, 4 Apr 2020 02:20:33 +0000 (19:20 -0700)]
[mlir][DeclarativeParser] Emit an error if a `:` follows an attribute with a non-constant type.
Summary: The attribute grammar includes an optional trailing colon type, so for attributes without a constant buildable type this will generally lead to unexpected and undesired behavior. Given that, it's better to just error out on these cases.
Differential Revision: https://reviews.llvm.org/D77293
Walter Erquinigo [Sat, 4 Apr 2020 00:29:32 +0000 (17:29 -0700)]
[source maps] Fix remove, insert-after and replace
Summary:
In this diff of mine D77186 I introduce a bug in the replace operation, where I was failing fast by mistake.
Besides, a similar problem existed in the insert-after operation, where it was failing fast.
Finally, the remove operation was wrong, as it was not using the indices provided by the users.
I fixed those issues and added some tests account for cases with multiple elements in these requests.
Reviewers: labath, clayborg
Reviewed By: labath
Subscribers: mgrang, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D77324
River Riddle [Sat, 4 Apr 2020 02:02:39 +0000 (19:02 -0700)]
[mlir] Change the default of `mlir-print-op-on-diagnostic` to true
Summary: It is a very common user trap to think that the location printed along with the diagnostic is the same as the current operation that caused the error. This revision changes the behavior to always print the current operation, except for when diagnostics are being verified. This is achieved by moving the command line flags in IR/ to be options on the MLIRContext.
Differential Revision: https://reviews.llvm.org/D77095
Nemanja Ivanovic [Sat, 4 Apr 2020 01:41:22 +0000 (20:41 -0500)]
[NFC][PowerPC] Pre-commit a test case for D77448
Pre-committing the new test case so the review shows only the diffs.
Richard Smith [Sat, 4 Apr 2020 01:22:17 +0000 (18:22 -0700)]
PR45402: Make the restrictions on constant evaluation of memcmp and
memchr consistent and comprehensible, and document them.
We previously allowed evaluation of memcmp on arrays of integers of any
size, so long as the call evaluated to 0, and allowed evaluation of
memchr on any array of integral type of size 1 (including enums). The
purpose of constant-evaluating these builtins is only to support
constexpr std::char_traits, so we now consistently allow them on arrays
of (possibly signed or unsigned) char only.
Jim Ingham [Sat, 4 Apr 2020 01:02:51 +0000 (18:02 -0700)]
This test is failing on the Ubuntu bot but the bot log doesn't
capture the test stdout, so put the info I need to see in the error
message instead.
Eli Friedman [Fri, 3 Apr 2020 22:11:40 +0000 (15:11 -0700)]
[clang][opaque pointers] Fix up a bunch of "getType()->getElementType()"
In contexts where we know an LLVM type is a pointer, there's generally
some simpler way to get the pointee type.
Eli Friedman [Fri, 3 Apr 2020 21:57:12 +0000 (14:57 -0700)]
[polly][opaque pointers] Remove use of deprecated APIs.
(See also D76269.)