platform/upstream/llvm.git
4 years ago[GlobalISel] Implement bit-test switch table optimization.
Amara Emerson [Tue, 4 Aug 2020 17:55:27 +0000 (10:55 -0700)]
[GlobalISel] Implement bit-test switch table optimization.

This is mostly a straight port from SelectionDAG. We re-use the actual bit-test
analysis part from SwitchLoweringUtils, which was factored out earlier to
support jump-tables.

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

4 years agoFix signed/unsigned comparison warnings. NFC.
Simon Pilgrim [Wed, 12 Aug 2020 18:22:13 +0000 (19:22 +0100)]
Fix signed/unsigned comparison warnings. NFC.

4 years agoRecommit "[InstSimplify] Remove select ?, undef, X -> X and select ?, X, undef -...
Craig Topper [Wed, 12 Aug 2020 17:40:41 +0000 (10:40 -0700)]
Recommit "[InstSimplify] Remove select ?, undef, X -> X and select ?, X, undef -> X transforms" and its follow up patches

This recommits the following patches now that D85684 has landed

1cf6f210a2e [IR] Disable select ? C : undef -> C fold in ConstantFoldSelectInstruction unless we know C isn't poison.
469da663f2d [InstSimplify] Re-enable select ?, undef, X -> X transform when X is provably not poison
122b0640fc9 [InstSimplify] Don't fold vectors of partial undef in SimplifySelectInst if the non-undef element value might produce poison
ac0af12ed2f [InstSimplify] Add test cases for opportunities to fold select ?, X, undef -> X when we can prove X isn't poison
9b1e95329af [InstSimplify] Remove select ?, undef, X -> X and select ?, X, undef -> X transforms

4 years ago[SVE] Remove default-false VectorType::get
Christopher Tetreault [Wed, 12 Aug 2020 16:45:28 +0000 (09:45 -0700)]
[SVE] Remove default-false VectorType::get

Reviewed By: efriedma

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

4 years ago[Scheduler] Fix typo in comments. NFC
David Green [Wed, 12 Aug 2020 17:36:05 +0000 (18:36 +0100)]
[Scheduler] Fix typo in comments. NFC

4 years ago[ARM] Predicated VFMA patterns
David Green [Wed, 12 Aug 2020 13:22:27 +0000 (14:22 +0100)]
[ARM] Predicated VFMA patterns

Similar to the Two op + select patterns that were added recently, this
adds some patterns for select + fma to turn them into predicated
operations.

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

4 years ago[X86][SSE] Pull out BUILD_VECTOR operand equivalence tests. NFC.
Simon Pilgrim [Wed, 12 Aug 2020 16:41:09 +0000 (17:41 +0100)]
[X86][SSE] Pull out BUILD_VECTOR operand equivalence tests. NFC.

Pull out element equivalence code from isShuffleEquivalent/isTargetShuffleEquivalent, I've also removed many of the index modulos where possible.

First step toward simply adding some additional equivalence tests.

4 years ago[X86][GlobalISel] Legalize G_ICMP results to s8.
Craig Topper [Wed, 12 Aug 2020 17:03:10 +0000 (10:03 -0700)]
[X86][GlobalISel] Legalize G_ICMP results to s8.

We need to produce a setcc instruction which has an 8-bit result.
This gets rid of a bunch of cases that were using the s1->s8/s16/s32/s64
handling in selectZExt.

I'm not very familiar with GlobalISel yet so I'm not yet sure
the best way to do things. I'd especially like feedback on the
best way to handle the currently split 32-bit and 64-bit mode
handling.

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

4 years agoFix sigaction interceptor to always correctly populate oldact
Matt Morehouse [Wed, 12 Aug 2020 16:19:25 +0000 (09:19 -0700)]
Fix sigaction interceptor to always correctly populate oldact

This fixes https://bugs.llvm.org/show_bug.cgi?id=47118. Before this change, when the sigaction interceptor prevented a signal from being changed, it also prevented the oldact output parameter from being written to. This resulted in a use-of-uninitialized-variable by any program that used sigaction for the purpose of reading signals.

This change fixes this: the regular sigaction implementation is still called, but with the act parameter nullified, preventing any changes.

Patch By: IanPudney

Reviewed By: morehouse

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

4 years ago[SVE] Lower fixed length FP minnum/maxnum
Cameron McInally [Wed, 12 Aug 2020 17:00:37 +0000 (12:00 -0500)]
[SVE] Lower fixed length FP minnum/maxnum

Lower fixed length MINNUM/MAXNUM to scalable vectors. Cherry-picked from D71767 with added tests.

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

4 years ago[UpdateTestChecks][FIX] Python 2.7 compatibility and use right prefix
Johannes Doerfert [Wed, 12 Aug 2020 16:56:55 +0000 (11:56 -0500)]
[UpdateTestChecks][FIX] Python 2.7 compatibility and use right prefix

4 years ago[SanitizerCoverage] Use zeroext for cmp parameters on all targets
Ilya Leoshkevich [Wed, 12 Aug 2020 16:37:28 +0000 (18:37 +0200)]
[SanitizerCoverage] Use zeroext for cmp parameters on all targets

Commit 9385aaa84851 ("[sancov] Fix PR33732") added zeroext to
__sanitizer_cov_trace(_const)?_cmp[1248] parameters for x86_64 only,
however, it is useful on other targets, in particular, on SystemZ: it
fixes swap-cmp.test.

Therefore, use it on all targets. This is safe: if target ABI does not
require zero extension for a particular parameter, zeroext is simply
ignored. A similar change has been implemeted as part of commit
3bc439bdff8b ("[MSan] Add instrumentation for SystemZ"), and there were
no problems with it.

Reviewed By: morehouse

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

4 years ago[Driver] Change -fnostack-clash-protection to -fno-stack-clash-protection
Dávid Bolvanský [Wed, 12 Aug 2020 16:36:06 +0000 (18:36 +0200)]
[Driver] Change -fnostack-clash-protection to  -fno-stack-clash-protection

Clang command line docs mention `-fno-stack-clash-protection`, and GCC also uses  -fno-stack-clash-protection.

Fixes PR47139

Reviewed By: tstellar

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

4 years ago[mlir] Added support for Index type inside getZeroAttr function
Jakub Lichman [Wed, 12 Aug 2020 13:07:28 +0000 (13:07 +0000)]
[mlir] Added support for Index type inside getZeroAttr function

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

4 years ago[clang-tidy] use stable_sort instead of sort to fix EXPENSIVE_CHECKS tests
Erik Pilkington [Wed, 12 Aug 2020 15:51:52 +0000 (11:51 -0400)]
[clang-tidy] use stable_sort instead of sort to fix EXPENSIVE_CHECKS tests

