platform/upstream/llvm.git
3 years ago[clangd] Enforce trailing slash for remote index's project root
Kirill Bobyrev [Tue, 11 Aug 2020 11:24:22 +0000 (13:24 +0200)]
[clangd] Enforce trailing slash for remote index's project root

Reviewed By: hokein

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

3 years ago[AutoUpgrade] Simplify code
Benjamin Kramer [Tue, 11 Aug 2020 11:20:39 +0000 (13:20 +0200)]
[AutoUpgrade] Simplify code

No need to set the name on an instruction that's going away, just move
it from the old instruction to the new one.

3 years ago[CodeGen] Refactor getMemBasePlusOffset & getObjectPtrOffset to accept a TypeSize
Kerry McLaughlin [Tue, 11 Aug 2020 10:38:08 +0000 (11:38 +0100)]
[CodeGen] Refactor getMemBasePlusOffset & getObjectPtrOffset to accept a TypeSize

Changes the Offset arguments to both functions from int64_t to TypeSize
& updates all uses of the functions to create the offset using TypeSize::Fixed()

Reviewed By: efriedma

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

3 years ago[lldb] stop-hook ID common completion for commands `target stop-hook enable/disable...
Gongyu Deng [Tue, 11 Aug 2020 11:13:49 +0000 (13:13 +0200)]
[lldb] stop-hook ID common completion for commands `target stop-hook enable/disable/delete'

