laith sakka [Fri, 3 Apr 2020 04:10:54 +0000 (21:10 -0700)]
Handle exp2 with proper vectorization and lowering to SVML calls
Summary:
Add mapping from exp2 math functions
to corresponding SVML calls.
This is a follow up and extension for llvm diff
https://reviews.llvm.org/D19544
Test Plan:
- update test case and run ninja check.
- run tests locally
Reviewers: wenlei, hoyFB, mmasten, mzolotukhin, spatel
Reviewed By: spatel
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77114
Hongtao Yu [Fri, 3 Apr 2020 04:07:31 +0000 (21:07 -0700)]
Fix a bug in the inliner that causes subsequent double inlining
Summary:
A recent change in the instruction simplifier enables a call to a function that just returns one of its parameter to be simplified as simply loading the parameter. This exposes a bug in the inliner where double inlining may be involved which in turn may cause compiler ICE when an already-inlined callsite is reused for further inlining.
To put it simply, in the following-like C program, when the function call second(t) is inlined, its code t = third(t) will be reduced to just loading the return value of the callsite first(). This causes the inliner internal data structure to register the first() callsite for the call edge representing the third() call, therefore incurs a double inlining when both call edges are considered an inline candidate. I'm making a fix to break the inliner from reusing a callsite for new call edges.
```
void top()
{
int t = first();
second(t);
}
void second(int t)
{
t = third(t);
fourth(t);
}
void third(int t)
{
return t;
}
```
The actual failing case is much trickier than the example here and is only reproducible with the legacy inliner. The way the legacy inliner works is to process each SCC in a bottom-up order. That means in reality function first may be already inlined into top, or function third is either inlined to second or is folded into nothing. To repro the failure seen from building a large application, we need to figure out a way to confuse the inliner so that the bottom-up inlining is not fulfilled. I'm doing this by making the second call indirect so that the alias analyzer fails to figure out the right call graph edge from top to second and top can be processed before second during the bottom-up. We also need to tweak the test code so that when the inlining of top happens, the function body of second is not that optimized, by delaying the pass of function attribute deducer (i.e, which tells function third has no side effect and just returns its parameter). Since the CGSCC pass is iterative, additional calls are added to top to postpone the inlining of second to the second round right after the first function attribute deducing pass is done. I haven't been able to repro the failure with the new pass manager since the processing order of ininlined callsites is a bit different, but in theory the issue could happen there too.
Note that this fix could introduce a side effect that blocks the simplification of inlined code, specifically for a call site that can be folded to another call site. I hope this can probably be complemented by subsequent inlining or folding, as shown in the attached unit test. The ideal fix should be to separate the use of VMap. However, in reality this failing pattern shouldn't happen often. And even if it happens, there should be a good chance that the non-folded call site will be refolded by iterative inlining or subsequent simplification.
Reviewers: wenlei, davidxl, tejohnson
Reviewed By: wenlei, davidxl
Subscribers: eraman, nikic, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76248
Xiang1 Zhang [Fri, 3 Apr 2020 03:25:38 +0000 (11:25 +0800)]
Enable IBT(Indirect Branch Tracking) in JIT with CET(Control-flow Enforcement Technology)
Summary:
This patch comes from H.J.'s https://github.com/hjl-tools/llvm-project/commit/
2bd54ce7fa9e94fcd1118b948e14d1b6fc54dfd2
**This patch fix the failed llvm unit tests which running on CET machine. **(e.g. ExecutionEngine/MCJIT/MCJITTests)
The reason we enable IBT at "JIT compiled with CET" is mainly that: the JIT don't know the its caller program is CET enable or not.
If JIT's caller program is non-CET, it is no problem JIT generate CET code or not.
But if JIT's caller program is CET enabled, JIT must generate CET code or it will cause Control protection exceptions.
I have test the patch at llvm-unit-test and llvm-test-suite at CET machine. It passed.
and H.J. also test it at building and running VNCserver(Virtual Network Console), it works too.
(if not apply this patch, VNCserver will crash at CET machine.)
Reviewers: hjl.tools, craig.topper, LuoYuanke, annita.zhang, pengfei
Subscribers: tstellar, efriedma, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76900
Craig Topper [Fri, 3 Apr 2020 02:55:20 +0000 (19:55 -0700)]
[X86] Add -flax-vector-conversions=none to more of the clang CodeGen tests
Thankfully no issues found.
Jessica Paquette [Thu, 2 Apr 2020 23:33:35 +0000 (16:33 -0700)]
[AArch64][GlobalISel] Constrain reg operands in selectBrJT
This was causing a machine verifier failure on the test suite.
Make sure that we don't end up with a weird register class here.
Failure for reference:
*** Bad machine code: Illegal virtual register for instruction ***
- function: check_constrain
- basic block: %bb.1 (0x7f8b70839f80)
- instruction: early-clobber %6:gpr64, early-clobber %7:gpr64sp =
JumpTableDest32 %5:gpr64, %1:gpr64sp, %jump-table.0
- operand 3: %1:gpr64sp
Expected a GPR64 register, but got a GPR64sp register
Differential Revision: https://reviews.llvm.org/D77349
Wenju He [Fri, 3 Apr 2020 02:47:55 +0000 (10:47 +0800)]
[x86] Fix Intel OpenCL builtin CalleeSavedRegs on skx
Summary: Align with AVX512 builtins implementations, some of which don't preserve rdi.
Reviewers: yubing, tianqing, craig.topper
Reviewed By: craig.topper
Subscribers: yaxunl, Anastasia, hiraditya
Differential Revision: https://reviews.llvm.org/D77032
Qiu Chaofan [Fri, 3 Apr 2020 03:05:14 +0000 (11:05 +0800)]
[PowerPC] Remove unnecessary XSRSP instruction
MI peephole will remove unnecessary FRSP instructions. This patch
removes such unnecessary XSRSP.
Reviewed By: steven.zhang
Differential Revision: https://reviews.llvm.org/D77208
Nico Weber [Fri, 3 Apr 2020 02:22:54 +0000 (22:22 -0400)]
This might actually fix the Windows bots after
a16ba6fea.
Brian Gesiak [Thu, 21 Nov 2019 18:51:44 +0000 (13:51 -0500)]
[coroutines] Don't build promise init with no args
Summary:
In the case of a coroutine that takes no arguments,
`Sema::buildCoroutinePromise` constructs a list-initialization
(`clang::InitializationKind::InitKind::IK_DirectList`) of the
promise variable, using a list of empty arguments. So, if one were to
dump the promise `VarDecl` immediately after `Sema::ActOnCoroutineBodyStart`
calls `checkCoroutineContext`, for a coroutine function that takes no
arguments, they'd see the following:
```
VarDecl 0xb514490 <test.cpp:26:3> col:3 __promise '<dependent type>' callinit
`-ParenListExpr 0xb514510 <col:3> 'NULL TYPE'
```
But after this patch, the `ParenListExpr` is no longer constructed, and
the promise variable uses default initialization
(`clang::InitializationKind::InitKind::IK_Default`):
```
VarDecl 0x63100012dae0 <test.cpp:26:3> col:3 __promise '<dependent type>'
```
As far as I know, there's no case in which list-initialization with no
arguments differs from default initialization, but if I'm wrong please
let me know (and I'll add a test case that demonstrates the change --
but as-is I can't think of a functional test case for this). I think both
comply with the wording of C++20 `[dcl.fct.def.coroutine]p5`:
> _promise-constructor-arguments_ is determined as follows: overload
resolution is performed on a promise constructor call created by
assembling an argument list with lvalues `p1 ... pn`. If a viable
constructor is found (12.4.2), then _promise-constructor-arguments_
is `(p1, ... , pn)`, otherwise _promise-constructor-arguments_ is
empty.
Still, I think this patch is an improvement regardless, because it
reduces the size of the AST.
Reviewers: GorNishanov, rsmith, lewissbaker
Subscribers: EricWF, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70555
Alex Grosul [Thu, 2 Apr 2020 22:20:38 +0000 (15:20 -0700)]
[mlir][VectorOps] Implement canonicalization for TransposeOp.
Two back-to-back transpose operations are combined into a single transpose, which uses a combination of their permutation vectors.
Differential Revision: https://reviews.llvm.org/D77331
Greg Clayton [Thu, 2 Apr 2020 23:30:33 +0000 (16:30 -0700)]
Have lldb-vscode update the currently selecte thread and frame when it receives a "scopes" request.
Summary: The IDE has no packets that are sent to lldb-vscode that say which thread and frame are selected. The only way we know is we get a request for variables for a stack frame via a "scopes" request. When we receive this packet we make that thread and frame the selected thread and frame in lldb. This way when people execute lldb commands in the debug console by prefixing the expression with the backtick character, we will have the right thread and frame selected. Previously this was not updated as new stack frames were selected.
Reviewers: labath, aadsm, wallace, JDevlieghere
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D77347
Nico Weber [Fri, 3 Apr 2020 01:22:15 +0000 (21:22 -0400)]
another wild guess at the win bot-only failures
Jun Ma [Fri, 3 Apr 2020 01:20:07 +0000 (09:20 +0800)]
[Coroutines] Simplify implementation using removePredecessor
Differential Revision: https://reviews.llvm.org/D77035
Nicolas Vasilache [Fri, 3 Apr 2020 01:06:45 +0000 (21:06 -0400)]
[mlir][Linalg] NFC - Rename Linalg and Vector EDSCs to avoid collisions
A certain number of EDSCs have a named form (e.g. `linalg.matmul`) and a generic form (e.g. `linalg.generic` with matmul traits).
Despite living in different namespaces, using the same name is confusiong in clients.
Rename them as `linalg_matmul` and `linalg_generic_matmul` respectively.
Austin Kerbow [Mon, 30 Mar 2020 06:32:20 +0000 (23:32 -0700)]
[AMDGPU] Handle SMRD signed offset immediate
Summary:
This fixes a few issues related to SMRD offsets. On gfx9 and gfx10 we have a
signed byte offset immediate, however we can overflow into a negative since we
treat it as unsigned.
Also, the SMRD SOFFSET sgpr is an unsigned offset on all subtargets. We
sometimes tried to use negative values here.
Third, S_BUFFER instructions should never use a signed offset immediate.
Differential Revision: https://reviews.llvm.org/D77082
Adrian Prantl [Thu, 2 Apr 2020 23:11:49 +0000 (16:11 -0700)]
Teach the stripNonLineTableDebugInfo pass about the llvm.dbg.label intrinsic.
Debug info for labels is not generated at -gline-tables-only, so this
pass should remove them.
Differential Revision: https://reviews.llvm.org/D77345
Adrian Prantl [Thu, 2 Apr 2020 23:05:45 +0000 (16:05 -0700)]
Teach the stripNonLineTableDebugInfo pass about the llvm.dbg.addr intrinsic.
This patch also strips llvm.dbg.addr intrinsics when downgrading debug
info to linetables-only.
Differential Revision: https://reviews.llvm.org/D77343
Nico Weber [Fri, 3 Apr 2020 00:27:31 +0000 (20:27 -0400)]
try more to appease win bots
Nico Weber [Fri, 3 Apr 2020 00:00:38 +0000 (20:00 -0400)]
Try again to get tests passing again on Windows.
Things pass locally, but some tests on some bots are still unhappy.
I'm not sure why. See if using forward slashes as before helps.
Lang Hames [Thu, 2 Apr 2020 22:58:52 +0000 (15:58 -0700)]
Re-apply
0071eaaf089, "[ORC] Export __cxa_atexit ...", with fixes.
Forgot to include part of the testcase. Thank to Nico for spotting that and
reverting!
Matt Arsenault [Thu, 2 Apr 2020 22:50:09 +0000 (18:50 -0400)]
AMDGPU: Fix broken check lines
Hubert Tong [Thu, 2 Apr 2020 22:17:52 +0000 (18:17 -0400)]
[llvm-objdump][COFF][NFC] Split format-specific interfaces; add namespace
Summary:
This patch addresses, for the interfaces implemented by `COFFDump.cpp`,
multiple issues identified with the current structure of
`llvm-objdump.h` in the review of D72973.
This patch moves implementation details of the tool into an
`llvm::objdump` namespace for external linkage names, splits the
implementation details into separate headers for each implementation
file, and uses qualified names when declaring members of the
`llvm::objdump` namespace in place of leaving the namespace definition
open.
Reviewers: jhenderson, DiggerLin, jasonliu, daltenty, MaskRay
Reviewed By: jhenderson, MaskRay
Subscribers: MaskRay, rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77285
Julian Lettner [Thu, 2 Apr 2020 19:58:47 +0000 (12:58 -0700)]
iOS simulator testing: replace `simctl bootstatus` with boot+shutdown
rdar://
59643443
Julian Lettner [Thu, 2 Apr 2020 18:06:28 +0000 (11:06 -0700)]
[lit] Refine filter error handling
Picking a default filter `.*` that matches everything lets us streamline
some error handling code.
Julian Lettner [Thu, 2 Apr 2020 17:45:57 +0000 (10:45 -0700)]
[lit] Remove unnecessary indirection in progress_callback
On shutdown, the result complete handler is not racing with the main
thread anymore because we are now always waiting for process pool
termination via
```
finally:
pool.join()
```
Matt Arsenault [Wed, 1 Apr 2020 20:46:10 +0000 (16:46 -0400)]
AMDGPU: Use 128-bit DS operations by default
Matt Arsenault [Wed, 11 Dec 2019 12:42:52 +0000 (18:12 +0530)]
AMDGPU: Add some tests for exotic denormal mode combinations
Matt Arsenault [Mon, 18 Nov 2019 11:18:07 +0000 (16:48 +0530)]
AMDGPU: Remove denormal subtarget features
Switch to using the denormal-fp-math/denormal-fp-math-f32 attributes.
Matt Arsenault [Wed, 1 Apr 2020 17:57:16 +0000 (13:57 -0400)]
clang/AMDGPU: Stop setting old denormal subtarget features
Matt Arsenault [Fri, 1 Nov 2019 06:32:31 +0000 (23:32 -0700)]
AMDGPU: Assume f32 denormals are enabled by default
This will likely introduce catastrophic performance regressions on
older subtargets, but should be correct. A follow up change will
remove the old fp32-denormals subtarget features, and switch to using
the new denormal-fp-math/denormal-fp-math-f32 attributes. Frontends
should be making sure to add the denormal-fp-math-f32 attribute when
appropriate to avoid performance regressions.
Duncan P. N. Exon Smith [Thu, 2 Apr 2020 17:27:42 +0000 (10:27 -0700)]
utils: Tweak clang-parse-diagnostics-file for modules includes
Diagnostics from modules do not have a `main-file` listed. Tweak
`clang-parse-diagnostics-file` to patch this up. Previously, the call
to `os.path.basename` would crash.
Radar-Id: rdar://problem/
59000292
Louis Dionne [Thu, 2 Apr 2020 21:14:45 +0000 (17:14 -0400)]
[libc++] NFC: Add documentation for writing tests
Louis Dionne [Wed, 1 Apr 2020 20:26:31 +0000 (16:26 -0400)]
[libc++] Refer to the Filesystem static test env as relative paths
Instead of hardcoding absolute paths on the build-host in the executables,
use relative paths from the current working directory. Also, use
FILE_DEPENDENCIES to mark the static test env as being required by
the relevant tests.
Given a SSH executor that copies the files to the remote host properly,
the tests can be run on that remote host.
Nico Weber [Thu, 2 Apr 2020 19:51:58 +0000 (15:51 -0400)]
Reland "Make it possible for lit.site.cfg to contain relative paths, and use it for llvm and clang"
The problem on Windows was that the \b in "..\bin" was interpreted
as an escape sequence. Use r"" strings to prevent that.
This reverts commit
ab11b9eefa16661017c2c7b3b34c46b069f43fb7,
with raw strings in the lit.site.cfg.py.in files.
Differential Revision: https://reviews.llvm.org/D77184
Cyndy Ishida [Wed, 1 Apr 2020 16:41:39 +0000 (09:41 -0700)]
[llvm][TextAPI] adding inlining reexported libraries support
Summary:
[llvm][TextAPI] adding inlining reexported libraries support
* this patch adds reader/writer support for MachO tbd files.
The usecase is to represent reexported libraries in top level library
that won't need to exist for linker indirection because all of the
needed content will be inlined in the same document.
Reviewers: ributzka, steven_wu, jhenderson
Reviewed By: ributzka
Subscribers: JDevlieghere, hiraditya, mgrang, dexonsmith, rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67646
Casey Carter [Thu, 2 Apr 2020 19:59:57 +0000 (12:59 -0700)]
[libc++][test] Partially revert msvc_stdlib_force_include.h _Pragma change
... keep the warning suppression, but revert the `__pragma` to `_Pragma` change because `_Pragma` interacts badly with `/Zc:preprocessor`.
Craig Topper [Thu, 2 Apr 2020 19:08:56 +0000 (12:08 -0700)]
[X86] Enable combineExtSetcc for vectors larger than 256 bits when we've disabled 512 bit vectors.
The compares are going to be type legalized to 256 bits so we
might as well fold the extend.
Fangrui Song [Thu, 2 Apr 2020 18:54:05 +0000 (11:54 -0700)]
Reland D75382 "[lld] Initial commit for new Mach-O backend"
With a fix for http://lab.llvm.org:8011/builders/clang-cmake-armv8-lld/builds/3636
Also trims some unneeded dependencies.
Nico Weber [Thu, 2 Apr 2020 18:58:44 +0000 (14:58 -0400)]
Revert "Make it possible for lit.site.cfg to contain relative paths, and use it for llvm and clang"
This reverts commit
fb80b6b2d58c476747a3206bd4371b787108591b and
follow-up
631ee8b24adf36359b61ecb47484e8e82de35be8.
Seems to not work on Windows:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/31684
http://lab.llvm.org:8011/builders/llvm-clang-win-x-aarch64/builds/6512
Let's revert while I investigate.
Mehdi Amini [Thu, 2 Apr 2020 17:36:11 +0000 (17:36 +0000)]
Change pass registration generated code to allow users to selectively register passes
This slightly tweaks the generated code from:
#ifdef GEN_PASS_REGISTRATION
::mlir::registerPass("flag1", ...
::mlir::registerPass("flag2", ...
#endif // GEN_PASS_REGISTRATION
to:
#ifdef GEN_PASS_REGISTRATION
#define GEN_PASS_REGISTRATION_Pass1
#define GEN_PASS_REGISTRATION_Pass2
#endif // GEN_PASS_REGISTRATION
#ifdef GEN_PASS_REGISTRATION_Pass1
::mlir::registerPass("flag1", ...
#endif
#ifdef GEN_PASS_REGISTRATION_Pass1
::mlir::registerPass("flag2", ...
#endif
That way the generated code can be included by defining the
`GEN_PASS_REGISTRATION` macro as currenty and register all the passes,
but one can also define only `GEN_PASS_REGISTRATION_Pass1` to register a
subset of the passes.
Differential Revision: https://reviews.llvm.org/D77322
Walter Erquinigo [Tue, 31 Mar 2020 00:26:58 +0000 (17:26 -0700)]
[intel-pt] Implement a basic test case
* This is a reattempted commit due to a previous builtbot failure
- Now using a env var to determine whether to run the test, as
someone might have built liblldbIntelFeatures.so without intelPT
support, which would make this test fail.
Summary:
Depends on D76872.
There was no test for the Intel PT support on LLDB, so I'm creating one, which
will help making progress on solid grounds.
The test is skipped if the Intel PT plugin library is not built.
Reviewers: clayborg, labath, kusmour, aadsm
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D77107
Nico Weber [Thu, 2 Apr 2020 18:28:34 +0000 (14:28 -0400)]
Make
fb80b6b2d58c4 actually work.
I broke it with last-minute changes right before committing.
Differential Revision: https://reviews.llvm.org/D77184
Anna Thomas [Wed, 1 Apr 2020 15:16:11 +0000 (11:16 -0400)]
[InlineFunction] Update valid return attributes at callsite within callee body
Consider a callee function that has a call (C) within it which feeds
into the return. When we inline that callee into a callsite that has
return attributes, we can backward propagate valid attributes to the
call (C) within that inlined callee body.
This is safe to do so only if we can guarantee transfer of execution to
successor in the window of instructions between return value (i.e. the
call C) and the return instruction.
Also, this is valid only for attributes which are a property of a
callsite and not those that are not dependent on the ABI, or a property
of the call itself.
Reviewed-By: reames, jdoerfert
Differential Revision: https://reviews.llvm.org/D76140
Matt Arsenault [Thu, 2 Apr 2020 15:52:23 +0000 (11:52 -0400)]
AMDGPU: Hack out noinline on functions using LDS globals
This is a workaround for clang adding noinline to all functions at
-O0. Previously, we would just add alwaysinline, and the verifier
would complain about having both noinline and alwaysinline. We
currently can't truly codegen this case as a freestanding function, so
override the user forcing noinline.
Nico Weber [Tue, 31 Mar 2020 20:35:32 +0000 (16:35 -0400)]
Make it possible for lit.site.cfg to contain relative paths, and use it for llvm and clang
Currently, all generated lit.site.cfg files contain absolute paths.
This makes it impossible to build on one machine, and then transfer the
build output to another machine for test execution. Being able to do
this is useful for several use cases:
1. When running tests on an ARM machine, it would be possible to build
on a fast x86 machine and then copy build artifacts over after building.
2. It allows running several test suites (clang, llvm, lld) on 3
different machines, reducing test time from sum(each test suite time) to
max(each test suite time).
This patch makes it possible to pass a list of variables that should be
relative in the generated lit.site.cfg.py file to
configure_lit_site_cfg(). The lit.site.cfg.py.in file needs to call
`path()` on these variables, so that the paths are converted to absolute
form at lit start time.
The testers would have to have an LLVM checkout at the same revision,
and the build dir would have to be at the same relative path as on the
builder.
This does not yet cover how to figure out which files to copy from the
builder machine to the tester machines. (One idea is to look at the
`--graphviz=test.dot` output and copy all inputs of the `check-llvm`
target.)
Differential Revision: https://reviews.llvm.org/D77184
Sterling Augustine [Mon, 30 Mar 2020 22:20:26 +0000 (15:20 -0700)]
Exit unwinding early when at the top of the stack and additional info won't be found.
Summary:
This patch follows libgcc's lead: When the return-address register is
zero, there won't be additional stack frames to examine, or gather
information about. Exit before spending time looking for something
known not to be found.
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77099
Sanjay Patel [Thu, 2 Apr 2020 17:44:50 +0000 (13:44 -0400)]
[InstCombine] try to reduce shuffle with bitcasted operand
shuf (bitcast X), undef, Mask --> bitcast X'
The 'inverse shuffles' test (shuf_bitcast_operand) is a pattern
in the motivating examples from PR35454:
https://bugs.llvm.org/show_bug.cgi?id=35454
(see also D76727)
We can deal with this class of patterns in generic instcombine
because we are not creating any new shuffles, just a bitcast.
Alive2 proof:
http://volta.cs.utah.edu:8080/z/mwDUZf
Differential Revision: https://reviews.llvm.org/D76844
Sanjay Patel [Thu, 2 Apr 2020 17:21:29 +0000 (13:21 -0400)]
[VectorCombine] transform bitcasted shuffle to narrower elements
bitcast (shuf V, MaskC) --> shuf (bitcast V), MaskC'
We do not attempt this in InstCombine because we do not want to change
types and create new shuffle ops that are potentially not lowered as
well as the original code. Here, we can check the cost model to see if
it is worthwhile.
I've aggressively enabled this transform even if the types are the same
size and/or equal cost because moving the bitcast allows InstCombine to
make further simplifications.
In the motivating cases from PR35454:
https://bugs.llvm.org/show_bug.cgi?id=35454
...this is enough to let instcombine and the backend eliminate the
redundant shuffles, but we probably want to extend VectorCombine to
handle the inverse pattern (shuffle-of-bitcast) to get that
simplification directly in IR.
Differential Revision: https://reviews.llvm.org/D76727
Stanislav Mekhanoshin [Wed, 1 Apr 2020 21:58:12 +0000 (14:58 -0700)]
[AMDGPU] Fix crash in SILoadStoreOptimizer
SILoadStoreOptimizer::checkAndPrepareMerge() expects base and
paired instruction to come in order and scans MBB from base to
the paired instruction. An original order can be changed if
there were a dependent instruction in between and base instruction
was moved.
Fixed by bailing the optimization. In theory it might be possible
still to perform a merge by swapping instructions, but on practice
it bails anyway because it finds dependency on that same instruction
which has resulted in the base move.
Differential Revision: https://reviews.llvm.org/D77245
Louis Dionne [Thu, 2 Apr 2020 17:20:23 +0000 (13:20 -0400)]
[libc++abi] NFC: Add link to review in workaround comment
To avoid wasting the valuable time of contributors, add a link to a
blocked review to document additional issues with the removal of some
GCC 4.9 workaround.
Louis Dionne [Thu, 2 Apr 2020 17:11:50 +0000 (13:11 -0400)]
[libc++] Try to fix Chromium's build
Chromium's build sets LIBCXX_CXX_ABI_SYSTEM explicitly when building
libc++, which was broken by
61e89737c5da (which stopped listening to
that option). As a workaround, this commit uses the system libc++abi
when LIBCXX_CXX_ABI_SYSTEM is used.
However, we will need to work with Chromium to standardize their build
of libc++, because LIBCXX_CXX_ABI_SYSTEM is not a public facing build
configuration for libc++, and has never been AFAICT.
Nicolas Vasilache [Thu, 2 Apr 2020 17:02:40 +0000 (13:02 -0400)]
[mlir][LLVM] Finer-grained control for C interface emission
C interface emission is controlled by a flag and has coarse granularity.
With this coarse control, interfaces are emitted for all external functions.
This makes is easy to get undefined symbols.
This revision adds support for controlling per-function emission with an "emit_c_interface" attribute.
Sanjay Patel [Thu, 2 Apr 2020 16:02:37 +0000 (12:02 -0400)]
[InstCombine] add tests for cmyk benchmark; NFC
These are versions of a function that regressed with:
rGf2fbdf76d8d0
That particular problem occurs with an instcombine-simplifycfg-instcombine
sequence, but we can show that it exists within instcombine only with
other variations of the pattern.
Shivam Mittal [Thu, 2 Apr 2020 14:36:07 +0000 (16:36 +0200)]
Convert for loops to entry-based iteration
Summary: Convert index-based loops marked TODO in CommandObjectSettings and CommandObjectTarget to entry-based.
Reviewers: labath
Reviewed By: labath
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D76729
Alex Zinenko [Thu, 2 Apr 2020 16:52:40 +0000 (18:52 +0200)]
[mlir] StandardToLLVM conversion: remove dead code
This code is unused since
04ed07bc174149d61c8a4ed131f0838578bdcaa5,
but it was not removed in that commit.
LLVM GN Syncbot [Thu, 2 Apr 2020 16:36:36 +0000 (16:36 +0000)]
[gn build] Port
c00cb76274f
LLVM GN Syncbot [Thu, 2 Apr 2020 16:36:35 +0000 (16:36 +0000)]
[gn build] Port
24bb2d1e776
Nico Weber [Thu, 2 Apr 2020 16:36:06 +0000 (12:36 -0400)]
Fangrui Song [Thu, 2 Apr 2020 16:25:21 +0000 (09:25 -0700)]
[ELF] Change some "Alias for " help messages to use double dashed options
The aliased options in the --help output use double dashes. It is
inconsistent to have single-dashed messages. Additionally, -l and -t are
common short options and single-dashed forms prefixed with them can
cause confusion.
Louis Dionne [Thu, 2 Apr 2020 16:08:10 +0000 (12:08 -0400)]
[libc++] Attempt to fix the 'runtimes' build
The 'runtimes' build started failing because libc++ stopped using the
in-tree libc++abi when HAVE_CXXABI is set after
61e89737c. This commit
tries to bring back the old behavior when HAVE_CXXABI is set in order
to fix CIs.
However, we really need to sit down and discuss what ways of building
libc++ are supported and formalize them, because having the libc++ build
system branch on basically random variables in some CMake cache somewhere
is not a viable path forward.
Benjamin Kramer [Thu, 2 Apr 2020 15:46:10 +0000 (17:46 +0200)]
[LoopDataPrefetch] Remove unused include that's a layering violation
Jonas Paulsson [Thu, 2 Apr 2020 15:35:32 +0000 (17:35 +0200)]
NFC: Comment in TargetTransformInfo.h reformatted (by Michael Kruse).
Sam McCall [Wed, 1 Apr 2020 14:21:44 +0000 (16:21 +0200)]
[clangd] Support textDocument/semanticTokens/edits
Summary:
This returns incremental highlights as a set of edits against the
previous highlights.
Server-side, we compute the full set of highlights, this just saves
wire-format size.
For now, the diff used is trivial: everything from the first change to
the last change is sent as a single edit.
The wire format is grungy - the replacement offset/length refer to
positions in the encoded array instead of the logical list of tokens.
We use token-oriented structs and translating to LSP forms when serializing.
This departs from LSP (but is consistent with semanticTokens today).
Tested in VSCode insiders (with a patched client to enable experimental
features).
Reviewers: hokein
Subscribers: ilya-biryukov, MaskRay, jkorous, mgrang, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77225
Sam McCall [Wed, 1 Apr 2020 10:02:28 +0000 (12:02 +0200)]
[clangd] Don't send semanticHighlights to clients that support semanticTokens.
Summary: This allows the standard mechanism to gracefully displace the old one.
Reviewers: hokein
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77206
Adam Czachorowski [Thu, 2 Apr 2020 15:29:35 +0000 (17:29 +0200)]
[clangd] Add a tweak for adding "using" statement.
Summary:
This triggers on types and function calls with namespace qualifiers. The
action is to remove the qualifier and instead add a "using" statement at
appropriate place.
It is not always clear where to add the "using" line. Right now we find
the nearest "using" line and add it there, thus keeping with local
convention. If there are no usings, we put it at the deepest relevant
namespace level.
This is an initial version only. There are several improvements that
can be made:
* Support for qualifiers that are not purely namespace (e.g. record
types, etc).
* Removing qualifier from other instances of the same type/call.
* Smarter placement of the "using" line.
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: nridge, mgorny, ilya-biryukov, MaskRay, jkorous, mgrang, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D76432
Benjamin Kramer [Thu, 2 Apr 2020 15:30:47 +0000 (17:30 +0200)]
Revert "[SimplifyLibCalls] Erase replaced instructions"
This reverts commit
2a77544ad5911a38f81c0300385033fced1cc66d. This
introduces a use-after-free in Transforms/InstCombine/sincospi.ll.
Found by asan.
Tyker [Thu, 2 Apr 2020 14:43:38 +0000 (16:43 +0200)]
[NFC] remove delcartion that shouldn't be there
Casey Carter [Thu, 2 Apr 2020 15:01:08 +0000 (08:01 -0700)]
[libc++][test] Update _LIBCPP_SUPPRESS_DEPRECATED_(PUSH|POP)
... in `msvc_stdlib_force_include.h` to also ignore new MSVC warning C5215 "'%s' a function parameter with volatile qualified type is deprecated in C++20". Since we're touching it, also update from non-standard `__pragma(meow)` to standard `_Pragma("meow")`.
Gabor Marton [Thu, 2 Apr 2020 14:59:02 +0000 (16:59 +0200)]
[analyzer] StdLibraryFunctionsChecker: fix bug with arg constraints
Summary:
Previously we induced a state split if there were multiple argument
constraints given for a function. This was because we called
`addTransition` inside the for loop.
The fix is to is to store the state and apply the next argument
constraint on that. And once the loop is finished we call `addTransition`.
Reviewers: NoQ, Szelethus, baloghadamsoftware
Subscribers: whisperity, xazax.hun, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, gamesh411, C
Tags: #clang
Differential Revision: https://reviews.llvm.org/D76790
Kadir Cetinkaya [Thu, 2 Apr 2020 14:51:59 +0000 (16:51 +0200)]
[clangd] Get rid of redundant make_uniques
Louis Dionne [Mon, 30 Mar 2020 19:53:16 +0000 (15:53 -0400)]
[libc++] Reimplement the dynamic filesystem helper without using Python
This patch reimplements the dynamic filesystem helper using Posix
functionality instead of relying on Python. The primary reason for
doing this is that it allows running the libc++ test suite on devices
that do not have Python.
Differential Revision: https://reviews.llvm.org/D77140
Aaron Ballman [Thu, 2 Apr 2020 14:31:06 +0000 (10:31 -0400)]
Fix several typos in the attribute documentation.
Alexander Lanin [Thu, 2 Apr 2020 14:18:34 +0000 (07:18 -0700)]
[docs] use git diff instead of git format-patch
Uploading output from `git format-patch` fails when version has
more than 2 dots, e.g. git version 2.24.1.windows.2 which is
currently recommended by e.g. GitExtensions or 2.24.1.rc on Linux.
Differential Revision: https://reviews.llvm.org/D72374
scentini [Thu, 2 Apr 2020 14:14:17 +0000 (16:14 +0200)]
Add OMPIterator case in switch statement to silence warnings
Jonas Paulsson [Wed, 1 Apr 2020 11:20:47 +0000 (13:20 +0200)]
[SystemZ] Add isCommutable flag on vector instructions.
This does not change much in code generation, but in rare cases MachineCSE
can figure out that an instruction is redundant after commuting it.
Review: Ulrich Weigand
Ed Maste [Thu, 2 Apr 2020 04:12:01 +0000 (00:12 -0400)]
[lldb] update eArgTypeScriptLang description to mention lua
--script-language python and --script-language lua are both valid now.
Reviewed by: JDevlieghere
Differential Revision: https://reviews.llvm.org/D77241
Raul Tambre [Thu, 2 Apr 2020 13:34:02 +0000 (09:34 -0400)]
[libc++] Fix linking libc++abi in standalone builds
In standalone builds the cxxabi_shared and cxxabi_static targets don't exist.
We need to link against the library itself.
Differential Revision: https://reviews.llvm.org/D77294
Sanjay Patel [Thu, 2 Apr 2020 13:09:17 +0000 (09:09 -0400)]
Revert "[InstCombine] do not exclude min/max from icmp with casted operand fold"
This reverts commit
f2fbdf76d8d07f6a0fbd97825cbc533660d64a37.
As noted in the post-commit thread:
https://reviews.llvm.org/rGf2fbdf76d8d0
...this can obscure a min/max pattern where the components
have extra uses. We can show that the problem is independent
of this change with a slightly modified source example, so
this revert just delays/reduces the need to fix the real
problem.
We need to improve our analysis of negation or -- more
generally -- subtraction using patches like D77230 or D68408.
Tyker [Thu, 2 Apr 2020 11:41:24 +0000 (13:41 +0200)]
[NFC] Split Knowledge retention and place it more appropriatly
Summary:
Splitting Knowledge retention into Queries in Analysis and Builder into Transform/Utils
allows Queries and Transform/Utils to use Analysis.
Reviewers: jdoerfert, sstefan1
Reviewed By: jdoerfert
Subscribers: mgorny, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77171
Jonas Paulsson [Thu, 31 Oct 2019 15:05:58 +0000 (16:05 +0100)]
[LoopDataPrefetch + SystemZ] Let target decide on prefetching for each loop.
This patch adds
- New arguments to getMinPrefetchStride() to let the target decide on a
per-loop basis if software prefetching should be done even with a stride
within the limit of the hw prefetcher.
- New TTI hook enableWritePrefetching() to let a target do write prefetching
by default (defaults to false).
- In LoopDataPrefetch:
- A search through the whole loop to gather information before emitting any
prefetches. This way the target can get information via new arguments to
getMinPrefetchStride() and emit prefetches more selectively. Collected
information includes: Does the loop have a call, how many memory
accesses, how many of them are strided, how many prefetches will cover
them. This is NFC to before as long as the target does not change its
definition of getMinPrefetchStride().
- If a previous access to the same exact address was 'read', and the
current one is 'write', make it a 'write' prefetch.
- If two accesses that are covered by the same prefetch do not dominate
each other, put the prefetch in a block that dominates both of them.
- If a ConstantMaxTripCount is less than ItersAhead, then skip the loop.
- A SystemZ implementation of getMinPrefetchStride().
Review: Ulrich Weigand, Michael Kruse
Differential Revision: https://reviews.llvm.org/D70228
Kang Zhang [Thu, 2 Apr 2020 12:47:35 +0000 (12:47 +0000)]
[NFC][PowerPC] Using update_llc_test_checks.py to update atomics-regression.ll
Pavel Labath [Thu, 2 Apr 2020 12:40:59 +0000 (14:40 +0200)]
[lldb] Change Communication::SetConnection to take a unique_ptr
The function takes ownership of the object. This makes that explicit,
and avoids unowned pointers floating around.
Alexey Bataev [Wed, 1 Apr 2020 19:06:38 +0000 (15:06 -0400)]
[OPENMP50]Add initial support for OpenMP 5.0 iterator.
Added basic parsing/semantic analysis/(de)serialization support for
iterator expression introduced in OpenMP 5.0.
Oliver Stannard [Thu, 2 Apr 2020 12:09:57 +0000 (13:09 +0100)]
Revert "[lld] Initial commit for new Mach-O backend"
This is causing buildbot failures on 32-bit hosts, for example:
http://lab.llvm.org:8011/builders/clang-cmake-armv8-lld/builds/3636
This reverts commit
03f43b3aca363e16c45d8733400fd0083b1af4d8.
Sven van Haastregt [Thu, 2 Apr 2020 12:18:56 +0000 (13:18 +0100)]
[OpenCL] Add sub-group builtin functions
Add the sub-group builtin functions from the OpenCL Extension
specification. This patch excludes the sub_group_barrier builtins
that take argument types not yet handled by the
`-fdeclare-opencl-builtins` machinery.
Co-authored-by: Pierre Gondois <pierre.gondois@arm.com>
Sanjay Patel [Thu, 2 Apr 2020 12:12:24 +0000 (08:12 -0400)]
[PhaseOrdering] add test for vector trunc; NFC
See discussion in D76983.
Sanjay Patel [Wed, 1 Apr 2020 19:29:51 +0000 (15:29 -0400)]
[InstCombine] add tests for disguised vector trunc; NFC
Stefanos Baziotis [Thu, 2 Apr 2020 11:53:18 +0000 (14:53 +0300)]
[LoopTerminology] Make term names bold
Differential Revision: https://reviews.llvm.org/D77151
LLVM GN Syncbot [Thu, 2 Apr 2020 11:15:00 +0000 (11:15 +0000)]
[gn build] Port
5e508b9bac0
Djordje Todorovic [Thu, 2 Apr 2020 08:58:27 +0000 (10:58 +0200)]
[llvm-dwarfdump] Add the --show-sections-sizes option
Add an option to llvm-dwarfdump to calculate the bytes within
the debug sections. Dump this numbers when using --statistics
option as well.
This is an initial patch (e.g. we should support other units,
since we only support 'bytes' now).
Differential Revision: https://reviews.llvm.org/D74205
Simon Pilgrim [Thu, 2 Apr 2020 11:01:47 +0000 (12:01 +0100)]
Fix "result of 32-bit shift implicitly converted to 64 bits" MSVC warning. NFCI.
The shift of 1 by an amount that is never more than 31 means that the warning is a false positive but is safe and fixes Werror builds.
Lucas Prates [Fri, 27 Mar 2020 11:53:49 +0000 (11:53 +0000)]
[Clang][CodeGen] Fixing mismatch between memory layout and const expressions for oversized bitfields
Summary:
The construction of constants for structs/unions was conflicting the
expected memory layout for over-sized bit-fields. When building the
necessary bits for those fields, clang was ignoring the size information
computed for the struct/union memory layout and using the original data
from the AST's FieldDecl information. This caused an issue in big-endian
targets, where the field's contant was incorrectly misplaced due to
endian calculations.
This patch aims to separate the constant value from the necessary
padding bits, using the proper size information for each one of them.
With this, the layout of constants for over-sized bit-fields matches the
ABI requirements.
Reviewers: rsmith, eli.friedman, efriedma
Reviewed By: efriedma
Subscribers: efriedma, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77048
Daniel Kiss [Thu, 2 Apr 2020 10:10:41 +0000 (12:10 +0200)]
[clang][AARCH64] Add __ARM_FEATURE_{PAC, BTI}_DEFAULT defines
Summary:
As defined by Arm C Language Extensions (ACLE) these macro defines
should be set to specific values depending on -mbranch-protection.
Reviewers: chill
Reviewed By: chill
Subscribers: danielkiss, cfe-commits, kristof.beyls
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77134
Alex Zinenko [Mon, 30 Mar 2020 16:50:42 +0000 (18:50 +0200)]
[mlir] LLVMFuncOp: provide a capability to pass attributes through to LLVM IR
Summary:
LLVM IR functions can have arbitrary attributes attached to them, some of which
affect may affect code transformations. Until we can model all attributes
consistently, provide a pass-through mechanism that forwards attributes from
the LLVMFuncOp in MLIR to LLVM IR functions during translation. This mechanism
relies on LLVM IR being able to recognize string representations of the
attributes and performs some additional checking to avoid hitting assertions
within LLVM code.
Differential Revision: https://reviews.llvm.org/D77072
Simon Pilgrim [Thu, 2 Apr 2020 10:40:24 +0000 (11:40 +0100)]
[llvm-mca] Cleanup unnecessary includes from headers
This removes some includes/forward-declarations that don't seem to be necessary in the MCA core headers
Based off a cppclean report
Differential Revision: https://reviews.llvm.org/D77073
Dmitry Vyukov [Thu, 2 Apr 2020 10:46:28 +0000 (12:46 +0200)]
tsan: don't check libc dependency on FreeBSD
This check fails on FreeBSD:
https://github.com/golang/go/issues/14481#issuecomment-
607471193
It is meant to prevent regressions, so disable it on FreeBSD.
LLVM GN Syncbot [Thu, 2 Apr 2020 10:21:22 +0000 (10:21 +0000)]
[gn build] Port
d1705c1196f
LLVM GN Syncbot [Thu, 2 Apr 2020 10:21:21 +0000 (10:21 +0000)]
[gn build] Port
d08fadd6628
Nico Weber [Thu, 2 Apr 2020 10:16:52 +0000 (06:16 -0400)]
[gn build] remove NOSORT from clang/Headers/BUILD.gn
Having the sync script work for this file seems better
than matching the order of headers in the cmake file.
Also, not having to manually sort the list is nice, even
if gn's automated sorting doesn't quite match the artisanal
order in the cmake file.
Kang Zhang [Thu, 2 Apr 2020 10:16:02 +0000 (10:16 +0000)]
[NFC][PowerPC] Add a new test case loop-comment.ll