http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/17317/console

4 years ago[AMDGPU][test] Add dedicated llvm-readobj test.
Stanislav Mekhanoshin [Mon, 10 Aug 2020 19:57:12 +0000 (12:57 -0700)]
[AMDGPU][test] Add dedicated llvm-readobj test.

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

4 years ago[OPENMP] Fix PR47063: crash when trying to get captured statetment.
Alexey Bataev [Wed, 12 Aug 2020 15:48:53 +0000 (11:48 -0400)]
[OPENMP] Fix PR47063: crash when trying to get captured statetment.

Need to call getRawStmt() function instead, when trying to get inner
associated statement for the executable directive. Not all directives
use captured statements.

4 years ago[libc++] Remove workarounds for missing rvalue references
Louis Dionne [Thu, 30 Jul 2020 13:42:23 +0000 (09:42 -0400)]
[libc++] Remove workarounds for missing rvalue references

We don't support GCC in C++03 mode, and Clang provides rvalue references
even in C++03 mode. So there's effectively no supported compiler that
doesn't support rvalue references.

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

4 years ago[mlir][linalg][NFC] Remove extra semi-colon causing warnings
Valentin Clement [Wed, 12 Aug 2020 15:44:00 +0000 (11:44 -0400)]
[mlir][linalg][NFC] Remove extra semi-colon causing warnings

Extra semi-colon causes bunch of warnings with GCC 9.2.0

```
[1354/1516] Building CXX object tools/mlir/lib/Dialect/Linalg/IR/CMakeFiles/obj.MLIRLinalgOps.dir/LinalgOps.cpp.o
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1306:35: warning: extra ';' [-Wpedantic]
 1306 | CANONICALIZERS_AND_FOLDERS(ConvOp);
      |                                   ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1307:41: warning: extra ';' [-Wpedantic]
 1307 | CANONICALIZERS_AND_FOLDERS(PoolingMaxOp);
      |                                         ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1308:41: warning: extra ';' [-Wpedantic]
 1308 | CANONICALIZERS_AND_FOLDERS(PoolingMinOp);
      |                                         ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1309:41: warning: extra ';' [-Wpedantic]
 1309 | CANONICALIZERS_AND_FOLDERS(PoolingSumOp);
      |                                         ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1310:35: warning: extra ';' [-Wpedantic]
 1310 | CANONICALIZERS_AND_FOLDERS(CopyOp);
      |                                   ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1311:35: warning: extra ';' [-Wpedantic]
 1311 | CANONICALIZERS_AND_FOLDERS(FillOp);
      |                                   ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1312:38: warning: extra ';' [-Wpedantic]
 1312 | CANONICALIZERS_AND_FOLDERS(GenericOp);
      |                                      ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1313:45: warning: extra ';' [-Wpedantic]
 1313 | CANONICALIZERS_AND_FOLDERS(IndexedGenericOp);
      |                                             ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1318:42: warning: extra ';' [-Wpedantic]
 1318 | CANONICALIZERS_AND_FOLDERS(BatchMatmulOp);
      |                                          ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1319:34: warning: extra ';' [-Wpedantic]
 1319 | CANONICALIZERS_AND_FOLDERS(DotOp);
      |                                  ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1320:37: warning: extra ';' [-Wpedantic]
 1320 | CANONICALIZERS_AND_FOLDERS(MatmulOp);
      |                                     ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1321:37: warning: extra ';' [-Wpedantic]
 1321 | CANONICALIZERS_AND_FOLDERS(MatvecOp);
      |                                     ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1322:36: warning: extra ';' [-Wpedantic]
 1322 | CANONICALIZERS_AND_FOLDERS(ConvWOp);
      |                                    ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1323:38: warning: extra ';' [-Wpedantic]
 1323 | CANONICALIZERS_AND_FOLDERS(ConvNWCOp);
      |                                      ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1324:38: warning: extra ';' [-Wpedantic]
 1324 | CANONICALIZERS_AND_FOLDERS(ConvNCWOp);
      |                                      ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1325:37: warning: extra ';' [-Wpedantic]
 1325 | CANONICALIZERS_AND_FOLDERS(ConvHWOp);
      |                                     ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1326:39: warning: extra ';' [-Wpedantic]
 1326 | CANONICALIZERS_AND_FOLDERS(ConvNHWCOp);
      |                                       ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1327:39: warning: extra ';' [-Wpedantic]
 1327 | CANONICALIZERS_AND_FOLDERS(ConvNCHWOp);
      |                                       ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1328:38: warning: extra ';' [-Wpedantic]
 1328 | CANONICALIZERS_AND_FOLDERS(ConvDHWOp);
      |                                      ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1329:40: warning: extra ';' [-Wpedantic]
 1329 | CANONICALIZERS_AND_FOLDERS(ConvNDHWCOp);
      |                                        ^
/home/4vn/versioning/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:1330:40: warning: extra ';' [-Wpedantic]
 1330 | CANONICALIZERS_AND_FOLDERS(ConvNCDHWOp);
      |                                        ^
```

Reviewed By: mehdi_amini, rriddle

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

4 years ago[OPENMP]Fix PR37671: Privatize local(private) variables in untied tasks.
Alexey Bataev [Wed, 12 Aug 2020 14:54:36 +0000 (10:54 -0400)]
[OPENMP]Fix PR37671: Privatize local(private) variables in untied tasks.

In untied tasks, need to allocate the space for local variales, declared
in task region, when the memory for task data is allocated. THe function
can be interrupted and we can exit from the function in untied task
switch. Need to keep the state of the local variables in this case.
Also, the compiler should not call cleanup when exiting in untied task
switch until the real exit out of the declaration scope is met during
 execution.

Reviewed By: jdoerfert

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

4 years ago[OpenCL] Remove warning for variadic macros in C++ for OpenCL.
Anastasia Stulova [Wed, 12 Aug 2020 09:01:46 +0000 (10:01 +0100)]
[OpenCL] Remove warning for variadic macros in C++ for OpenCL.

Patch by Ole Strohm (olestrohm)!

Tags: #clang

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

4 years ago[Hexagon] Return scalar size in getMinVectorRegisterBitWidth() when no HVX
Krzysztof Parzyszek [Wed, 12 Aug 2020 15:11:12 +0000 (10:11 -0500)]
[Hexagon] Return scalar size in getMinVectorRegisterBitWidth() when no HVX

This fixes https://llvm.org/PR47128.

4 years ago[ARM][MVE] Enable tail predication for loops containing MVE gather/scatters
Anna Welker [Wed, 12 Aug 2020 12:44:18 +0000 (13:44 +0100)]
[ARM][MVE] Enable tail predication for loops containing MVE gather/scatters