1. Added a common completion StopHookIDs to provide completion with a list of stop hook ids;
2. Applied the common completion to commands: `target stop-hook delete/enable/disable';
3. Added an related test case.

Reviewed By: teemperor

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

3 years ago[X86][FPEnv] Fix a use after free
Benjamin Kramer [Tue, 11 Aug 2020 11:00:47 +0000 (13:00 +0200)]
[X86][FPEnv] Fix a use after free

Found by asan!

3 years ago[lldb] Fix unhandled switch case for GOFF in GDBRemoteCommunicationClient
Raphael Isemann [Tue, 11 Aug 2020 10:47:42 +0000 (12:47 +0200)]
[lldb] Fix unhandled switch case for GOFF in GDBRemoteCommunicationClient

Just implementing the default case that emits an error to supress the compiler
warning.

3 years ago[compiler-rt][ubsan][test] Fix TypeCheck/misaligned.cpp on Sparc
Rainer Orth [Tue, 11 Aug 2020 10:46:34 +0000 (12:46 +0200)]
[compiler-rt][ubsan][test] Fix TypeCheck/misaligned.cpp on Sparc

Two ubsan tests FAIL on Sparc:

  UBSan-Standalone-sparc :: TestCases/TypeCheck/misaligned.cpp
  UBSan-Standalone-sparcv9 :: TestCases/TypeCheck/misaligned.cpp

I've reported the details in Bug 47015, but it boils down to the fact that
the `s1` subtest actually incurs a fault on strict-alignment targets like
Sparc which UBSan doesn't expect.

This can be fixed like the `w1` subtest by compiling with
`-fno-sanitize-recover=alignment`.

Tested on `sparcv9-sun-solaris2.11`, `amd64-pc-solaris2.11`, and
`x86_64-pc-linux-gnu`.

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

3 years ago[VE] Update bit operations
Kazushi (Jam) Marukawa [Mon, 10 Aug 2020 08:16:57 +0000 (17:16 +0900)]
[VE] Update bit operations

Change bitreverse/bswap/ctlz/ctpop/cttz regression tests to support i128
and signext/zeroext i32 types.  This patch also change the way to support
i32 types using 64 bits VE instructions.

Reviewed By: simoll

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

3 years ago[SVE] Add ISD nodes for predicated integer extend inreg operations.
Paul Walker [Fri, 7 Aug 2020 18:19:50 +0000 (19:19 +0100)]
[SVE] Add ISD nodes for predicated integer extend inreg operations.

These are useful instructions when lowering fixed length vector
extends, so I've broken this patch out as kind of NFC like work.

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

3 years ago[X86] Rename combineVectorPackWithShuffle -> combineHorizOpWithShuffle. NFC.
Simon Pilgrim [Tue, 11 Aug 2020 10:38:26 +0000 (11:38 +0100)]
[X86] Rename combineVectorPackWithShuffle -> combineHorizOpWithShuffle. NFC.

The plan is to use this for (F)HADD/SUB opcodes as well as PACKs - similar to how we use combineShuffleWithHorizOp

3 years ago[clangd] RIFF.cpp - Use logical && instead of bitwise & for padding check
Simon Pilgrim [Tue, 11 Aug 2020 10:36:21 +0000 (11:36 +0100)]
[clangd] RIFF.cpp - Use logical && instead of bitwise & for padding check

Fixes PR47070

3 years ago[lldb] tab completion for `target modules load -u`
Gongyu Deng [Tue, 11 Aug 2020 10:29:25 +0000 (12:29 +0200)]
[lldb] tab completion for `target modules load -u`

1. Added a common completion ModuleUUIDs to provide a list of the UUIDs of modules for completion;
2. Added a new enumeration item eArgTypeModuleUUID to CommandArgumentType which is set as the option argument type of OptionGroupUUID;
3. Applied the module UUID completion to the argument of the type eArgTypeModuleUUID in lldb/source/Interpreter/CommandObject.cpp;
4. Added an related test case in lldb/test/API/functionalities/completion/TestCompletion.py.

3 years ago[SVE] Lower fixed length vector integer subtract operations.
Paul Walker [Mon, 10 Aug 2020 17:02:53 +0000 (18:02 +0100)]
[SVE] Lower fixed length vector integer subtract operations.

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

3 years ago[lldb] move the frame index completion into a common completion and apply it to ...
Gongyu Deng [Tue, 11 Aug 2020 10:20:43 +0000 (12:20 +0200)]
[lldb] move the frame index completion into a common completion and apply it to `thread backtrace -s`

Commands frame select and thread backtrace -s can be completed in the same way.
Moved the dedicated completion of frame select into a common completion and
apply it to the both commands, along with the test modified.

3 years agoAdd missing `-o -` to a recent test
David Zarzycki [Tue, 11 Aug 2020 09:56:58 +0000 (05:56 -0400)]
Add missing `-o -` to a recent test

Caught with a build-system that remounts the source directory read-only.

3 years ago[lldb] tab completion for `target modules search-paths insert​`
Gongyu Deng [Tue, 11 Aug 2020 09:12:11 +0000 (11:12 +0200)]
[lldb] tab completion for `target modules search-paths insert​`

Dedicated completion for the command `target modules search-paths insert​` with a test case.

Reviewed By: JDevlieghere

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

3 years ago[NFC] Fix typo in comment.
Kai Nacke [Tue, 11 Aug 2020 09:27:56 +0000 (05:27 -0400)]
[NFC] Fix typo in comment.

Twelvth -> Twelfth

3 years ago[SystemZ/ZOS] Add binary format goff and operating system zos to the triple
Kai Nacke [Fri, 19 Jun 2020 11:43:35 +0000 (13:43 +0200)]
[SystemZ/ZOS] Add binary format goff and operating system zos to the triple

Adds the binary format goff and the operating system zos to the triple
class. goff is selected as default binary format if zos is choosen as
operating system. No further functionality is added.

Reviewers: efriedma, tahonermann, hubert.reinterpertcast, MaskRay

Reviewed By: efriedma, tahonermann, hubert.reinterpertcast

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

3 years ago[Docs] Fixed missing closing quote character
Dávid Bolvanský [Tue, 11 Aug 2020 09:21:15 +0000 (11:21 +0200)]
[Docs] Fixed missing closing quote character

3 years ago[SLP] Make sure instructions are ordered when computing spill cost.
Florian Hahn [Tue, 11 Aug 2020 09:15:20 +0000 (11:15 +0200)]
[SLP] Make sure instructions are ordered when computing spill cost.

The entries in VectorizableTree are not necessarily ordered by their
position in basic blocks. Collect them and order them by dominance so
later instructions are guaranteed to be visited first. For instructions
in different basic blocks, we only scan to the beginning of the block,
so their order does not matter, as long as all instructions in a basic
block are grouped together. Using dominance ensures a deterministic order.

The modified test case contains an example where we compute a wrong
spill cost (2) without this patch, even though there is no call between
any instruction in the bundle.

This seems to have limited practical impact, .e.g on X86 with a recent
Intel Xeon CPU with -O3 -march=native -flto on MultiSource,SPEC2000,SPEC2006
there are no binary changes.

Reviewed By: ABataev

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

3 years ago[lldb] type language common completion
Gongyu Deng [Tue, 11 Aug 2020 08:32:55 +0000 (10:32 +0200)]
[lldb] type language common completion

1. Added a new common completion TypeLanguages to provide a list of supporting languages;
2. Bound the completion to eArgTypeLanguage;
3. Added a related test case.

3 years ago[InstCombine] ~(~X + Y) -> X - Y
Dávid Bolvanský [Tue, 11 Aug 2020 09:05:06 +0000 (11:05 +0200)]
[InstCombine] ~(~X + Y) -> X - Y

Proof:
https://alive2.llvm.org/ce/z/4xharr

Solves PR47051

Reviewed By: nikic

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

3 years ago[SCEVExpander] Add helper to clean up instrs inserted while expanding.
Florian Hahn [Tue, 11 Aug 2020 08:30:31 +0000 (09:30 +0100)]
[SCEVExpander] Add helper to clean up instrs inserted while expanding.

SCEVExpander already tracks which instructions have been inserted n
InsertedValues/InsertedPostIncValues. This patch adds an additional
vector to collect the instructions in insertion order. This can then be
used to remove exactly the instructions inserted by the expander.

This replaces ExpandedValuesCleaner, which in some cases might remove
values not inserted by the expander (e.g. if a value was dead before
insertion and is then used during expansion).

Reviewed By: lebedev.ri

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

3 years ago[lldb] tab completion for 'command delete/unalias'
Gongyu Deng [Tue, 11 Aug 2020 08:10:08 +0000 (10:10 +0200)]
[lldb] tab completion for 'command delete/unalias'

Provided dedicated tab completions for `command delete/unalias`.

Reviewed By: teemperor

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

3 years ago[lldb][NFC] Fix warning in Thread::AutoCompleteThreadPlans
Raphael Isemann [Tue, 11 Aug 2020 08:26:01 +0000 (10:26 +0200)]
[lldb][NFC] Fix warning in Thread::AutoCompleteThreadPlans

3 years ago[lldb] tab completion for `thread plan discard`
Gongyu Deng [Tue, 11 Aug 2020 08:02:51 +0000 (10:02 +0200)]
[lldb] tab completion for `thread plan discard`

Dedicated completion for the command `thread plan discard` with a corresponding
test case.

Reviewed By: teemperor

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

3 years ago[Analyzer] Improve invalid dereference bug reporting in DereferenceChecker.
Balázs Kéri [Tue, 11 Aug 2020 07:03:22 +0000 (09:03 +0200)]
[Analyzer] Improve invalid dereference bug reporting in DereferenceChecker.

Report undefined pointer dereference in similar way as null pointer dereference.

Reviewed By: NoQ

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

3 years ago[lldb][NFC] Remove unused custom reimplementation of realpath for Windows
Raphael Isemann [Tue, 11 Aug 2020 08:04:16 +0000 (10:04 +0200)]
[lldb][NFC] Remove unused custom reimplementation of realpath for Windows

No one is calling this function it seems and according to
https://bugs.llvm.org/show_bug.cgi?id=47088 this can leak memory, so let's just
remove it:

Quote from the bug report:
> Before return on line 146, the memory allocated on line 130 is not freed.

Reviewed By: amccarth

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

3 years ago[RDA] Fix DBG_VALUE issues
Sam Parker [Fri, 7 Aug 2020 08:49:09 +0000 (09:49 +0100)]
[RDA] Fix DBG_VALUE issues

We skip debug instructions in RDA so we cannot attempt to look them
up in our instruction map without causing a crash. But some of the
methods select the last instruction in the block and this
instruction may be a debug instruction... So, use getLastNonDebugInstr
instead of calling back on a MachineBasicBlock.

MachineBasicBlock iterators have also been updated to use
instructionsWithoutDebug so we can avoid the manual checks for debug
instructions.

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

3 years ago[lldb] tab completion for `disassemble -F`
Gongyu Deng [Tue, 11 Aug 2020 07:59:30 +0000 (09:59 +0200)]
[lldb] tab completion for `disassemble -F`

1.Added a new common completion DisassemblyFlavors;

2. Bound DisassemblyFlavors to argument of type eArgTypeDisassemblyFlavor in
CommandObject.cpp;

3. Added a related test case.

3 years ago[lldb] tab completion for `watchpoint set variable`
Gongyu Deng [Tue, 11 Aug 2020 07:50:28 +0000 (09:50 +0200)]
[lldb] tab completion for `watchpoint set variable`

1. Applied the common completion `eVariablePathCompletion` to command
`watchpoint set variable`;

2. Added a related test case.

Reviewed By: teemperor, JDevlieghere

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

3 years ago[clangd] Improve diagnostics in dexp interface
Kirill Bobyrev [Tue, 11 Aug 2020 07:48:54 +0000 (09:48 +0200)]
[clangd] Improve diagnostics in dexp interface

When running dexp in remote mode without --project-root it shuts down
with an assertion. This is not the desired behaviour: instruct user on
how to run it properly when the configuration is incorrect.

3 years agoRevert "[flang] Version information in flang/f18"
Richard Barton [Tue, 11 Aug 2020 07:41:57 +0000 (08:41 +0100)]
Revert "[flang] Version information in flang/f18"

Patch breaks out of tree builds and fails its regression test on buildbots.

This reverts commit 6e67a74ed73e60a9609f2666e9ac9f44c63c3e0f.

3 years ago[LazyValueInfo] Let getEdgeValueLocal look into freeze instructions
Juneyoung Lee [Tue, 11 Aug 2020 01:15:18 +0000 (10:15 +0900)]
[LazyValueInfo] Let getEdgeValueLocal look into freeze instructions

This patch makes getEdgeValueLocal more precise when a freeze instruction is
given, by adding support for freeze into constantFoldUser

Reviewed By: efriedma

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

3 years agoTest requires a debug build to pass.
Eric Christopher [Tue, 11 Aug 2020 06:57:33 +0000 (23:57 -0700)]
Test requires a debug build to pass.

3 years ago[Attributor][NFC] Connect AAPotentialValues with AAValueSimplify
Shinji Okumura [Tue, 11 Aug 2020 06:52:02 +0000 (15:52 +0900)]
[Attributor][NFC] Connect AAPotentialValues with AAValueSimplify

This patch enables `AAValueSimplify` to use information from `AAPotentialValues`

Reviewed By: jdoerfert

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

3 years ago[X86] Custom match X86ISD::VPTERNLOG in X86ISelDAGToDAG in order to reduce isel patterns.
Craig Topper [Tue, 11 Aug 2020 06:13:40 +0000 (23:13 -0700)]
[X86] Custom match X86ISD::VPTERNLOG in X86ISelDAGToDAG in order to reduce isel patterns.

By factoring out the end of tryVPTERNLOG, we can use the same code
to directly match X86ISD::VPTERNLOG. This allows us to remove
around 3-4K worth of X86GenDAGISel.inc.

3 years ago[CodeGen] Expand float operand for STRICT_FSETCC/STRICT_FSETCCS
QingShan Zhang [Tue, 11 Aug 2020 05:53:02 +0000 (05:53 +0000)]
[CodeGen] Expand float operand for STRICT_FSETCC/STRICT_FSETCCS

This patch is the continue work of https://reviews.llvm.org/D69281
to implement the way that expands STRICT_FSETCC/STRICT_FSETCCS.

Reviewed By: uweigand

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

3 years ago[lldb] Remove redundant add_definitions() in CMake (NFC)
Jonas Devlieghere [Tue, 11 Aug 2020 05:45:23 +0000 (22:45 -0700)]
[lldb] Remove redundant add_definitions() in CMake (NFC)

Remove the unused LLDB_CONFIGURATION_RELEASE and move LLDB_USE_OS_LOG
under debugserver which is the only one using it.

3 years ago[lldb] Use modern CMake to avoid repetition (NFC)
Jonas Devlieghere [Tue, 11 Aug 2020 05:25:05 +0000 (22:25 -0700)]
[lldb] Use modern CMake to avoid repetition (NFC)

Use the target variants of include_directories and add_definitions to
avoid repetition.

3 years ago[gn build] Port db91320a898
LLVM GN Syncbot [Tue, 11 Aug 2020 04:32:01 +0000 (04:32 +0000)]
[gn build] Port db91320a898

3 years agoRevert "Move ELFObjHandler to TextAPI library"
Haowei Wu [Tue, 11 Aug 2020 04:30:01 +0000 (21:30 -0700)]
Revert "Move ELFObjHandler to TextAPI library"

This reverts commit e6f8ba12e6ea97cbf4374b70e78309c2d859ca1c due
to build failures.

3 years ago[gn build] Port e6f8ba12e6e
LLVM GN Syncbot [Tue, 11 Aug 2020 04:24:23 +0000 (04:24 +0000)]
[gn build] Port e6f8ba12e6e

3 years agoMove ELFObjHandler to TextAPI library
Haowei Wu [Mon, 10 Aug 2020 18:35:01 +0000 (11:35 -0700)]
Move ELFObjHandler to TextAPI library

This change moves ELFObjHandler to llvm/TextAPI library so it can
be used by different llvm tools.

3 years ago[mlir][shape] Fix description copy pasta
Jacques Pienaar [Tue, 11 Aug 2020 04:17:32 +0000 (21:17 -0700)]
[mlir][shape] Fix description copy pasta

3 years ago[Sparc] Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP macros on SPARCv9
Brad Smith [Tue, 11 Aug 2020 04:04:24 +0000 (00:04 -0400)]
[Sparc] Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP macros on SPARCv9

3 years ago[lldb] Add missings moves where appropiate (NFC)
Jonas Devlieghere [Tue, 11 Aug 2020 04:01:23 +0000 (21:01 -0700)]
[lldb] Add missings moves where appropiate (NFC)

Manually curated list of things found by clang-tidy's
performance-unnecessary-value-param.

3 years ago[macho2yaml][test] Specify the object file's endianness. NFC.
Xing GUO [Tue, 11 Aug 2020 03:46:50 +0000 (11:46 +0800)]
[macho2yaml][test] Specify the object file's endianness. NFC.

This patch is intended to fix testing failure on big endian machine.

Failed testing: http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/52450

3 years ago[macho2yaml][test] Specify the object file's endianness. NFC.
Xing GUO [Tue, 11 Aug 2020 03:12:23 +0000 (11:12 +0800)]
[macho2yaml][test] Specify the object file's endianness. NFC.

This change specifies the endianness of the generated object file to fix
the testing failure.

Testing failure: http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/52449

3 years ago[Sema] Fix missing warning on initializer lists on field initializers with overloaded...
Zequan Wu [Tue, 11 Aug 2020 01:51:09 +0000 (18:51 -0700)]
[Sema] Fix missing warning on initializer lists on field initializers with overloaded operators

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

3 years ago[X86][FPEnv] Teach X86 mask compare intrinsics to respect strict FP semantics.
Wang, Pengfei [Tue, 11 Aug 2020 02:04:13 +0000 (10:04 +0800)]
[X86][FPEnv] Teach X86 mask compare intrinsics to respect strict FP semantics.

When we use mask compare intrinsics under strict FP option, the masked
elements shouldn't raise any exception. So, we cann't replace the
intrinsic with a full compare + "and" operation.

Reviewed By: craig.topper

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

3 years ago[lldb] Fix typo in AppleDWARFIndex
Jonas Devlieghere [Tue, 11 Aug 2020 02:21:09 +0000 (19:21 -0700)]
[lldb] Fix typo in AppleDWARFIndex

apple_names_table_up appeared twice in the binary expression, while the
second instance was meant to check apple_namespaces_table_up.

Fixes PR47101

3 years ago[AST] add parenthesis locations for IfStmt and SwitchStmt
Zequan Wu [Mon, 10 Aug 2020 23:29:33 +0000 (16:29 -0700)]
[AST] add parenthesis locations for IfStmt and SwitchStmt

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

3 years ago[macho2yaml] Refactor the DWARF section dumpers.
Xing GUO [Fri, 7 Aug 2020 04:07:31 +0000 (12:07 +0800)]
[macho2yaml] Refactor the DWARF section dumpers.

This patch refactors the DWARF section dumpers. When dumping a DWARF
section, if the DWARF parser fails to parse the section, we will dump it
as a raw content section. This patch also fixes a bug in
DWARFYAML::Data::isEmpty(). Finally, a test case that tests dumping the
__debug_aranges section is added.

Reviewed By: jhenderson, grimar

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

3 years ago[lld-macho] improve handling of -platform_version
Greg McGary [Tue, 11 Aug 2020 01:47:16 +0000 (18:47 -0700)]
[lld-macho] improve handling of -platform_version

This improves the handling of `-platform_version` by addressing the FIXME in the code to process the arguments.

Reviewed By: int3, #lld-macho

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

3 years ago[lld-macho] Handle command-line option -sectcreate SEG SECT FILE
Greg McGary [Tue, 11 Aug 2020 01:47:13 +0000 (18:47 -0700)]
[lld-macho] Handle command-line option -sectcreate SEG SECT FILE

Handle command-line option `-sectcreate SEG SECT FILE`, which inputs a binary blob from `FILE` into `SEG,SECT`

Reviewed By: int3

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

3 years agoRevert "[AIX] Try to not use LLVM tools while building runtimes"
Hubert Tong [Tue, 11 Aug 2020 01:35:49 +0000 (21:35 -0400)]
Revert "[AIX] Try to not use LLVM tools while building runtimes"

This reverts commit 50dd75c8e0b81815c6da209d5a3dd7bf899d1262.
@phosek reports a build break.

3 years agotest commit
Albion Fung [Mon, 10 Aug 2020 22:36:50 +0000 (18:36 -0400)]
test commit

3 years ago[CodeGen] Make MMI immutable NPM pass
Yuanfang Chen [Tue, 11 Aug 2020 00:50:04 +0000 (17:50 -0700)]
[CodeGen] Make MMI immutable NPM pass

3 years ago[llvm-jitlink] Update llvm-jitlink to use TargetProcessControl.
Lang Hames [Mon, 10 Aug 2020 23:57:53 +0000 (16:57 -0700)]
[llvm-jitlink] Update llvm-jitlink to use TargetProcessControl.

3 years agoImprove diagnostic for an expression that's not constant because it uses
Richard Smith [Tue, 11 Aug 2020 00:02:24 +0000 (17:02 -0700)]
Improve diagnostic for an expression that's not constant because it uses
the address of a constexpr local variable.

Suggest adding 'static' to give the constexpr local variable a constant
address.

3 years ago[CUDA][HIP] Do not externalize implicit constant static variable
Yaxun (Sam) Liu [Mon, 10 Aug 2020 20:38:10 +0000 (16:38 -0400)]
[CUDA][HIP] Do not externalize implicit constant static variable

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

3 years agoAdd regression test from PR46487.
Richard Smith [Mon, 10 Aug 2020 22:54:39 +0000 (15:54 -0700)]
Add regression test from PR46487.

The underlying crash here has already been fixed, presumably by ongoing
work on error recovery.

3 years ago[Diagnostics] Ignore structs and long text for -Wstring-concatenation
Dávid Bolvanský [Mon, 10 Aug 2020 22:49:47 +0000 (00:49 +0200)]
[Diagnostics] Ignore structs and long text for -Wstring-concatenation

3 years ago[mlir] Fix mlir build break due to warning when NDEBUG is not set
Thomas Raoux [Mon, 10 Aug 2020 22:33:40 +0000 (15:33 -0700)]
[mlir] Fix mlir build break due to warning when NDEBUG is not set

3 years agopython bindings: fix DeprecationWarning
Nick Desaulniers [Mon, 10 Aug 2020 22:25:20 +0000 (15:25 -0700)]
python bindings: fix DeprecationWarning

Fixes observed warning running `ninja check-all`:
llvm-project/clang/bindings/python/tests/cindex/test_diagnostics.py:100:
DeprecationWarning: Please use assertRegex instead.
  self.assertRegexpMatches(children[0].spelling

Looks like unittest.assertRegexpMatches has been deprecated in favor of
unittest.assertRegex since Python 3.2, according to:
https://docs.python.org/3/library/unittest.html#deprecated-aliases

Reviewed By: MaskRay

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

3 years ago[OpenMP][NFC] Reuse OMPIRBuilder `struct ident_t` handling in Clang
Johannes Doerfert [Thu, 28 May 2020 14:41:01 +0000 (09:41 -0500)]
[OpenMP][NFC] Reuse OMPIRBuilder `struct ident_t` handling in Clang

Replace the `ident_t` handling in Clang with the methods offered by the
OMPIRBuilder. This cuts down on the clang code as well as the
differences between the two, making further transitions easier. Tests
have changed but there should not be a real functional change. The most
interesting difference is probably that we stop generating local ident_t
allocations for now and just use globals. Given that this happens only
with debug info, the location part of the `ident_t` is probably bigger
than the test anyway. As the location part is already a global, we can
avoid the allocation, memcpy, and store in favor of a constant global
that is slightly bigger. This can be revisited if there are
complications.

Reviewed By: ABataev

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

3 years ago[Clang] implement -fno-eliminate-unused-debug-types
Nick Desaulniers [Mon, 10 Aug 2020 21:52:37 +0000 (14:52 -0700)]
[Clang] implement -fno-eliminate-unused-debug-types

Fixes pr/11710.
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Resubmit after breaking Windows and OSX builds.

Reviewed By: dblaikie

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

3 years ago[mlir][Linalg] Allow distribution `scf.parallel` loops generated in
MaheshRavishankar [Mon, 10 Aug 2020 21:39:02 +0000 (14:39 -0700)]
[mlir][Linalg] Allow distribution `scf.parallel` loops generated in
Linalg to processors.

This changes adds infrastructure to distribute the loops generated in
Linalg to processors at the time of generation. This addresses use
case where the instantiation of loop is done just to distribute
them. The option to distribute is added to TilingOptions for now and
will allow specifying the distribution as a transformation option,
just like tiling and promotion are specified as options.

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

3 years ago[InstSimplify][test] Remove unused parameter in vscale.ll
Arthur Eubanks [Mon, 10 Aug 2020 20:55:45 +0000 (13:55 -0700)]
[InstSimplify][test] Remove unused parameter in vscale.ll

Reviewed By: huihuiz

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

3 years ago[Diagnostics] Move -Wstring-concatenation to -Wextra
Dávid Bolvanský [Mon, 10 Aug 2020 21:35:55 +0000 (23:35 +0200)]
[Diagnostics] Move -Wstring-concatenation to -Wextra

3 years ago[ARM] Speed up arm-cortex-cpus.c test
Artem Belevich [Sat, 8 Aug 2020 00:18:38 +0000 (17:18 -0700)]
[ARM] Speed up arm-cortex-cpus.c test

Trailing wildcard regex searches greedily continue searching through the whole
input and make the test unnecessarily slow.

Using equivalent plain text partial match speeds up the test execution time from
~35s to ~12s.

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

3 years ago[Diagnostics] Avoid false positives with -Wstring-concatenation
Dávid Bolvanský [Mon, 10 Aug 2020 21:04:20 +0000 (23:04 +0200)]
[Diagnostics] Avoid false positives with -Wstring-concatenation

3 years ago[MLIR] Adding gpu.host_register op and lower it to a runtime call.
Christian Sigg [Mon, 10 Aug 2020 08:13:57 +0000 (10:13 +0200)]
[MLIR] Adding gpu.host_register op and lower it to a runtime call.

Reviewed By: herhut

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

3 years ago[InstSimplify] Add test for expand binop undef issue (NFC)
Nikita Popov [Mon, 10 Aug 2020 20:39:07 +0000 (22:39 +0200)]
[InstSimplify] Add test for expand binop undef issue (NFC)

Add test case from https://reviews.llvm.org/D83360#2146539.

3 years ago[AIX] Try to not use LLVM tools while building runtimes
David Tenty [Mon, 10 Aug 2020 20:07:23 +0000 (16:07 -0400)]
[AIX] Try to not use LLVM tools while building runtimes

Since 64-bit XCOFF and the big AR format is not yet supported in some of these tools, this patch avoids additional setup of these tools. This patch is not intended to prevent picking up the LLVM tools if they happen to be available otherwise.

Reviewed By: hubert.reinterpretcast

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

3 years agoFix "last accessed time" test failing on Windows
Alexandre Ganea [Mon, 10 Aug 2020 20:03:03 +0000 (16:03 -0400)]
Fix "last accessed time" test failing on Windows

Before this patch, the tests in llvm/test/tools/llvm-objcopy/ELF/strip-preserve-atime.test used to fail on my machine, because the "last accessed time" is disabled in the OS by default since Windows XP. One needs to explicitly enable it for the feature to work. Otherwise the last access time is the last write time. Please see: https://superuser.com/questions/251263/the-last-access-date-is-not-changed-even-after-reading-the-file-on-windows-7

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

3 years ago[XCOFF][AIX] Use TE storage mapping class when large code model is enabled
jasonliu [Mon, 10 Aug 2020 19:35:50 +0000 (19:35 +0000)]
[XCOFF][AIX] Use TE storage mapping class when large code model is enabled

Summary:
Use TE SMC instead of TC SMC in large code model mode,
so that large code model TOC entries could get placed after all
the small code model TOC entries, which reduces the chance of TOC overflow.

Reviewed By: Xiangling_L

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

3 years ago[MachineOutliner][AArch64] WA for multiple stack fixup cases in MachineOutliner.
Puyan Lotfi [Mon, 10 Aug 2020 18:45:38 +0000 (14:45 -0400)]
[MachineOutliner][AArch64] WA for multiple stack fixup cases in MachineOutliner.

In cases where MachineOutliner candidates either are:

  * noreturn
  * have calls with no available LR or free regs
  * Don't use SP

we can end up hitting stack fixup code for the caller and the callee for
a FrameID of MachineOutlinerDefault. This triggers the assert:

  `assert(OF.FrameConstructionID != MachineOutlinerDefault &&
          "Can only fix up stack references once");`

in AArch64InstrInfo.cpp. This assert exists for now because a lot of the
fixup code is not tested to handle fixing up more than once and needs
some better checks and enhancements to avoid potentially generating
illegal code.

I've filed a Bugzilla report to track this until these cases are handled
by the AArch64 MachineOutliner: https://bugs.llvm.org/show_bug.cgi?id=46767

This diff detects cases that will cause these multiple stack fixups and
prune the Candidates from `RepeatedSequenceLocs`.

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

3 years ago[SampleFDO] Stop letting findCalleeFunctionSamples return unrelated profiles
Wei Mi [Mon, 10 Aug 2020 19:35:19 +0000 (12:35 -0700)]
[SampleFDO] Stop letting findCalleeFunctionSamples return unrelated profiles
for invoke instructions.

We see a warning of "No debug information found in function foo: Function
profile not used" in a case. The function foo is called by an invoke
instruction. It has no debug information because it has attribute((nodebug))
in the definition. It shouldn't have profile instance in the sample profile
but compiler thinks it does, that turns out to be a compiler bug in
findCalleeFunctionSamples. The bug is exposed when sample-profile-merge-inlinee
is enabled recently.

Currently in findCalleeFunctionSamples, CalleeName is unset and is empty for
invoke instruction. For empty CalleeName, findFunctionSamplesAt will treat
the call as an indirect call and will return any inline instance profile at
the same location as the instruction. That leads to a wrong profile being
returned to function foo.

The patch set CalleeName when the instruction is an invoke.

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

3 years ago[WebAssembly][ConstantFolding] Fold fp-to-int truncation intrinsics
Thomas Lively [Mon, 10 Aug 2020 19:40:05 +0000 (12:40 -0700)]
[WebAssembly][ConstantFolding] Fold fp-to-int truncation intrinsics

Constant fold both the trapping and saturating versions of the
WebAssembly truncation intrinsics. The tests are adapted from the
WebAssembly spec tests for the corresponding instructions.

Requested in PR46982.

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

3 years ago[MSAN RT] Use __sanitizer::mem_is_zero in __msan_test_shadow
Gui Andrade [Mon, 10 Aug 2020 19:03:40 +0000 (19:03 +0000)]
[MSAN RT] Use __sanitizer::mem_is_zero in __msan_test_shadow

The former function is particularly optimized for exactly the
use case we're interested in: an all-zero buffer.

This reduces the overhead of calling this function some 80% or
more. This is particularly for instrumenting code heavy with
string processing functions, like grep. An invocation of grep
with the pattern '[aeiou]k[aeiou]' has its runtime reduced by
~75% with this patch

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

3 years agoFix "CHECK-LABEL: @" typos in llvm/test/CodeGen/AArch64/sve-fixed-length-*.ll
Paul Walker [Mon, 10 Aug 2020 18:42:12 +0000 (19:42 +0100)]
Fix "CHECK-LABEL: @" typos in llvm/test/CodeGen/AArch64/sve-fixed-length-*.ll

3 years agoUnbundle KILL bundles in VirtRegRewriter
Stanislav Mekhanoshin [Fri, 7 Aug 2020 19:56:09 +0000 (12:56 -0700)]
Unbundle KILL bundles in VirtRegRewriter

SplitKit forms invalid COPY subreg bundles without a leading
BUNDLE instruction. That manifests itself in post-RA scheduler
counting instruction and asserting on "Instruction count mismatch".

The bundle shall be undone by VirtRegRewriter::expandCopyBundle(),
but it does not because VirtRegRewriter::handleIdentityCopy() can
turn COPY bundle into a KILL bundle.

Process KILLs as well.

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

3 years ago[flang] Avoid cascading error in subscript triplet
Tim Keith [Mon, 10 Aug 2020 18:44:04 +0000 (11:44 -0700)]
[flang] Avoid cascading error in subscript triplet

If a bound of a subscript triplet is present but fails to analyze
due to an error, return nullopt rather than returning a Triplet with
that bound missing. This is so we can distinguish an absent bound from
an erroneous one and avoid spurious errors.

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

3 years ago[flang] Fix edge case with Hollerith
peter klausler [Fri, 7 Aug 2020 23:44:08 +0000 (16:44 -0700)]
[flang] Fix edge case with Hollerith

To prevent mistokenization of CHARACTER*2HXY as a Hollerith
literal constant while allowing it in DATA A/2*2HXY/, there's
a little state that tracks whether a / has been seen earlier
in the same statement.  But it was being reset on each line,
not statement, so Hollerith in a DATA statement continuation
line was incorrectly tokenized.  Fixed.

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

3 years ago[lldb] tab completion for `platform target-install`
Gongyu Deng [Mon, 10 Aug 2020 18:10:18 +0000 (20:10 +0200)]
[lldb] tab completion for `platform target-install`

1. Applied the common completion `eDiskFileCompletion` to the first argument of
the command `platform target-install`.
2. Added a related test case.

Reviewed By: teemperor

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

3 years agoAMDGPU: Fix assertion in performSHLPtrCombine for 64-bit pointers
Matt Arsenault [Mon, 10 Aug 2020 16:27:52 +0000 (12:27 -0400)]
AMDGPU: Fix assertion in performSHLPtrCombine for 64-bit pointers

3 years agoAMDGPU: Fix visiting physreg dest users when folding immediate copies
Matt Arsenault [Sun, 9 Aug 2020 00:28:48 +0000 (20:28 -0400)]
AMDGPU: Fix visiting physreg dest users when folding immediate copies

This can fold the immediate into the physical destination, but this
should not look for further users of the register. Fixes regression
introduced by 766cb615a3b96025192707f4670cdf171da84034.

3 years agoRe-Re-land: [CodeView] Add full repro to LF_BUILDINFO record
Alexandre Ganea [Mon, 10 Aug 2020 17:36:20 +0000 (13:36 -0400)]
Re-Re-land: [CodeView] Add full repro to LF_BUILDINFO record

This patch adds the missing information to the LF_BUILDINFO record, which allows for rebuilding a .CPP without any external dependency but the .OBJ itself (other than the compiler).

Some external tools that we are using (Recode, Live++) are extracting the information to reproduce a build without any knowledge of the build system. The LF_BUILDINFO stores a full path to the compiler, the PWD (CWD at program startup), a relative or absolute path to the TU, and the full CC1 command line. The command line needs to be freestanding (not depend on any environment variables). In the same way, MSVC doesn't store the provided command-line, but an expanded version (somehow their equivalent of CC1) which is also freestanding.

For more information see PR36198 and D43002.

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

3 years ago[BreakFalseDeps][X86] Move operand loop out of X86's getUndefRegClearance and put...
Craig Topper [Mon, 10 Aug 2020 17:32:29 +0000 (10:32 -0700)]
[BreakFalseDeps][X86] Move operand loop out of X86's getUndefRegClearance and put in the pass.

X86 is the only user of this interface in tree. Previously the
X86 pass would loop over operands looking for one undef operand for
the pass to fix. But there could theoretically be multiple operands
to fix. So it makes more sense for the pass to do the looping and
ask the target if an operand needs to be fixed.

3 years ago[MLIR] Make gpu.launch_func rewrite pattern part of the LLVM lowering pass.
Christian Sigg [Sat, 1 Aug 2020 14:40:21 +0000 (16:40 +0200)]
[MLIR] Make gpu.launch_func rewrite pattern part of the LLVM lowering pass.

Reviewed By: herhut

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

3 years ago[clangd] Have template template arguments target their referenced template decl
Nathan Ridge [Mon, 10 Aug 2020 00:37:43 +0000 (20:37 -0400)]
[clangd] Have template template arguments target their referenced template decl

Fixes https://github.com/clangd/clangd/issues/473

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

3 years ago[WebAssembly] wasm64: fix memory.init operand types
Wouter van Oortmerssen [Fri, 7 Aug 2020 20:24:43 +0000 (13:24 -0700)]
[WebAssembly] wasm64: fix memory.init operand types

I had assumed they would all become in i64, but this is not necessary as long as data segments stay 32-bit, see:
https://github.com/WebAssembly/memory64/blob/master/proposals/memory64/Overview.md

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

3 years ago[ELF] Avoid creating a 2.1GB output file in arm-exidx-range.s
Alex Richardson [Mon, 10 Aug 2020 17:07:40 +0000 (18:07 +0100)]
[ELF] Avoid creating a 2.1GB output file in arm-exidx-range.s

Currently both sections will be placed in the same PT_LOAD and therefore
lld generates a contiguous output file containing both sections.
By using AT(0xffff0000) the .vectors is placed a separate PT_LOAD and the
resulting file is now only a few kilobytes.

Reviewed By: psmith

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

3 years ago[MLIR][TableGen] Fix ambiguous build methods when inferring result types.
Rahul Joshi [Fri, 7 Aug 2020 21:02:19 +0000 (14:02 -0700)]
[MLIR][TableGen] Fix ambiguous build methods when inferring result types.

- Fix ODS framework to suppress build methods that infer result types and are
  ambiguous with collective variants. This applies to operations with a single variadic
  inputs whose result types can be inferred.
- Extended OpBuildGenTest to test these kinds of ops.

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

3 years ago[lldb] Skip TestSimulatorPlatform with out-of-tree debugserver
Jonas Devlieghere [Mon, 10 Aug 2020 17:00:02 +0000 (10:00 -0700)]
[lldb] Skip TestSimulatorPlatform with out-of-tree debugserver

3 years ago[mlir][spirv] Add OpGroupBroadcast
Artur Bialas [Mon, 10 Aug 2020 16:39:27 +0000 (09:39 -0700)]
[mlir][spirv] Add OpGroupBroadcast

OpGroupBroadcast added to SPIRV dialect

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

3 years ago[clangd] Fix crash-bug in preamble indexing when using modules.
Adam Czachorowski [Mon, 25 May 2020 12:43:43 +0000 (14:43 +0200)]
[clangd] Fix crash-bug in preamble indexing when using modules.

Summary:
When preamble contains #undef, indexing code finds the matching #define
and uses that during indexing. However, it would only look for local
definitions. If the macro was defined in a module, MacroInfo
would be nullptr and clangd would crash.

This change makes clangd ignore any #undef without a matching #define
inside the same TU.

The indexing of macros happens for preamble only, so then #undef must be
in the preamble, which is why we need two .h files in a test.

Note that clangd is currently not ready for module support, but this
brings us one step closer.

Reviewers: sammccall

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

Tags: #clang

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

3 years ago[lldb] Fix NSArray0 data formatter and add test
Jonas Devlieghere [Mon, 10 Aug 2020 16:38:14 +0000 (09:38 -0700)]
[lldb] Fix NSArray0 data formatter and add test

Fixes PR47089