Martin Storsjo [Wed, 18 Apr 2018 17:34:29 +0000 (17:34 +0000)]
[MinGW] Try to fix asan testing after r330244
Twines shouldn't be stored as they can refer to temporaries.
llvm-svn: 330277
Amara Emerson [Wed, 18 Apr 2018 17:10:19 +0000 (17:10 +0000)]
[AArch64] Add isel pattern for v8i8->v2f32 NVCASTs.
rdar://
39454635
llvm-svn: 330276
Jonas Devlieghere [Wed, 18 Apr 2018 17:08:49 +0000 (17:08 +0000)]
[LIT] Have lit run the lldb test suite
This is the first in what will hopefully become a series of patches to
replace the driver logic in dotest.py with LIT. The motivation for this
change is that there's no point in maintaining two driver
implementations. Since all of the LLVM projects are using lit, this is
the obvious choice.
Obviously the goal is maintain full compatibility with the functionality
offered by dotest. As such we won't be removing anything until that
point has been reached.
This patch is the initial attempt (referred to as v1) to run the lldb
test suite with lit. To do so we introduced a custom LLDB test format
that invokes dotest.py with a single test file.
Differential revision: https://reviews.llvm.org/D45333
llvm-svn: 330275
Alex Bradbury [Wed, 18 Apr 2018 16:43:03 +0000 (16:43 +0000)]
[RISCV] Add specific tests for materialising imm32hi20 constants
i.e. constants that can be materialised with a single lui, as the lower 12
bits are zero.
llvm-svn: 330274
Lei Huang [Wed, 18 Apr 2018 16:34:22 +0000 (16:34 +0000)]
[Power9]Legalize and emit code for converting (Un)Signed Word to Quad-Precision
Legalize and emit code for converting (Un)Signed Word to quad-precision via:
xscvsdqp
xscvudqp
Differential Revision: https://reviews.llvm.org/D45389
llvm-svn: 330273
Alexey Bataev [Wed, 18 Apr 2018 16:31:09 +0000 (16:31 +0000)]
[NVPTX] Emit debug info in DWARF-2 by default for Cuda devices.
Summary:
NVPTX target supports debug info in DWARF-2 format. Patch adds emission
of debug info in DWARF-2 by default.
Reviewers: tra, jlebar
Subscribers: aprantl, JDevlieghere, cfe-commits
Differential Revision: https://reviews.llvm.org/D42581
llvm-svn: 330272
Alexey Bataev [Wed, 18 Apr 2018 16:13:41 +0000 (16:13 +0000)]
[DEBUG] Initial adaptation of NVPTX target for debug info emission.
Summary:
Patch adds initial emission of the debug info for NVPTX target.
Currently, only .file and .loc directives are emitted, everything else is
commented out to not break the compilation of Cuda.
Reviewers: echristo, jlebar, tra, jholewinski
Subscribers: mgorny, aprantl, JDevlieghere, llvm-commits
Differential Revision: https://reviews.llvm.org/D41827
llvm-svn: 330271
Alexey Bataev [Wed, 18 Apr 2018 15:57:46 +0000 (15:57 +0000)]
[OPENMP] Code cleanup and code improvements.
llvm-svn: 330270
Chandler Carruth [Wed, 18 Apr 2018 15:52:50 +0000 (15:52 +0000)]
[x86] Switch EFLAGS copy lowering to use reg-reg form of testing for
a zero register.
Previously I tried this and saw LLVM unable to transform this to fold
with memory operands such as spill slot rematerialization. However, it
clearly works as shown in this patch. We turn these into `cmpb $0,
<mem>` when useful for folding a memory operand without issue. This form
has no disadvantage compared to `testb $-1, <mem>`. So overall, this is
likely no worse and may be slightly smaller in some cases due to the
`testb %reg, %reg` form.
Differential Revision: https://reviews.llvm.org/D45475
llvm-svn: 330269
Kostya Kortchinsky [Wed, 18 Apr 2018 15:30:08 +0000 (15:30 +0000)]
[sanitizer] Minor refactor of ThreadDescriptorSize
Summary:
While I was sifting through dead code findings, I stumbled on this function.
First, for `__s390__` it always returned 0 for the 1st call, which doesn't seem
right. 2nd call & beyond would return the correct value though.
Then it duplicated the `atomic_store` multiple times, sometimes with a `if`,
sometimes without. Finally it used a capitalized variable name starting with `k`
which indicates a constant, and it is not.
So:
- rename the static global variable;
- change the atomic functions to their relaxed version;
- move the store to the end, and make sure we return `val` all the time.
Reviewers: alekseyshl, eugenis, koriakin
Reviewed By: alekseyshl
Subscribers: kubamracek, delcypher, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D45725
llvm-svn: 330268
Jonas Devlieghere [Wed, 18 Apr 2018 15:26:51 +0000 (15:26 +0000)]
[llvm-mca] Use WithColor for printing errors
Use convenience helpers in WithColor to print errors and notes.
Differential revision: https://reviews.llvm.org/D45666
llvm-svn: 330267
Aaron Smith [Wed, 18 Apr 2018 15:26:26 +0000 (15:26 +0000)]
[support] Revert the changes made to Path.inc for the default Windows code page
Path.inc/widenPath tries to decode the path using both UTF-8 and the default Windows code page.
This is no longer necessary with the new InitLLVM method which ensures that the command line
arguemnts are already UTF-8 on Windows.
llvm-svn: 330266
Pavel Labath [Wed, 18 Apr 2018 15:23:21 +0000 (15:23 +0000)]
Fix macosx build broken by r330249
It seems llc crashes when targetting darwin with split-dwarf (pr37164).
This happens on all inputs, not just the one I added in the above
commit. Work around the issue by hardcoding the target triple to linux,
which is what all split-dwarf tests seem to be doing.
As I don't know of a way to specify the os part of the triple without
spelling out the architecture as well, I move the new test to the X86
folder.
llvm-svn: 330265
Chandler Carruth [Wed, 18 Apr 2018 15:13:16 +0000 (15:13 +0000)]
[x86] Fix PR37100 by teaching the EFLAGS copy lowering to rewrite uses
across basic blocks in the limited cases where it is very straight
forward to do so.
This will also be useful for other places where we do some limited
EFLAGS propagation across CFG edges and need to handle copy rewrites
afterward. I think this is rapidly approaching the maximum we can and
should be doing here. Everything else begins to require either heroic
analysis to prove how to do PHI insertion manually, or somehow managing
arbitrary PHI-ing of EFLAGS with general PHI insertion. Neither of these
seem at all promising so if those cases come up, we'll almost certainly
need to rewrite the parts of LLVM that produce those patterns.
We do now require dominator trees in order to reliably diagnose patterns
that would require PHI nodes. This is a bit unfortunate but it seems
better than the completely mysterious crash we would get otherwise.
Differential Revision: https://reviews.llvm.org/D45673
llvm-svn: 330264
Simon Pilgrim [Wed, 18 Apr 2018 14:46:54 +0000 (14:46 +0000)]
[llvm-exegesis] Early out if the scheduler models have no extra info.
We were calling getExtraProcessorInfo() without checking hasExtraProcessorInfo(), resulting in an assertion.
llvm-svn: 330263
Jonas Devlieghere [Wed, 18 Apr 2018 14:42:33 +0000 (14:42 +0000)]
[llvm-profdata] Use WithColor for printing errors
Use convenience helpers in WithColor to print errors and warnings.
Differential revision: https://reviews.llvm.org/D45658
llvm-svn: 330262
Jonas Devlieghere [Wed, 18 Apr 2018 14:41:47 +0000 (14:41 +0000)]
[llvm-link] Use WithColor for printing errors
Use convenience helpers in WithColor to print errors and warnings.
Differential revision: https://reviews.llvm.org/D45667
llvm-svn: 330261
Simon Pilgrim [Wed, 18 Apr 2018 14:22:33 +0000 (14:22 +0000)]
[llvm-exegesis] Use LLVMTargetMachine pointer everywhere. NFCI.
Avoid calling the unique_ptr multiple times.
llvm-svn: 330260
Sanjay Patel [Wed, 18 Apr 2018 14:21:31 +0000 (14:21 +0000)]
[SimplifyLibcalls] Realloc(null, N) -> Malloc(N)
Patch by Dávid Bolvanský!
Differential Revision: https://reviews.llvm.org/D45413
llvm-svn: 330259
Simon Pilgrim [Wed, 18 Apr 2018 13:58:41 +0000 (13:58 +0000)]
[llvm-exegesis] Put a newline at the end of each error report.
Makes multiple error messages much easier to read.
llvm-svn: 330258
David Stuttard [Wed, 18 Apr 2018 13:53:31 +0000 (13:53 +0000)]
[AMDGPU] Fix issues for backend divergence tracking
Summary:
A change to use divergence analysis in the AMDGPU backend was getting formal
arguments incorrect (not tagged as divergent) unless they were VGPR0, VGPR1 or
VGPR2
For graphics shaders it is possible to have more than these passed in as VGPR
Modified the checking code to check for any VGPR registers passed in as formal
arguments.
Also, some intrinsics that are sources of divergence may have been lowered
during instruction selection and are missed on subsequent calls to
isSDNodeSourceOfDivergence - added the relevant AMDGPUISD checks as well.
Finally, the FunctionLoweringInfo tracks virtual registers that are live across
basic block boundaries. This is used to check for divergence of CopyFromRegister
registers using the DivergenceAnalysis analysis. For multiple blocks the lazily
evaluated inverted map VirtReg2Value was not cleared when the ValueMap map was.
Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D45372
Change-Id: I112f3bd6dfe0f62e63ce9b43b893982778e4bee3
llvm-svn: 330257
Sam Parker [Wed, 18 Apr 2018 13:50:28 +0000 (13:50 +0000)]
[IRCE] Only check for NSW on equality predicates
After investigation discussed in D45439, it would seem that the nsw
flag restriction is unnecessary in most cases. So the IsInductionVar
lambda has been removed, the functionality extracted, and now only
require nsw when using eq/ne predicates.
Differential Revision: https://reviews.llvm.org/D45617
llvm-svn: 330256
Simon Pilgrim [Wed, 18 Apr 2018 13:39:03 +0000 (13:39 +0000)]
[llvm-exegesis] Pull out LLVMTargetMachine to simplify debugging. NFCI.
Has been useful while trying to get around all the error reporting issues mentioned on PR37049.
llvm-svn: 330255
Jan Korous [Wed, 18 Apr 2018 13:38:39 +0000 (13:38 +0000)]
[Sema] Disable built-in increment operator for bool in overload resolution in C++17
Following: https://llvm.org/svn/llvm-project/cfe/trunk@329804
For C++17 the wording of [over.built] p4 excluded bool:
For every pair (T , vq), where T is an arithmetic type other than bool, there exist
candidate operator functions of the form
vq T & operator++(vq T &);
T operator++(vq T &, int);
Differential Revision: https://reviews.llvm.org/D45569
llvm-svn: 330254
Momchil Velikov [Wed, 18 Apr 2018 13:37:12 +0000 (13:37 +0000)]
Add tests for shrink wrapping and VLAs
Differential revision: https://reviews.llvm.org/D45727
llvm-svn: 330253
Teresa Johnson [Wed, 18 Apr 2018 13:25:23 +0000 (13:25 +0000)]
[gold] Add support for optimization remarks
Summary:
Adds support for LTO opt remarks (optionally with hotness) to
gold-plugin.
Reviewers: anemet
Subscribers: fhahn, mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D45752
llvm-svn: 330252
Pavel Labath [Wed, 18 Apr 2018 13:13:27 +0000 (13:13 +0000)]
[cmake] Improve pthread_[gs]etname_np detection code
Summary:
Due to some android peculiarities, in some build configurations
(statically linked executables targeting older releases) we could detect
the presence of these functions (because they are present in libc.a,
where check_library_exists searches), but then fail to build because the
headers did not include the definition.
This attempts to remedy that by upgrading the check_library_exists to
check_symbol_exists, which will check that the function is declared too.
I am hoping that a more thorough check will make the messy #ifdef we
have accumulated in the code obsolete, so I optimistically try to remove
them.
Reviewers: zturner, kparzysz, danalbert
Subscribers: srhines, mgorny, krytarowski, llvm-commits
Differential Revision: https://reviews.llvm.org/D45359
llvm-svn: 330251
Florian Hahn [Wed, 18 Apr 2018 12:29:24 +0000 (12:29 +0000)]
[LoopUnroll] Only peel if a predicate becomes known in the loop body.
If a predicate does not become known after peeling, peeling is unlikely
to be beneficial.
Reviewers: mcrosier, efriedma, mkazantsev, junbuml
Reviewed By: mkazantsev
Differential Revision: https://reviews.llvm.org/D44983
llvm-svn: 330250
Pavel Labath [Wed, 18 Apr 2018 12:11:59 +0000 (12:11 +0000)]
[CodeGen/Dwarf] Make debug_names compatible with split-dwarf
Summary:
Previously we crashed for the combination of the two features because we
tried to reference the dwo CU from the main object file. The fix
consists of two items:
- reference the skeleton CU from the name index (the consumer is
expected to use the skeleton CU to find the real data).
- use the main object file string pool for the strings in the index
Reviewers: JDevlieghere, aprantl, dblaikie
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D45566
llvm-svn: 330249
Ivan A. Kosarev [Wed, 18 Apr 2018 12:02:49 +0000 (12:02 +0000)]
Revert r330195 "[NEON] Define vget_high_f16() and vget_low_f16() intrinsics in AArch64 mode only".
Differential Revision: https://reviews.llvm.org/D45668
llvm-svn: 330248
Pavel Labath [Wed, 18 Apr 2018 11:56:21 +0000 (11:56 +0000)]
Report more precise error message when attach fails
Summary:
If the remote stub sends a specific error message instead of just a E??
code, we can use this to display a more informative error message
instead of just the generic "unable to attach" message.
I write a test for this using the SB API.
On the console this will show up like:
(lldb) process attach ...
error: attach failed: <STUB-MESSAGE>
if the stub supports error messages, or:
error: attach failed: Error ??
if it doesn't.
Reviewers: jingham, JDevlieghere
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D45573
llvm-svn: 330247
Greg Bedwell [Wed, 18 Apr 2018 10:27:45 +0000 (10:27 +0000)]
[UpdateTestChecks] Add update_mca_test_checks.py script
This script can be used to regenerate tests in the
test/tools/llvm-mca directory (PR36904).
Regenerated a number of tests using the pattern: test/tools/llvm-mca/*/*/*.s
Differential Revision: https://reviews.llvm.org/D45369
llvm-svn: 330246
Haojian Wu [Wed, 18 Apr 2018 08:54:28 +0000 (08:54 +0000)]
[clang-tidy] Fix clang-tidy doesn't read .clangtidy configuration file.
Summary: Fix https://bugs.llvm.org/show_bug.cgi?id=34900.
Reviewers: alexfh
Reviewed By: alexfh
Subscribers: JonasToth, klimek, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D45697
llvm-svn: 330245
Martin Storsjo [Wed, 18 Apr 2018 08:47:26 +0000 (08:47 +0000)]
[MinGW] Look for a cross sysroot relative to the clang binary
If found, prefer this over looking for a similar gcc later in the
system path.
Differential Revision: https://reviews.llvm.org/D45504
llvm-svn: 330244
Bjorn Pettersson [Wed, 18 Apr 2018 08:08:04 +0000 (08:08 +0000)]
[DebugInfo] Sink related dbg users when sinking in InstCombine
Summary:
When sinking an instruction in InstCombine we now also sink
the DbgInfoIntrinsics that are using the sunken value.
Example)
When sinking the load in this input
bb.X:
%0 = load i64, i64* %start, align 4, !dbg !31
tail call void @llvm.dbg.value(metadata i64 %0, ...)
br i1 %cond, label %for.end, label %for.body.lr.ph
for.body.lr.ph:
br label %for.body
we now also move the dbg.value, like this
bb.X:
br i1 %cond, label %for.end, label %for.body.lr.ph
for.body.lr.ph:
%0 = load i64, i64* %start, align 4, !dbg !31
tail call void @llvm.dbg.value(metadata i64 %0, ...)
br label %for.body
In the past we haven't moved the dbg.value so we got
bb.X:
tail call void @llvm.dbg.value(metadata i64 %0, ...)
br i1 %cond, label %for.end, label %for.body.lr.ph
for.body.lr.ph:
%0 = load i64, i64* %start, align 4, !dbg !31
br label %for.body
So in the past we got a debug-use before the def of %0.
And that dbg.value was also on the path jumping to %for.end, for
which %0 never was defined.
CodeGenPrepare normally comes to rescue later (when not moving
the dbg.value), since it moves dbg.value instrinsics quite
brutally, without really analysing if it is correct to move
the intrinsic (see PR31878).
So at the moment this patch isn't expected to have much impact,
besides that it is moving the dbg.value already in opt, making
the IR look more sane directly.
This can be seen as a preparation to (hopefully) make it possible
to turn off CodeGenPrepare::placeDbgValues later as a solution
to PR31878.
I also adjusted test/DebugInfo/X86/sdagsplit-1.ll to make the
IR in the test case up-to-date with this behavior in InstCombine.
Reviewers: rnk, vsk, aprantl
Reviewed By: vsk, aprantl
Subscribers: mattd, JDevlieghere, llvm-commits
Tags: #debug-info
Differential Revision: https://reviews.llvm.org/D45425
llvm-svn: 330243
Matt Davis [Wed, 18 Apr 2018 07:58:45 +0000 (07:58 +0000)]
[NFC] Remove doxygen brief tag from BasicBlock.h
Summary: Documentation is built using the AutoBrief configuration option in docs/doxygen.cfg.in. This change removes the redundant brief tags from BasicBlock.h. I'm happy to write a sed script and remove all \brief tags as a separate commit later.
Reviewers: aprantl
Reviewed By: aprantl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D45708
llvm-svn: 330242
Craig Topper [Wed, 18 Apr 2018 06:41:25 +0000 (06:41 +0000)]
[X86][Broadwell] Remove some unnecessary InstRW overrides and add some FIXMEs.
llvm-svn: 330241
Bruno Cardoso Lopes [Wed, 18 Apr 2018 06:07:49 +0000 (06:07 +0000)]
[Modules] Turn on system header validation for implicit modules
After r300027 implicit builds might fail when updating the SDK on
darwin. Make validation of system headers default when implicit modules
is on and allow modules to be rebuild when system headers change.
rdar://problem/
19767523
llvm-svn: 330240
Craig Topper [Wed, 18 Apr 2018 06:04:30 +0000 (06:04 +0000)]
[X86] Give CMOV 2 cycle latency on SLM.
llvm-svn: 330239
Craig Topper [Wed, 18 Apr 2018 05:15:24 +0000 (05:15 +0000)]
[X86] Don't crash on bad operand modifiers in inline assembly
Summary: Previously if a modifer was placed on a non-GPR register class we would hit an assert or crash.
Reviewers: echristo
Reviewed By: echristo
Subscribers: eraman, llvm-commits
Differential Revision: https://reviews.llvm.org/D45751
llvm-svn: 330238
Sanjay Patel [Wed, 18 Apr 2018 00:36:40 +0000 (00:36 +0000)]
[InstCombine] peek through bitcasted vector/array pointer GEP operand
The bitcast may be interfering with other combines or vectorization
as shown in PR16739:
https://bugs.llvm.org/show_bug.cgi?id=16739
Most pointer-related optimizations are probably able to look through
this bitcast, but removing the bitcast shrinks the IR, so it's at
least a size savings.
Differential Revision: https://reviews.llvm.org/D44833
llvm-svn: 330237
Bob Haarman [Tue, 17 Apr 2018 23:37:18 +0000 (23:37 +0000)]
Fix lock order inversion between ManagedStatic and Statistic
Summary:
Statistic and ManagedStatic both use mutexes. There was a lock order
inversion where, during initialization, Statistic's mutex would be
held while taking ManagedStatic's, and in llvm_shutdown,
ManagedStatic's mutex would be held while taking Statistic's
mutex. This change causes Statistic's initialization code to avoid
holding its mutex while calling ManagedStatic's methods, avoiding the
inversion.
Reviewers: dsanders, rtereshin
Reviewed By: dsanders
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D45398
llvm-svn: 330236
Peter Collingbourne [Tue, 17 Apr 2018 23:32:33 +0000 (23:32 +0000)]
COFF: Friendlier undefined symbol errors.
Summary:
This change does three things:
- Try to find the file and line number of an undefined symbol
reference by reading codeview debug info.
- Try to find the name of the function or global variable with the
undefined symbol reference by searching the object file's symbol
table.
- Prints the information in the same style as the ELF linker.
Differential Revision: https://reviews.llvm.org/D45467
llvm-svn: 330235
Michael J. Spencer [Tue, 17 Apr 2018 23:30:05 +0000 (23:30 +0000)]
[ELF] Add profile guided section layout
This adds profile guided layout using the Call-Chain Clustering (C³) heuristic
from https://research.fb.com/wp-content/uploads/2017/01/cgo2017-hfsort-final1.pdf .
RFC: [llvm-dev] [RFC] Profile guided section layout
http://lists.llvm.org/pipermail/llvm-dev/2017-June/114178.html
Pass `--call-graph-ordering-file <file>` to read a call graph profile where each
line has the format:
<from symbol> <to symbol> <call count>
Differential Revision: https://reviews.llvm.org/D36351
llvm-svn: 330234
Peter Collingbourne [Tue, 17 Apr 2018 23:28:52 +0000 (23:28 +0000)]
Reland r330223, "COFF: Merge .idata, .didat and .edata into .rdata by default.", which was reverted in r330228.
In this reland I removed an unnecessary use of /debug in the test
delayimports32.test and used the /pdbaltpath flag in the test
pdb-publics-import.test, both of which avoid embedding absolute PDB
paths in executables which could affect later RVAs.
Original commit message:
> COFF: Merge .idata, .didat and .edata into .rdata by default.
>
> This saves a little space and matches what link.exe does.
>
> Tested using the chromium Windows trybots:
> https://chromium-review.googlesource.com/c/chromium/src/+/1014784
Differential Revision: https://reviews.llvm.org/D45737
llvm-svn: 330233
Peter Collingbourne [Tue, 17 Apr 2018 23:28:38 +0000 (23:28 +0000)]
COFF: Implement /pdbaltpath flag.
I needed to revert r330223 because we were embedding an absolute PDB
path in the .rdata section, which ended up being laid out before the
.idata section and affecting its RVAs. This flag will let us control
the embedded path.
Differential Revision: https://reviews.llvm.org/D45747
llvm-svn: 330232
Keith Wyss [Tue, 17 Apr 2018 23:19:23 +0000 (23:19 +0000)]
[XRay][compiler-rt] Add noop patch functions for unsupported arches.
Summary:
Typed event patching is implemented for x86-64, but functions must
be defined for other arches.
Reviewers: dberris, pelikan
Subscribers: nemanjai, javed.absar, delcypher, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D45749
llvm-svn: 330231
Stanislav Mekhanoshin [Tue, 17 Apr 2018 23:09:05 +0000 (23:09 +0000)]
[AMDGPU] Enabled v2.16 literals for VOP3P
Literal encoding needs op_sel_hi to select low 16 bit in this case.
Differential Revision: https://reviews.llvm.org/D45745
llvm-svn: 330230
Junmo Park [Tue, 17 Apr 2018 22:38:40 +0000 (22:38 +0000)]
[AAch64] Add the __ARM_FEATURE_DOTPROD macro definition
This matches what GCC does.
https://github.com/gcc-mirror/gcc/blob/master/gcc/config/aarch64/aarch64-c.c
Differential Revision: https://reviews.llvm.org/D45544
llvm-svn: 330229
Peter Collingbourne [Tue, 17 Apr 2018 22:16:39 +0000 (22:16 +0000)]
Revert r330223, "COFF: Merge .idata, .didat and .edata into .rdata by default."
Seems to have uncovered some sort of non-determinism on the bots.
llvm-svn: 330228
Vedant Kumar [Tue, 17 Apr 2018 22:03:08 +0000 (22:03 +0000)]
[Mem2Reg] Create merged debug locations for inserted phis
Track the debug locations of the incoming values to newly-created phis,
and apply merged debug locations to the phis.
A merged location will be on line 0, but will have the correct scope
set. This improves crash reporting when an inlined instruction with a
merged location triggers a machine exception. A debugger will be able to
narrow down the crash to the correct inlined scope, instead of simply
pointing to the outer scope of the caller.
Taken together with a change allows generating merged line-0 locations
for instructions which aren't calls, this results in a 0.5% increase in
the uncompressed size of the .debug_line section of a stage2+Release
build of clang (-O3 -g).
rdar://
33858697
Differential Revision: https://reviews.llvm.org/D45397
llvm-svn: 330227
Vedant Kumar [Tue, 17 Apr 2018 22:03:07 +0000 (22:03 +0000)]
[Mem2Reg] Make RenamePassData a struct, NFC
llvm-svn: 330226
Erich Keane [Tue, 17 Apr 2018 22:00:54 +0000 (22:00 +0000)]
Add Microsoft mangling for _Float16
Enables _Float16 on Windows by creating a mangling
mechanism in MicrosoftMangle. It accomplishes this by
mangling as a structure type of __clang::_Float16, similar
to how Complex works.
Patch By: mibintc
Differential Revision: https://reviews.llvm.org/D45738
llvm-svn: 330225
Alex Bradbury [Tue, 17 Apr 2018 21:56:40 +0000 (21:56 +0000)]
[RISCV] implement li pseudo instruction
The implementation follows the MIPS backend and expands the
pseudo instruction directly during asm parsing. As the result, only
real MC instructions are emitted to the MCStreamer. Additionally,
PseudoLI instructions are emitted during codegen. The actual
expansion to real instructions is performed during MI to MC lowering
and is similar to the expansion performed by the GNU Assembler.
Differential Revision: https://reviews.llvm.org/D41949
Patch by Mario Werner.
llvm-svn: 330224
Peter Collingbourne [Tue, 17 Apr 2018 21:44:31 +0000 (21:44 +0000)]
COFF: Merge .idata, .didat and .edata into .rdata by default.
This saves a little space and matches what link.exe does.
Tested using the chromium Windows trybots:
https://chromium-review.googlesource.com/c/chromium/src/+/1014784
Differential Revision: https://reviews.llvm.org/D45737
llvm-svn: 330223
Peter Collingbourne [Tue, 17 Apr 2018 21:44:17 +0000 (21:44 +0000)]
llvm-pdbutil: Fix an off-by-one error.
Differential Revision: https://reviews.llvm.org/D45740
llvm-svn: 330222
Stanislav Mekhanoshin [Tue, 17 Apr 2018 21:40:04 +0000 (21:40 +0000)]
LoadStoreVectorizer crashes due to unsized type
When we skip bitcasts while looking for GEP in LoadSoreVectorizer
we should also verify that the type is sized otherwise we assert
Differential Revision: https://reviews.llvm.org/D45709
llvm-svn: 330221
Keith Wyss [Tue, 17 Apr 2018 21:32:43 +0000 (21:32 +0000)]
[XRay] Add clang builtin for xray typed events.
Summary:
A clang builtin for xray typed events. Differs from
__xray_customevent(...) by the presence of a type tag that is vended by
compiler-rt in typical usage. This allows xray handlers to expand logged
events with their type description and plugins to process traced events
based on type.
This change depends on D45633 for the intrinsic definition.
Reviewers: dberris, pelikan, rnk, eizan
Subscribers: cfe-commits, llvm-commits
Differential Revision: https://reviews.llvm.org/D45716
llvm-svn: 330220
Keith Wyss [Tue, 17 Apr 2018 21:30:29 +0000 (21:30 +0000)]
[XRay] Typed event logging intrinsic
Summary:
Add an LLVM intrinsic for type discriminated event logging with XRay.
Similar to the existing intrinsic for custom events, but also accepts
a type tag argument to allow plugins to be aware of different types
and semantically interpret logged events they know about without
choking on those they don't.
Relies on a symbol defined in compiler-rt patch D43668. I may wait
to submit before I can see demo everything working together including
a still to come clang patch.
Reviewers: dberris, pelikan, eizan, rSerge, timshen
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D45633
llvm-svn: 330219
Keith Wyss [Tue, 17 Apr 2018 21:28:53 +0000 (21:28 +0000)]
Implement trampoline and handler for typed xray event tracing.
Summary:
Compiler-rt support first before defining the __xray_typedevent() lowering in
llvm. I'm looking for some early feedback before I touch much more code.
Reviewers: dberris
Subscribers: delcypher, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D43668
llvm-svn: 330218
Heejin Ahn [Tue, 17 Apr 2018 21:19:21 +0000 (21:19 +0000)]
[WebAssembly] Add an assertion for an invalid CFG
Summary:
It was not easy to provide a test case for D45648 (rL330079) because the bug
didn't manifest itself in the set of currently valid IRs. Added an assertion to
check this faster, thanks to @dblaikie's suggestion.
Reviewers: dblaikie
Subscribers: jfb, dschuff, sbc100, jgravelle-google, llvm-commits, dblaikie
Differential Revision: https://reviews.llvm.org/D45711
llvm-svn: 330217
Rui Ueyama [Tue, 17 Apr 2018 21:09:16 +0000 (21:09 +0000)]
Rename sys::Process::GetArgumentVector -> sys::windows::GetCommandLineArguments
GetArgumentVector (or GetCommandLineArguments) is very Windows-specific.
I think it doesn't make much sense to provide that function from sys::Process.
I also made a change so that the function takes a BumpPtrAllocator
instead of a SpecificBumpPtrAllocator. The latter is the class to call
dtors, but since char * is trivially destructible, we should use the
former class.
Differential Revision: https://reviews.llvm.org/D45641
llvm-svn: 330216
Dan Gohman [Tue, 17 Apr 2018 20:46:42 +0000 (20:46 +0000)]
[WebAssembly] Teach fast-isel to gracefully recover from illegal return types.
Fixes PR36564.
llvm-svn: 330215
Jim Ingham [Tue, 17 Apr 2018 20:44:47 +0000 (20:44 +0000)]
Change PlatformPosix::DoLoadImage to use a UtilityFunction.
That way we won't have to compile a new expression every time we want
dlopen a library.
<rdar://problem/
32626584>
Differential Revision: https://reviews.llvm.org/D45703
llvm-svn: 330214
Dan Albert [Tue, 17 Apr 2018 20:42:07 +0000 (20:42 +0000)]
[Driver] Use the per-API level Android library directories.
Summary:
Android sysroots contain libraries for each OS version, as well as a
handful of unversioned libraries in the typical multiarch directory.
Reviewers: srhines, eugenis, george.burgess.iv
Reviewed By: eugenis
Subscribers: javed.absar, cfe-commits
Differential Revision: https://reviews.llvm.org/D45290
llvm-svn: 330213
Teresa Johnson [Tue, 17 Apr 2018 20:36:51 +0000 (20:36 +0000)]
Require shell for test
Attempt to fix windows bot which doesn't like the "(cd .." invocation
added in r330194:
http://lab.llvm.org:8011/builders/clang-with-thin-lto-windows/builds/8704/steps/stage%202%20check/logs/stdio
llvm-svn: 330212
Jim Ingham [Tue, 17 Apr 2018 20:35:00 +0000 (20:35 +0000)]
Fix the xcode project for the Args -> Utility move.
llvm-svn: 330211
Teresa Johnson [Tue, 17 Apr 2018 20:21:53 +0000 (20:21 +0000)]
Remove unused variable
Fixes unused variable error introduced in r330194.
llvm-svn: 330210
Zachary Turner [Tue, 17 Apr 2018 20:06:43 +0000 (20:06 +0000)]
[llvm-pdbutil] Dump first section contribution for each module.
The DBI stream contains a list of module descriptors. At the
beginning of each descriptor is a structure representing the first
section contribution in the output file for that module. LLD
currently doesn't fill out this structure at all, but link.exe
does. So as a precursor to emitting this data in LLD, we first
need a way to dump it so that it can be checked.
This patch adds support for the dumping, and verifies via a test
that LLD emits bogus information.
llvm-svn: 330208
Jan Vesely [Tue, 17 Apr 2018 19:35:32 +0000 (19:35 +0000)]
powr: Use denormal path only
It's OK to either flush to 0 or return denormal result if the device
does not support denormals. See sec 7.2 and 7.5.3 of OCL specs
Fixes CTS on carrizo and turks.
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewer: Aaron Watry <awatry@gmail.com>
llvm-svn: 330207
Jan Vesely [Tue, 17 Apr 2018 19:35:30 +0000 (19:35 +0000)]
pown: Use denormal path only
It's OK to either flush to 0 or return denormal result if the device
does not support denormals. See sec 7.2 and 7.5.3 of OCL specs
Fixes CTS on carrizo and turks.
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewer: Aaron Watry <awatry@gmail.com>
llvm-svn: 330206
Jan Vesely [Tue, 17 Apr 2018 19:35:28 +0000 (19:35 +0000)]
pow: Use denormal path only
It's OK to either flush to 0 or return denormal result if the device
does not support denormals. See sec 7.2 and 7.5.3 of OCL specs
Fixes CTS on carrizo and turks.
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewer: Aaron Watry <awatry@gmail.com>
llvm-svn: 330205
Craig Topper [Tue, 17 Apr 2018 19:35:19 +0000 (19:35 +0000)]
[X86] Add separate scheduling class for PSADBW instruction.
llvm-svn: 330204
Craig Topper [Tue, 17 Apr 2018 19:35:14 +0000 (19:35 +0000)]
[X86] Remove unnecessary InstRW overrides. Add somes FIXMEs/TODOs.
llvm-svn: 330203
Akira Hatanaka [Tue, 17 Apr 2018 19:13:41 +0000 (19:13 +0000)]
[Sema] Warn about memcpy'ing non-trivial C structs.
Issue a warning when non-trivial C structs are copied or initialized by
calls to memset, bzero, memcpy, or memmove.
rdar://problem/
36124208
Differential Revision: https://reviews.llvm.org/D45310
llvm-svn: 330202
Akira Hatanaka [Tue, 17 Apr 2018 19:05:17 +0000 (19:05 +0000)]
Move the visitor classes that are used to traverse non-trivial C structs
to a header file.
This is in preparation for using the visitor classes to warn about
memcpy'ing non-trivial C structs.
See the discussion here:
https://reviews.llvm.org/D45310
rdar://problem/
36124208
llvm-svn: 330201
Pavel Labath [Tue, 17 Apr 2018 18:53:35 +0000 (18:53 +0000)]
Move Args.cpp from Interpreter to Utility
Summary:
The Args class is used in plenty of places besides the command
interpreter (e.g., anything requiring an argc+argv combo, such as when
launching a process), so it needs to be in a lower layer. Now that the
class has no external dependencies, it can be moved down to the Utility
module.
This removes the last (direct) dependency from the Host module to
Interpreter, so I remove the Interpreter module from Host's dependency
list.
Reviewers: zturner, jingham, davide
Subscribers: mgorny, lldb-commits
Differential Revision: https://reviews.llvm.org/D45480
llvm-svn: 330200
Akira Hatanaka [Tue, 17 Apr 2018 18:41:52 +0000 (18:41 +0000)]
Add a command line option 'fregister_global_dtors_with_atexit' to
register destructor functions annotated with __attribute__((destructor))
using __cxa_atexit or atexit.
Register destructor functions annotated with __attribute__((destructor))
calling __cxa_atexit in a synthesized constructor function instead of
emitting references to the functions in a special section.
The primary reason for adding this option is that we are planning to
deprecate the __mod_term_funcs section on Darwin in the future. This
feature is enabled by default only on Darwin. Users who do not want this
can use command line option 'fno_register_global_dtors_with_atexit' to
disable it.
rdar://problem/
33887655
Differential Revision: https://reviews.llvm.org/D45578
llvm-svn: 330199
Jan Vesely [Tue, 17 Apr 2018 18:11:29 +0000 (18:11 +0000)]
amdgcn/fmin: Fix typos that reduced precision
Not sure how these sneaked in.
Fixes fminD and few other tests(fractD, cosD) on carrizo
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 330198
Jan Vesely [Tue, 17 Apr 2018 18:08:08 +0000 (18:08 +0000)]
exp10: Port from amd builtins
Passes CTS on carrizo and turks.
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed and Tested (on RX 580) by: Aaron Watry <awatry@gmail.com>
llvm-svn: 330197
Craig Topper [Tue, 17 Apr 2018 17:30:06 +0000 (17:30 +0000)]
[X86] Remove -mcpu=skx/knl from some tests and use -mattr instead.
mcpu exposes other tuning flags. These tests are only trying to test instruction set features so it is better to use mattr.
llvm-svn: 330196
Ivan A. Kosarev [Tue, 17 Apr 2018 16:43:07 +0000 (16:43 +0000)]
[NEON] Define vget_high_f16() and vget_low_f16() intrinsics in AArch64 mode only
Differential Revision: https://reviews.llvm.org/D45668
llvm-svn: 330195
Teresa Johnson [Tue, 17 Apr 2018 16:39:25 +0000 (16:39 +0000)]
[ThinLTO] Pass -save-temps to LTO backend for distributed ThinLTO builds
Summary:
The clang driver option -save-temps was not passed to the LTO config,
so when invoking the ThinLTO backends via clang during distributed
builds there was no way to get LTO to save temp files.
Getting this to work with ThinLTO distributed builds also required
changing the driver to avoid a separate compile step to emit unoptimized
bitcode when the input was already bitcode under -save-temps. Not only is
this unnecessary in general, it is problematic for ThinLTO backends since
the temporary bitcode file to the backend would not match the module path
in the combined index, leading to incorrect ThinLTO backend index-based
optimizations.
Reviewers: pcc
Subscribers: mehdi_amini, inglorion, eraman, cfe-commits
Differential Revision: https://reviews.llvm.org/D45217
llvm-svn: 330194
Momchil Velikov [Tue, 17 Apr 2018 16:29:58 +0000 (16:29 +0000)]
Revert "Fix incorrect choice of callee-saved registers save/restore points (take 2)"
Revert in order to fix the test to not run when required targets aren't
configured.
llvm-svn: 330193
Momchil Velikov [Tue, 17 Apr 2018 15:59:06 +0000 (15:59 +0000)]
Fix incorrect choice of callee-saved registers save/restore points (take 2)
Add the accidentally omitted testcase.
Differential revision: https://reviews.llvm.org/D45524
llvm-svn: 330192
Krzysztof Parzyszek [Tue, 17 Apr 2018 15:23:09 +0000 (15:23 +0000)]
[Hexagon] Do not merge initializers for stack and non-stack expressions
Stack addressing needs addressing modes that provide an offset field
immediately following the frame index. An initializer from a non-stack
addressing could force the stack address to use a form that does not
provide an offset field.
llvm-svn: 330191
Kostya Kortchinsky [Tue, 17 Apr 2018 14:54:50 +0000 (14:54 +0000)]
[sanitizer] Remove low-hanging-fruit dead code
Summary:
Going through the dead code findings, the code removed in this CL appears to be
pretty straightforward to remove, and seems to be some leftover from previous
refactors.
Reviewers: alekseyshl, eugenis
Reviewed By: alekseyshl
Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D45704
llvm-svn: 330190
whitequark [Tue, 17 Apr 2018 14:52:43 +0000 (14:52 +0000)]
[LLVM-C] [PR34633] Avoid calling ->dump() methods from LLVMDump*.
LLVMDump* functions are available in Release builds too.
Patch by Brenton Bostick.
Differential Revision: https://reviews.llvm.org/D44600
llvm-svn: 330189
Aaron Ballman [Tue, 17 Apr 2018 14:00:06 +0000 (14:00 +0000)]
Add modifiers for unsigned char and signed char field printing for __builtin_dump_struct.
Patch by Paul Semel.
llvm-svn: 330188
Ivan A. Kosarev [Tue, 17 Apr 2018 13:37:30 +0000 (13:37 +0000)]
[NEON] Fix the architecture condition for the crypto intrinsics
Differential Revision: https://reviews.llvm.org/D45669
llvm-svn: 330187
Nemanja Ivanovic [Tue, 17 Apr 2018 13:07:01 +0000 (13:07 +0000)]
[PowerPC] Mark the BDNZ intrinsic as NoDuplicate
Duplicating this intrinsic is not generally valid because it has the side-effect
of decrementing the CTR. Any passes that duplicate it would need to be taught to
keep the regions formed completely disjoint.
This patch should be NFC for typical uses as CTRLoops runs after the remaining
loop passes. It only affects situations where the loop passes are scheduled on
the IR after the codegen passes (as is the case with some JIT pipelines).
Fixes https://bugs.llvm.org/show_bug.cgi?id=37050
llvm-svn: 330186
Aaron Ballman [Tue, 17 Apr 2018 11:57:47 +0000 (11:57 +0000)]
Add checks for format specifiers used by __builtin_dump_struct and added a new specifier for null-terminated constant strings.
Patch by Paul Semel.
llvm-svn: 330185
Chandler Carruth [Tue, 17 Apr 2018 11:08:05 +0000 (11:08 +0000)]
Add some infuriatingly necessary comments to this test case.
Without these comments, by "luck" the contents of SomeKit's SKWidget.h
are precisely the same as SomeKitCore's SomeKitCore.h. This can create
havoc if anything canonicalizes on the inode and your filesystem assigns
a common inode to files with identical file content. Alternatively, if
your build system uses symlinks into a content-addressed-storage (as
Google's does), you end up with these files being symlinks to the same
file.
The end result is that Clang deduplicates them internally, and then
believes that the SomeKit framework includes the SomeKitCore.h header,
and does not include the SKWidget.h in SomeKit. This in turn results in
warnings in this test and eventually errors as Clang becomes confused
because the umbrella header for SomeKitCore has already been included
into another framework's module (SomeKit). Yay.
If anyone has a better idea about how to avoid this, I'm all ears.
Nothing other than causing the file content to change worked for me.
llvm-svn: 330184
Momchil Velikov [Tue, 17 Apr 2018 08:37:38 +0000 (08:37 +0000)]
Fix incorrect choice of callee-saved registers save/restore points
Make the shrink wrapping pass pay attention to uses/defs of the stack pointer.
Differential revision: https://reviews.llvm.org/D45524
llvm-svn: 330183
Haojian Wu [Tue, 17 Apr 2018 08:34:50 +0000 (08:34 +0000)]
[clangd] Fix "fail to create file URI" warnings in FileIndexTest.
Summary:
When running the FileIndexTest, it shows "Failed to create an URI
for file XXX: not a valid absolute file path" warnings, and the
generated Symbols is missing Location information.
Reviewers: ioeric
Subscribers: klimek, ilya-biryukov, jkorous-apple, MaskRay, cfe-commits
Differential Revision: https://reviews.llvm.org/D45692
llvm-svn: 330182
Philip Pfaffe [Tue, 17 Apr 2018 07:59:46 +0000 (07:59 +0000)]
[NewPM] Update pass registration for the LLVM plugin interface
Summary:
As of rL329273, LLVM has a mechanism to load new-pm plugins in opt. Use
this API in Polly.
Reviewers: grosser, Meinersbur, bollu
Reviewed By: grosser, Meinersbur
Subscribers: lksbhm, bollu, pollydev, llvm-commits
Differential Revision: https://reviews.llvm.org/D45484
llvm-svn: 330181
Michael Zolotukhin [Tue, 17 Apr 2018 07:31:27 +0000 (07:31 +0000)]
Revert "Reapply "[PR16756] Use SSAUpdaterBulk in JumpThreading." again."
This reverts r330175. There are still stage3/stage4 miscompares.
llvm-svn: 330180
Simon Pilgrim [Tue, 17 Apr 2018 07:22:44 +0000 (07:22 +0000)]
[X86] Add FP comparison scheduler classes
Split VCMP/VMAX/VMIN instructions off to WriteFCmp and VCOMIS instructions off to WriteFCom instead of assuming they match WriteFAdd
Differential Revision: https://reviews.llvm.org/D45656
llvm-svn: 330179
Gerolf Hoflehner [Tue, 17 Apr 2018 07:22:34 +0000 (07:22 +0000)]
[DAGCombiner] Fix for oss-fuzz bug
llvm-svn: 330178
Duncan P. N. Exon Smith [Tue, 17 Apr 2018 05:48:36 +0000 (05:48 +0000)]
Fix malformed table introduced by r330174
http://lab.llvm.org:8011/builders/clang-sphinx-docs/builds/23573
llvm-svn: 330177