Widen the scope of memory operations that are allowed to be tail predicated
to include gathers and scatters, such that loops that are auto-vectorized
with the option -enable-arm-maskedgatscat (and actually end up containing
an MVE gather or scatter) can be tail predicated.

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

4 years ago[analyzer] StdLibraryFunctionsChecker: Add support for new functions
Zurab Tsinadze [Wed, 12 Aug 2020 14:18:42 +0000 (16:18 +0200)]
[analyzer] StdLibraryFunctionsChecker: Add support for new functions

`toupper`, `tolower`, `toascii` functions were added to
StdLibraryFunctionsChecker to fully cover CERT STR37-C rule:
https://wiki.sei.cmu.edu/confluence/x/BNcxBQ

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

4 years ago[OPENMP]Do not add TGT_OMP_TARGET_PARAM flag to non-captured mapped arguments.
Alexey Bataev [Tue, 11 Aug 2020 16:30:45 +0000 (12:30 -0400)]
[OPENMP]Do not add TGT_OMP_TARGET_PARAM flag to non-captured mapped arguments.

If the arguments are mapped, but are actually not used in the target
region, the compiler still adds attribute TGT_OMP_TARGET_PARAM for such
arguments. It makes the libomptarget to add such parameters to the list
of arguments, passed to the kernel at the runtime, and may lead to
incorrect results/crashes during execution.

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

4 years agoAMDGPU/GlobalISel: Select llvm.amdgcn.global.atomic.fadd
Matt Arsenault [Thu, 6 Aug 2020 03:21:16 +0000 (23:21 -0400)]
AMDGPU/GlobalISel: Select llvm.amdgcn.global.atomic.fadd

Remove the intermediate transform in the DAG path. I believe this is
the last non-deprecated intrinsic that needs handling.

4 years agoAMDGPU: Handle intrinsics in performMemSDNodeCombine
Matt Arsenault [Mon, 10 Aug 2020 16:25:48 +0000 (12:25 -0400)]
AMDGPU: Handle intrinsics in performMemSDNodeCombine

This avoids a possible regression in a future patch

4 years agoRevert "[OPENMP]Fix PR37671: Privatize local(private) variables in untied tasks."
Alexey Bataev [Wed, 12 Aug 2020 13:49:59 +0000 (09:49 -0400)]
Revert "[OPENMP]Fix PR37671: Privatize local(private) variables in untied tasks."

This reverts commit ec9563c54ed25e9f9cbe60985399212d50bd801d to
investigate compiler crash revelaed by the buildbots.

4 years ago[DWARFYAML] Make the address size of compilation units optional.
Xing GUO [Wed, 12 Aug 2020 13:47:27 +0000 (21:47 +0800)]
[DWARFYAML] Make the address size of compilation units optional.

This patch makes the 'AddrSize' field optional. If the address size is
missing, yaml2obj will infer it from the object file.

Reviewed By: jhenderson

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

4 years ago[MachOYAML] Simplify the section data emitting function. NFC.
Xing GUO [Wed, 12 Aug 2020 13:44:56 +0000 (21:44 +0800)]
[MachOYAML] Simplify the section data emitting function. NFC.

This patch helps simplify some codes in writeSectionData() function.

Reviewed By: jhenderson, grimar

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

4 years ago[OPENMP]Fix PR37671: Privatize local(private) variables in untied tasks.
Alexey Bataev [Tue, 21 Jul 2020 19:20:16 +0000 (15:20 -0400)]
[OPENMP]Fix PR37671: Privatize local(private) variables in untied tasks.

Summary:
In untied tasks, need to allocate the space for local variales, declared
in task region, when the memory for task data is allocated. THe function
can be interrupted and we can exit from the function in untied task
switch. Need to keep the state of the local variables in this case.
Also, the compiler should not call cleanup when exiting in untied task
switch until the real exit out of the declaration scope is met during
 execution.

Reviewers: jdoerfert

Subscribers: yaxunl, guansong, cfe-commits, sstefan1, caomhin

Tags: #clang

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

4 years agoLimit Max Vector alignment on COFF targets to 8192.
Erich Keane [Fri, 7 Aug 2020 19:05:24 +0000 (12:05 -0700)]
Limit Max Vector alignment on COFF targets to 8192.

COFF targets have a max object alignment of 8192, so trying to create
one with a larger size results in an unreachable in WinCOFFObjectWriter.

For the reproducer I have uses thread local storage, however other
alignments are likely affected as well.

This patch sets the MaxVectorAlign for COFF to 8192.  Additionally,
though there is no longer a way to reproduce that I could find, it
correctly sets the MaxTLSAlign for COFF to that value as well, so that
if anyone comes up with a situation where this is true, it will cause an
error.

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

4 years ago[VectorCombine] early exit if target has no vector registers
Sanjay Patel [Wed, 12 Aug 2020 13:20:59 +0000 (09:20 -0400)]
[VectorCombine] early exit if target has no vector registers

Based on post-commit discussion in:
D81766

Other vectorization passes (SLP and Loop) use this TTI API similarly.

4 years ago[VectorCombine] add test for x86 target with SSE disabled; NFC
Sanjay Patel [Wed, 12 Aug 2020 13:15:11 +0000 (09:15 -0400)]
[VectorCombine] add test for x86 target with SSE disabled; NFC

4 years ago[ARM] Add additional predicated VFMA tests. NFC
David Green [Wed, 12 Aug 2020 13:20:20 +0000 (14:20 +0100)]
[ARM] Add additional predicated VFMA tests. NFC

4 years ago[InstCombine] eliminate a pointer cast around insertelement
Sanjay Patel [Wed, 12 Aug 2020 13:08:17 +0000 (09:08 -0400)]
[InstCombine] eliminate a pointer cast around insertelement

I'm not sure if this solves PR46839 completely, but reducing the casting should help:
https://bugs.llvm.org/show_bug.cgi?id=46839

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

4 years ago[VectorCombine] add test for Hexagon that would crash; NFC
Sanjay Patel [Wed, 12 Aug 2020 12:36:02 +0000 (08:36 -0400)]
[VectorCombine] add test for Hexagon that would crash; NFC

This test verifies the code change from:
rGb0b95dab1ce2
(although that would not be true if PR47128 is fixed)

4 years ago[SystemZ/ZOS] Implement computeHostNumPhysicalCores
Kai Nacke [Tue, 28 Jul 2020 08:33:50 +0000 (10:33 +0200)]
[SystemZ/ZOS] Implement computeHostNumPhysicalCores

On z/OS, the information is stored in the Common System Data Area
(CSD). It is the number of CPs allocated to the current LPAR.

Reviewers: aganea, hubert.reinterpertcast, MaskRay

Reviewed By: hubert.reinterpertcast

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

4 years ago[LoopUnroll] Adjust CostKind query
Sam Parker [Tue, 11 Aug 2020 13:19:35 +0000 (14:19 +0100)]
[LoopUnroll] Adjust CostKind query

When TTI was updated to use an explicit cost, TCK_CodeSize was used
although the default implicit cost would have been the hand-wavey
cost of size and latency. So, revert back to this behaviour. This is
not expected to have (much) impact on targets since most (all?) of
them return the same value for SizeAndLatency and CodeSize.

When optimising for size, the logic has been changed to query
CodeSize costs instead of SizeAndLatency.

This patch also adds a testing option in the unroller so that
OptSize thresholds can be specified.

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

4 years agoRevert "[lldb] Display autosuggestion part in gray if there is one possible suggestion"
Raphael Isemann [Wed, 12 Aug 2020 11:52:03 +0000 (13:52 +0200)]
Revert "[lldb] Display autosuggestion part in gray if there is one possible suggestion"

This reverts commit 246afe0cd17fce935a01171f3cca548e02523e5c. This broke
the following tests on Linux it seems:
  lldb-api :: commands/expression/multiline-completion/TestMultilineCompletion.py
  lldb-api :: iohandler/completion/TestIOHandlerCompletion.py

4 years ago[ARM] Commutative vmin/maxnma tests. NFC
David Green [Wed, 12 Aug 2020 11:50:18 +0000 (12:50 +0100)]
[ARM] Commutative vmin/maxnma tests. NFC

4 years ago[clang-tidy] prevent generated checks from triggering assertions on anonymous functions
Bogdan Serea [Tue, 11 Aug 2020 13:41:48 +0000 (14:41 +0100)]
[clang-tidy] prevent generated checks from triggering assertions on anonymous functions

Skeleton checks generated by clang-tidy add_check.py cause assertions to fail when run over anonymous functions(lambda functions). This patch introduces an additional check to verify that the target function is not anonymous before calling getName().
The code snippet from the [[ https://clang.llvm.org/extra/clang-tidy/Contributing.html | clang-tidy tutorial  ]]is also updated.

Reviewed By: alexfh, DavidTruby

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

4 years ago[X86][SSE] Fold HOP(SHUFFLE(X),SHUFFLE(Y)) --> SHUFFLE(HOP(X,Y))
Simon Pilgrim [Wed, 12 Aug 2020 11:11:08 +0000 (12:11 +0100)]
[X86][SSE] Fold HOP(SHUFFLE(X),SHUFFLE(Y)) --> SHUFFLE(HOP(X,Y))

This is beginning to look like a canonicalization stage that could be performed as part of shuffle combining

Another step towards PR41813

4 years ago[lldb] Display autosuggestion part in gray if there is one possible suggestion
Shu Anzai [Wed, 12 Aug 2020 10:54:28 +0000 (12:54 +0200)]
[lldb] Display autosuggestion part in gray if there is one possible suggestion

I implemented autosuggestion if there is one possible suggestion.
I set the keybinds for every character. When a character is typed, Editline::TypedCharacter is called.
Then, autosuggestion part is displayed in gray, and you can actually input by typing C-k.
Editline::Autosuggest is a function for finding completion, and it is like Editline::TabCommand now, but I will add more features to it.

Testing does not work well in my environment, so I can't confirm that it goes well, sorry. I am dealing with it now.

Reviewed By: teemperor, JDevlieghere, #lldb

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

4 years ago[mlir] Expose printing functions in C API
Alex Zinenko [Tue, 11 Aug 2020 16:25:09 +0000 (18:25 +0200)]
[mlir] Expose printing functions in C API

Provide printing functions for most IR objects in C API (except Region that
does not have a `print` function, and Module that is expected to be printed as
Operation instead). The printing is based on a callback that is called with
chunks of the string representation and forwarded user-defined data.

Reviewed By: stellaraccident, Jing, mehdi_amini

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

4 years ago[llvm-readobj] - Refine logic of the symbol table locating in printRelocationsHelper().
Georgii Rymar [Thu, 6 Aug 2020 12:42:39 +0000 (15:42 +0300)]
[llvm-readobj] - Refine logic of the symbol table locating in printRelocationsHelper().

This removes the last `unwrapOrError` call from the `printRelocationsHelper`.

There is a little additional complexity because of `SHT_RELR/SHT_ANDROID_RELR` sections.
Such sections contains only relative relocations and they do not have a
symbol table associated with them, hence we should not try to treat
their `sh_link` field as a reference to a symbol table.

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

4 years ago[X86][AVX] Fold CONCAT(HOP(X,Y),HOP(Z,W)) -> HOP(CONCAT(X,Z),CONCAT(Y,W)) for float...
Simon Pilgrim [Wed, 12 Aug 2020 10:21:20 +0000 (11:21 +0100)]
[X86][AVX] Fold CONCAT(HOP(X,Y),HOP(Z,W)) -> HOP(CONCAT(X,Z),CONCAT(Y,W)) for float types

Only do this for AVX2+ targets as we still get some regressions on AVX1 without PERMPD/PERMQ

4 years ago[lldb] Add support for checking children in expect_expr
Raphael Isemann [Wed, 12 Aug 2020 09:27:21 +0000 (11:27 +0200)]
[lldb] Add support for checking children in expect_expr

expect_expr currently can't verify the children of the result SBValue.

This patch adds the ability to check them. The idea is to have a CheckValue
class where one can specify what attributes of a SBValue should be checked.
Beside the properties we already check for (summary, type, etc.) this also
has a list of children which is again just a list of CheckValue object (which
can also have children of their own).

The main motivation is to make checking the children no longer based
on error-prone substring checks that allow tests to pass just because
for example the error message contains the expected substrings by accident.

I also expect that we can just have a variant of `expect_expr` for LLDB's
expression paths (aka 'frame var') feature.

Reviewed By: labath

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

4 years ago[Transforms][SROA] Skip uses of allocas where the type is scalable
Cullen Rhodes [Tue, 11 Aug 2020 11:51:24 +0000 (11:51 +0000)]
[Transforms][SROA] Skip uses of allocas where the type is scalable

When visiting load and store instructions in SROA skip scalable vectors.
This is relevant in the implementation of the 'arm_sve_vector_bits'
attribute that is used to define VLS types, where an alloca of a
fixed-length vector could be bitcasted to scalable. See D85128 for more
information.

Reviewed By: efriedma

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

4 years agoAdd missing dependency on Doc generation for the OpenMP dialect
Mehdi Amini [Wed, 12 Aug 2020 09:11:32 +0000 (09:11 +0000)]
Add missing dependency on Doc generation for the OpenMP dialect

This is fixing the bot building the MLIR website.

4 years ago[mlir] use intptr_t in C API
Alex Zinenko [Tue, 11 Aug 2020 16:34:32 +0000 (18:34 +0200)]
[mlir] use intptr_t in C API

Using intptr_t is a consensus for MLIR C API, but the change was missing
from 75f239e9756b (that was using unsigned initially) due to a
misrebase.

Reviewed By: stellaraccident, mehdi_amini

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

4 years ago[SCEV] Look through single value PHIs.
Florian Hahn [Wed, 12 Aug 2020 07:46:07 +0000 (08:46 +0100)]
[SCEV] Look through single value PHIs.

Now that SCEVExpander can preserve LCSSA form,
we do not have to worry about LCSSA form when
trying to look through PHIs. SCEVExpander will take
care of inserting LCSSA PHI nodes as required.

This increases precision of the analysis in some cases.

Reviewed By: mkazantsev, bmahjour

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

4 years ago[llvm-dwarfdump] Avoid crashing if an abbreviation offset is invalid.
Igor Kudrin [Wed, 12 Aug 2020 08:37:16 +0000 (15:37 +0700)]
[llvm-dwarfdump] Avoid crashing if an abbreviation offset is invalid.

Note that DWARFUnit::getAbbreviations() returns nullptr if the
abbreviations could not be read, but callers used the returned
pointer without checking.

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

4 years ago[ARM][MVE] tail-predication: overflow checks for backedge taken count.
Sjoerd Meijer [Tue, 11 Aug 2020 14:48:29 +0000 (15:48 +0100)]
[ARM][MVE] tail-predication: overflow checks for backedge taken count.

This pick ups the work on the overflow checks for get.active.lane.mask,
which ensure that it is safe to insert the VCTP intrinisc that enables
tail-predication. For a 2d auto-correlation kernel and its inner loop j:

  M = Size - i;
  for (j = 0; j < M; j++)
    Sum += Input[j] * Input[j+i];

For this inner loop, the SCEV backedge taken count (BTC) expression is:

  (-1 + (sext i16 %Size to i32)),+,-1}<nw><%for.body>

and LoopUtil cannotBeMaxInLoop couldn't calculate a bound on this, thus "BTC
cannot be max" could not be determined. So overflow behaviour had to be assumed
in the loop tripcount expression that uses the BTC. As a result
tail-predication had to be forced (with an option) for this case.

This change solves that by using ScalarEvolution's helper
getConstantMaxBackedgeTakenCount which is able to determine the range of BTC,
thus can determine it is safe, so that we no longer need to force tail-predication
as reflected in the changed test cases.

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

4 years ago[SyntaxTree] Unbox operators into tokens for nodes generated from `CXXOperatorCallExpr`
Eduardo Caldas [Tue, 11 Aug 2020 16:28:00 +0000 (16:28 +0000)]
[SyntaxTree] Unbox operators into tokens for nodes generated from `CXXOperatorCallExpr`

For an user define `<`, `x < y` would yield the syntax tree:
```
BinaryOperatorExpression
|-IdExpression
| `-UnqualifiedId
|   `-x
|-IdExpression
| `-UnqualifiedId
|   `-<
`-IdExpression
  `-UnqualifiedId
    `-y
```
But there is no syntatic difference at call site between call site or
built-in `<`. As such they should generate the same syntax tree, namely:
```
BinaryOperatorExpression
|-IdExpression
| `-UnqualifiedId
|   `-x
|-<
`-IdExpression
  `-UnqualifiedId
    `-y
```

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

4 years ago[SVE][CodeGen] Fix issues with EXTRACT_SUBVECTOR when using scalable FP vectors
David Sherwood [Fri, 7 Aug 2020 10:45:25 +0000 (11:45 +0100)]
[SVE][CodeGen] Fix issues with EXTRACT_SUBVECTOR when using scalable FP vectors

In this patch I have fixed two issues:

1. Our SVE tuple get/set intrinsics were using the wrong constant type
for the index passed to EXTRACT_SUBVECTOR. I have fixed this by using the
function SelectionDAG::getVectorIdxConstant to create the value. Also, I
have updated the documentation for EXTRACT_SUBVECTOR describing what type
the constant index should be and we now enforce this when creating the
node.
2. The AArch64 backend was missing the appropriate patterns for
extracting certain subvectors (nxv4f16 and nxv2f32) from legal SVE types.
I have added them as part of this patch.

The only way that I could find to test the new patterns was to use the
SVE tuple get intrinsics, although I realise it looks a bit unusual.
Tests added here:

  test/CodeGen/AArch64/sve-extract-subvector.ll

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

4 years ago[VE] Change to promote i32 AND/OR/XOR operations
Kazushi (Jam) Marukawa [Tue, 11 Aug 2020 12:37:12 +0000 (21:37 +0900)]
[VE] Change to promote i32 AND/OR/XOR operations

VE has only 64 bits AND/OR/XOR instructions.  We pretended that VE has 32 bits
instructions also, but doing it increase the number of generated instructions.
Therefore, we decide to promote 32 bits operations and use only 64 bits
instructions in back end.  We also avoid pretending that VE has 32 bits LEA
instruction.  Update regression tests also.

Reviewed By: simoll

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

4 years ago[libc][obvious] Switch copysign[f|l] and fabs[f|l] to the new test matchers.
Siva Chandra [Wed, 12 Aug 2020 06:54:00 +0000 (23:54 -0700)]
[libc][obvious] Switch copysign[f|l] and fabs[f|l] to the new test matchers.

4 years ago[AST] Fix the CXXFoldExpr source range when parentheses range is invalid.
Haojian Wu [Wed, 12 Aug 2020 07:20:23 +0000 (09:20 +0200)]
[AST] Fix the CXXFoldExpr source range when parentheses range is invalid.

The CXXFoldExpr's range is invalid if the cxxfoldexpr is formed via the
Concept's TypeContraints (because the parentheses are not written in the
source code). We fallback to use the range from the pattern.

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

4 years ago[MLIR,OpenMP] Lowering of parallel operation: proc_bind clause 2/n
Kiran Chandramohan [Wed, 22 Jul 2020 16:28:04 +0000 (17:28 +0100)]
[MLIR,OpenMP] Lowering of parallel operation: proc_bind clause 2/n

This patch adds the translation of the proc_bind clause in a
parallel operation.

The values that can be specified for the proc_bind clause are
specified in the OMP.td tablegen file in the llvm/Frontend/OpenMP
directory. From this single source of truth enumeration for
proc_bind is generated in llvm and mlir (used in specification of
the parallel Operation in the OpenMP dialect). A function to return
the enum value from the string representation is also generated.
A new header file (DirectiveEmitter.h) containing definitions of
classes directive, clause, clauseval etc is created so that it can
be used in mlir as well.

Reviewers: clementval, jdoerfert, DavidTruby

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

4 years ago[X86][GlobalISel] Replace a misuse of SUBREG_TO_REG with INSERT_SUBREG.
Craig Topper [Wed, 12 Aug 2020 06:39:13 +0000 (23:39 -0700)]
[X86][GlobalISel] Replace a misuse of SUBREG_TO_REG with INSERT_SUBREG.

SUBREG_TO_REG is supposed to be used when we know the producing
instruction already zeroed the bits we're extending. But that's
not the case here. So INSERT_SUBREG with an IMPLICIT_DEF is the
correct thing to use.

4 years ago[MLIR][SPIRVToLLVM] Conversion for global and addressof
George Mitenkov [Wed, 12 Aug 2020 06:10:39 +0000 (09:10 +0300)]
[MLIR][SPIRVToLLVM] Conversion for global and addressof

Inital conversion of `spv._address_of` and `spv.globalVariable`.
In SPIR-V, the global returns a pointer, whereas in LLVM dialect
the global holds an actual value. This difference is handled by
`spv._address_of` and `llvm.mlir.addressof`ops that both return
a pointer. Moreover, only current invocation is in conversion's
scope.

Reviewed By: antiagainst, mravishankar

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

4 years ago[libc][obvious] Switch nearest integer function tests to the new matchers.
Siva Chandra [Wed, 12 Aug 2020 05:13:59 +0000 (22:13 -0700)]
[libc][obvious] Switch nearest integer function tests to the new matchers.

4 years ago[NFC] Factor out hasForceAttributes
Kyungwoo Lee [Wed, 12 Aug 2020 06:14:35 +0000 (02:14 -0400)]
[NFC] Factor out hasForceAttributes

This is a preparation for https://reviews.llvm.org/D85586.

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

4 years ago[Attributor][NFC] Reformat tests after D85099
Johannes Doerfert [Tue, 11 Aug 2020 01:31:30 +0000 (20:31 -0500)]
[Attributor][NFC] Reformat tests after D85099

Reviewed By: sstefan1

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

4 years ago[UpdateTestChecks] Match unnamed values like "@[0-9]+" and "![0-9]+"
Johannes Doerfert [Mon, 10 Aug 2020 18:59:07 +0000 (13:59 -0500)]
[UpdateTestChecks] Match unnamed values like "@[0-9]+" and "![0-9]+"

With this patch we will match most *uses* of "temporary" named things in
the IR via regular expressions, not their name at creation time. The new
"values" we match are:
  - "unnamed" globals: `@[0-9]+`
  - debug metadata: `!dbg ![0-9]+`
  - loop metadata: `!loop ![0-9]+`
  - tbaa metadata: `!tbaa ![0-9]+`
  - range metadata: `!range ![0-9]+`
  - generic metadata: `metadata ![0-9]+`
  - attributes groups: `#[0-9]`

We still don't match the declarations but that can be done later. This
patch can introduce churn when existing check lines contain the old
hardcoded versions of the above "values". We can add a flag to opt-out,
or opt-in, if necessary.

Reviewed By: arichardson, MaskRay

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

4 years ago[CMake] Simplify CMake handling for zlib
Petr Hosek [Thu, 30 Apr 2020 20:07:13 +0000 (13:07 -0700)]
[CMake] Simplify CMake handling for zlib

Rather than handling zlib handling manually, use find_package from CMake
to find zlib properly. Use this to normalize the LLVM_ENABLE_ZLIB,
HAVE_ZLIB, HAVE_ZLIB_H. Furthermore, require zlib if LLVM_ENABLE_ZLIB is
set to YES, which requires the distributor to explicitly select whether
zlib is enabled or not. This simplifies the CMake handling and usage in
the rest of the tooling.

This is a reland of abb0075 with all followup changes and fixes that
should address issues that were reported in PR44780.

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

4 years ago[NFC] Inline variable only used in debug builds
Jordan Rupprecht [Wed, 12 Aug 2020 02:38:01 +0000 (19:38 -0700)]
[NFC] Inline variable only used in debug builds

4 years ago[VectorCombine] add safety check for 0-width register
Sanjay Patel [Wed, 12 Aug 2020 00:27:50 +0000 (20:27 -0400)]
[VectorCombine] add safety check for 0-width register

Based on post-commit discussion in D81766, Hexagon sets this to "0".
I'll see if I can come up with a test, but making the obvious
code fix first to unblock that target.

4 years ago[WebAssembly][AsmParser] Name missing features in error message
Thomas Lively [Wed, 12 Aug 2020 00:26:14 +0000 (17:26 -0700)]
[WebAssembly][AsmParser] Name missing features in error message

Rather than just saying that some feature is missing, report the exact
features to make the error message more useful and actionable.

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

4 years ago[Diagnostics] Reworked -Wstring-concatenation
Dávid Bolvanský [Wed, 12 Aug 2020 00:17:04 +0000 (02:17 +0200)]
[Diagnostics] Reworked -Wstring-concatenation

4 years ago[flang] Fix interpretation of intrinsic names as arguments
Tim Keith [Tue, 11 Aug 2020 23:52:49 +0000 (16:52 -0700)]
[flang] Fix interpretation of intrinsic names as arguments

If an unrestricted specific intrinsic function name is first encountered
as an actual argument, it should be interpreted as an object entity,
not a procedure entity.

Fix some tests that depended on the previous interpretation by adding
explicit INTRINSIC statements.

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

4 years ago[libcxx/variant] Add a few benchmarks for `std::visit`.
Michael Park [Tue, 11 Aug 2020 22:48:02 +0000 (15:48 -0700)]
[libcxx/variant] Add a few benchmarks for `std::visit`.

This patch adds a few `std::visit` benchmarks as a starting point.

Reviewed By: ldionne, #libc

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

4 years agoRevert "[Instruction] Add updateLocationAfterHoist helper"
Vedant Kumar [Tue, 11 Aug 2020 21:53:42 +0000 (14:53 -0700)]
Revert "[Instruction] Add updateLocationAfterHoist helper"

This reverts commit 4a646ca9e2caf70d6312714770f516fb83b7e3cb.

This is causing some bots to fail with "!dbg attachment points at wrong
subprogram for function", like:

http://lab.llvm.org:8011/builders/sanitizer-windows/builds/67958/steps/stage%201%20check/logs/stdio

4 years ago[globalopt] Change so that emitting fragments doesn't use the type size of DIVariables
Amy Huang [Tue, 11 Aug 2020 21:50:56 +0000 (14:50 -0700)]
[globalopt] Change so that emitting fragments doesn't use the type size of DIVariables

When turning on -debug-info-kind=constructor we ran into a "fragment covers
entire variable" error during thinlto. The fragment is currently always
emitted if there is no type size, but sometimes the variable has a
forward declared struct type which doesn't have a size.

This changes the code to get the type size from the GlobalVariable instead.

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

4 years ago[Analyzer] Support note tags for smart ptr checker
Nithin Vadukkumchery Rajendrakumar [Tue, 11 Aug 2020 18:33:54 +0000 (20:33 +0200)]
[Analyzer] Support note tags for smart ptr checker

Summary:
Added support for note tags for null smart_ptr reporting

Reviewers: NoQ, Szelethus, vsavchenko, xazax.hun

Reviewed By: NoQ, vsavchenko, xazax.hun

Subscribers: martong, cfe-commits
Tags: #clang

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

4 years ago[Instcombine] Fix uses of undef (PR46940)
Kazu Hirata [Tue, 11 Aug 2020 21:13:26 +0000 (14:13 -0700)]
[Instcombine] Fix uses of undef (PR46940)

Without this patch, we attempt to distribute And over Xor even in
unsafe circumstances like so:

  undef & (true ^ true)  ==>  (undef & true) ^ (undef & true)

and evaluate it to undef instead of false.  Note that "true ^ true"
may show up implicitly with one true being part of a PHI node.

This patch fixes the problem by teaching SimplifyUsingDistributiveLaws
to not use undef as part of simplifications.

Reviewers: spatel, aqjune, nikic, lebedev.ri, fhahn, jdoerfert

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

4 years ago[drr] Add $_loc special directive for NativeCodeCall
Jacques Pienaar [Tue, 11 Aug 2020 21:06:16 +0000 (14:06 -0700)]
[drr] Add $_loc special directive for NativeCodeCall

Allows propagating the location to ops created via NativeCodeCall.

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

4 years ago[Instruction] Add updateLocationAfterHoist helper
Vedant Kumar [Mon, 10 Aug 2020 17:44:13 +0000 (10:44 -0700)]
[Instruction] Add updateLocationAfterHoist helper

Introduce a helper on Instruction which can be used to update the debug
location after hoisting.

Use this in GVN and LICM, where we were mistakenly introducing new line
0 locations after hoisting (the docs recommend dropping the location in
this case).

For more context, see the discussion in https://reviews.llvm.org/D60913.

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

4 years ago[LLDB] Improve PDB discovery
Adrian McCarthy [Wed, 29 Jul 2020 00:45:33 +0000 (17:45 -0700)]
[LLDB] Improve PDB discovery

When loading a PE/COFF target, the associated PDB file often wasn't
found.  The executable module contains a path for the associated PDB
file, but people often debug from a different directory than the one
their build system uses.  (This is especially common in post-mortem
and cross platform debugging.)

Suppose the COFF executable being debugged is `~/proj/foo.exe`, but
it was built elsewhere and refers to `D:\remote\build\env\foobar.pdb`,
LLDB wouldn't find it.

With this change, if no file exists at the PDB path, LLDB will look
in the executable directory for a PDB file that matches the name of
the one it expected (e.g., `~/proj/foobar.pdb`).  If found, the PDB
is subject to the same matching criteria (GUIDs and age) as would
have been used had it been in the original location.

This same-directory-as-the-binary rule is commonly used by debuggers
on Windows.

Differential Review: https://reviews.llvm.org/D84815

4 years ago[libc][obvious] Remove a commented out block.
Siva Chandra [Tue, 11 Aug 2020 20:27:24 +0000 (13:27 -0700)]
[libc][obvious] Remove a commented out block.

4 years ago[AARCH64] [MC] add memtag as an alias of mte architecture extension
Jian Cai [Tue, 11 Aug 2020 19:19:32 +0000 (12:19 -0700)]
[AARCH64] [MC] add memtag as an alias of mte architecture extension

Add memtag as an alis of met architectture extesion to be consistent
with GNU as.

LINK:https://sourceware.org/bugzilla/show_bug.cgi?id=26339

Reviewed By: nickdesaulniers, MaskRay

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

4 years ago[libFuzzer] Fix minimizing timeouts
Ilya Leoshkevich [Tue, 11 Aug 2020 20:16:08 +0000 (22:16 +0200)]
[libFuzzer] Fix minimizing timeouts

When one tries to minimize timeouts using -minimize_crash=1,
minimization immediately fails. The following sequence of events is
responsible for this:

[parent] SIGALRM occurs
[parent] read() returns -EINTR (or -ERESTARTSYS according to strace)
[parent] fgets() returns NULL
[parent] ExecuteCommand() closes child's stdout and returns
[child ] SIGALRM occurs
[child ] AlarmCallback() attempts to write "ALARM: ..." to stdout
[child ] Dies with SIGPIPE without calling DumpCurrentUnit()
[parent] Does not see -exact_artifact_path and exits

When minimizing, the timer in parent is not necessary, so fix by not
setting it in this case.

Reviewed By: morehouse

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

4 years ago[InstSimplify] Respect CanUseUndef in more places
Nikita Popov [Tue, 11 Aug 2020 19:50:14 +0000 (21:50 +0200)]
[InstSimplify] Respect CanUseUndef in more places

Similar to what we do in IIQ, add an isUndefValue() helper that
checks for undef values while respective CanUseUndef. This makes
it much easier to search for places that don't respect the flag
yet.

4 years ago[lldb] Fix the last remaining tests not inheriting TCC permissions
Jonas Devlieghere [Tue, 11 Aug 2020 19:47:54 +0000 (12:47 -0700)]
[lldb] Fix the last remaining tests not inheriting TCC permissions

After this patch all test should have the inferior inheriting the TCC
permissions from its parent.

4 years ago[NFC][InstCombine] Add tests for PHI merging/aggregate reconstruction (PR47060)
Roman Lebedev [Tue, 11 Aug 2020 19:40:08 +0000 (22:40 +0300)]
[NFC][InstCombine] Add tests for PHI merging/aggregate reconstruction (PR47060)

We should be able to see that the new aggregate we have produced
is identical to the source aggregate from which we've extracted
the elements that we used to form a new aggregate.

This happens (a lot) in clang C++ exception code on unwind branch.

4 years ago[libunwind] Fix incorrect check for out-of-boundedness
Louis Dionne [Tue, 11 Aug 2020 19:29:00 +0000 (15:29 -0400)]
[libunwind] Fix incorrect check for out-of-boundedness

If the personalityIndex (which is 0-based) is equal to the length of
the personality array, we should error out.

rdar://18013273

4 years ago[gn build] Fix CodeGenTests
Arthur Eubanks [Mon, 10 Aug 2020 19:55:46 +0000 (12:55 -0700)]
[gn build] Fix CodeGenTests

Missing dependency required by https://reviews.llvm.org/D67687.

Fixes
lld-link: error: undefined symbol: public: __cdecl llvm::PipelineTuningOptions::PipelineTuningOptions(void)
>>> referenced by C:\src\llvm-project\llvm\unittests\CodeGen\PassManagerTest.cpp:215
>>>               obj/llvm/unittests/CodeGen/CodeGenTests.PassManagerTest.obj:(private: virtual void __cdecl `anonymous namespace'::PassManagerTest_Basic_Test::TestBody(void))

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

4 years ago[WebAssembly][NFC] Replace WASM with standard Wasm
Thomas Lively [Tue, 11 Aug 2020 19:27:59 +0000 (12:27 -0700)]
[WebAssembly][NFC] Replace WASM with standard Wasm

The officially specified abbreviation for WebAssembly is Wasm and the
spec explicitly calls out WASM as being an incorrect spelling. This
patch fixes a few comments and error messages to use the
spec-compliant abbreviation.

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

4 years ago[AIX][XCOFF] change the operand of branch instruction from symbol name to qualified...
diggerlin [Tue, 11 Aug 2020 19:26:19 +0000 (15:26 -0400)]
[AIX][XCOFF] change the operand of branch instruction from symbol name to qualified symbol name for function declarations

SUMMARY:

1. in the patch  , remove setting storageclass in function .getXCOFFSection and construct function of class MCSectionXCOFF
there are

XCOFF::StorageMappingClass MappingClass;
XCOFF::SymbolType Type;
XCOFF::StorageClass StorageClass;
in the MCSectionXCOFF class,
these attribute only used in the XCOFFObjectWriter, (asm path do not need the StorageClass)

we need get the value of StorageClass, Type,MappingClass before we invoke the getXCOFFSection every time.

actually , we can get the StorageClass of the MCSectionXCOFF  from it's delegated symbol.

2. we also change the oprand of branch instruction from symbol name to qualify symbol name.
for example change
bl .foo
extern .foo
to
bl .foo[PR]
extern .foo[PR]

3. and if there is reference indirect call a function bar.
we also add
  extern .bar[PR]

Reviewers:  Jason liu, Xiangling Liao

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

4 years ago[libunwind][NFC] Fix typo in comment
Louis Dionne [Tue, 11 Aug 2020 19:24:21 +0000 (15:24 -0400)]
[libunwind][NFC] Fix typo in comment

4 years agoReland "[SLPVectorizer] Pre-commit a test for D85759"
Thomas Lively [Tue, 11 Aug 2020 19:18:33 +0000 (12:18 -0700)]
Reland "[SLPVectorizer] Pre-commit a test for D85759"

This reverts commit 52b71aa8b1a019403b0ecc184744b2f8ca2f7cba.

The problem was a missing lit.local.cfg file, which was causing the
test to be incorrectly run on bots that had not built the WebAssembly
target.

4 years agoRevert "[SLPVectorizer] Pre-commit a test for D85759"
Thomas Lively [Tue, 11 Aug 2020 19:11:24 +0000 (12:11 -0700)]
Revert "[SLPVectorizer] Pre-commit a test for D85759"

This reverts commit 94791970de109eb9a6b296825ddb0fc2a196b366.

The test is failing on multiple bots, event though it passes for me
locally. Reverting while I investigate further.

4 years agoNFC. Constify MachineVerifier::verify parameter
Yuanfang Chen [Tue, 11 Aug 2020 18:59:13 +0000 (11:59 -0700)]
NFC. Constify MachineVerifier::verify parameter

4 years ago[compiler-rt] XFAIL test on iOS
Julian Lettner [Mon, 10 Aug 2020 18:45:51 +0000 (11:45 -0700)]
[compiler-rt] XFAIL test on iOS

On iOS, when we `longjmp()` out of the signal handler, a subsequent call
to `sigaltstack()` still reports that we are executing on the signal
handler stack.
Tracking rdar://66789814

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

4 years ago[OpenMP] split execution of a long test into smaller parts.
Artem Belevich [Mon, 10 Aug 2020 22:36:09 +0000 (15:36 -0700)]
[OpenMP] split execution of a long test into smaller parts.

This test is bottlenecked by heavy regex use (~0.6s per FileCHeck run) with the
content that can't be further fragmented. Instead, the test body is moved into a
common .inc file and test execution has been split into four roughly equal
parts. This reduces wall time for the test from 14s to ~3.5s.

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

4 years ago[BPI] Teach BPI about bcmp function
Dávid Bolvanský [Tue, 11 Aug 2020 18:42:58 +0000 (20:42 +0200)]
[BPI] Teach BPI about bcmp function
bcmp is similar to memcmp

4 years ago[lldb] Enable inheriting TCC permissions in lldb-test
Jonas Devlieghere [Tue, 11 Aug 2020 18:36:35 +0000 (11:36 -0700)]
[lldb] Enable inheriting TCC permissions in lldb-test

Like the rest of the test suite, also set the target.inherit-tcc option
to true in lldb-test.

4 years agoUpdate AMDGPU testcases after bebe6a6449811e877f7eba3f1798ddd1fa83e440
Jessica Paquette [Tue, 11 Aug 2020 17:56:58 +0000 (10:56 -0700)]
Update AMDGPU testcases after bebe6a6449811e877f7eba3f1798ddd1fa83e440

I didn't build AMDGPU locally so I didn't see this.

```
(logic_op (op x...), (op y...)) -> (op (logic_op x, y))
```

kicks in here.

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

4 years ago[SLPVectorizer] Pre-commit a test for D85759
Thomas Lively [Tue, 11 Aug 2020 18:30:09 +0000 (11:30 -0700)]
[SLPVectorizer] Pre-commit a test for D85759

8cc911fa5b06 refactored the `getIntrinsicInstrCost` function and was
meant to be a nonfunctional change, but it accidentally changed how
costs were calculated in the SLP vectorizer, which regressed
WebAssembly codegen and resulted in a downstream bug report at
https://github.com/emscripten-core/emscripten/issues/11449.

The fix for this regression is in D85759, and this patch just
pre-commits the test from that patch to demonstrate the regressed
behavior first.