Rafael Espindola [Fri, 17 Nov 2017 20:06:41 +0000 (20:06 +0000)]
Use TempFile in the implementation of LockFileManager.
This move some of the complexity over to the lower level TempFile.
It also makes it a bit more explicit where errors are ignored since we
now have a call to consumeError.
llvm-svn: 318550
Chandler Carruth [Fri, 17 Nov 2017 19:58:36 +0000 (19:58 +0000)]
[PM/Unswitch] Teach SimpleLoopUnswitch to do non-trivial unswitching,
making it no longer even remotely simple.
The pass will now be more of a "full loop unswitching" pass rather than
anything substantively simpler than any other approach. I plan to rename
it accordingly once the dust settles.
The key ideas of the new loop unswitcher are carried over for
non-trivial unswitching:
1) Fully unswitch a branch or switch instruction from inside of a loop to
outside of it.
2) Update the CFG and IR. This avoids needing to "remember" the
unswitched branches as well as avoiding excessively cloning and
reliance on complex parts of simplify-cfg to cleanup the cfg.
3) Update the analyses (where we can) rather than just blowing them away
or relying on something else updating them.
Sadly, #3 is somewhat compromised here as the dominator tree updates
were too complex for me to want to reason about. I will need to make
another attempt to do this now that we have a nice dynamic update API
for dominators. However, we do adhere to #3 w.r.t. LoopInfo.
This approach also adds an important principls specific to non-trivial
unswitching: not *all* of the loop will be duplicated when unswitching.
This fact allows us to compute the cost in terms of how much *duplicate*
code is inserted rather than just on raw size. Unswitching conditions
which essentialy partition loops will work regardless of the total loop
size.
Some remaining issues that I will be addressing in subsequent commits:
- Handling unstructured control flow.
- Unswitching 'switch' cases instead of just branches.
- Moving to the dynamic update API for dominators.
Some high-level, interesting limitationsV that folks might want to push
on as follow-ups but that I don't have any immediate plans around:
- We could be much more clever about not cloning things that will be
deleted. In fact, we should be able to delete *nothing* and do
a minimal number of clones.
- There are many more interesting selection criteria for which branch to
unswitch that we might want to look at. One that I'm interested in
particularly are a set of conditions which all exit the loop and which
can be merged into a single unswitched test of them.
Differential revision: https://reviews.llvm.org/D34200
llvm-svn: 318549
Peter Collingbourne [Fri, 17 Nov 2017 19:51:20 +0000 (19:51 +0000)]
COFF: Stop emitting a non-standard COFF symbol table into PEs.
Now that our support for PDB emission is reasonably good, there is
no longer a need to emit a COFF symbol table.
Also fix a bug where we would fail to emit a string table for long
section names if /debug was not specified.
Differential Revision: https://reviews.llvm.org/D40189
llvm-svn: 318548
Reid Kleckner [Fri, 17 Nov 2017 19:50:10 +0000 (19:50 +0000)]
All .xdata sections are eligble for ICF
Summary:
Many small functions have identical unwind info because they push the
same sets of CSRs in the same order and have the same stack and prologue
size. The VC linker merges duplicate .xdata, and so should LLD.
This reduces the .xdata section size of clang.exe from 1.8MB to 94KB.
Reviewers: pcc, ruiu
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D40160
llvm-svn: 318547
Peter Collingbourne [Fri, 17 Nov 2017 19:49:41 +0000 (19:49 +0000)]
Enable PDB generation with lld in asan and cfi tests on Windows.
PDB emission now works well enough that we can rely on it for these
tests to pass.
Differential Revision: https://reviews.llvm.org/D40188
llvm-svn: 318546
Ahmed Bougacha [Fri, 17 Nov 2017 19:46:47 +0000 (19:46 +0000)]
[CodeGen] Compute the objc EH vtable address point using inbounds GEP.
The object is provided by the objc runtime and is never visible in the
module itself, but even so, the address point we compute points into it,
and "+16" is guaranteed not to overflow.
This matches the c++ vtable IRGen.
Note that I'm not entirely convinced the 'i8*' type is correct here: at
the IR level, we're accessing memory that's outside the global object.
But we don't control the allocation, so it's not obviously wrong either.
But either way, this is only in a global initializer, so I don't think
it's going to be mucked with. Filed PR35352 to discuss that.
llvm-svn: 318545
Ilya Biryukov [Fri, 17 Nov 2017 19:05:56 +0000 (19:05 +0000)]
[clangd] Release the old preamble before building a new one.
llvm-svn: 318544
Justin Bogner [Fri, 17 Nov 2017 18:51:20 +0000 (18:51 +0000)]
MIRParser: Avoid reading uninitialized memory on generic vregs
If a vreg's bank is specified in the registers block and one of its
defs or uses also specifies the bank, we end up checking that the
RegBank is equal to diagnose conflicting banks. The problem comes up
for generic vregs, where we weren't fully initializing the VRegInfo
when parsing the registers block, so we'd end up comparing a null
pointer to uninitialized memory.
This fixes a non-deterministic failure when round tripping through MIR
with generic vregs.
llvm-svn: 318543
Simon Pilgrim [Fri, 17 Nov 2017 18:35:49 +0000 (18:35 +0000)]
[X86] Merge scheduling tests for SHLD/SHRD
Reduces spsce used and makes it easier to compare the 2 values for the equivalent instructions
llvm-svn: 318541
Volodymyr Sapsai [Fri, 17 Nov 2017 18:28:05 +0000 (18:28 +0000)]
[ThinLTO] Remove too aggressive assertion in building function call graph.
The assertion was introduced in r317853 but there are cases when a call
isn't handled either as direct or indirect. In this case we add a
reference graph edge but not a call graph edge.
Reviewers: tejohnson
Reviewed By: tejohnson
Subscribers: mehdi_amini, inglorion, eraman, hiraditya, efriedma, llvm-commits
Differential Revision: https://reviews.llvm.org/D40056
llvm-svn: 318540
Sam Clegg [Fri, 17 Nov 2017 18:14:09 +0000 (18:14 +0000)]
[WebAssembly] Initial wasm linker implementation
This linker backend is still a work in progress but is
enough to link simple programs including linking against
library archives.
Differential Revision: https://reviews.llvm.org/D34851
llvm-svn: 318539
Eugene Zelenko [Fri, 17 Nov 2017 18:09:48 +0000 (18:09 +0000)]
[AST] Partially revert r318341 to fix two broken tests on llvm-clang-x86_64-expensive-checks-win (NFC).
llvm-svn: 318538
Martin Probst [Fri, 17 Nov 2017 18:06:33 +0000 (18:06 +0000)]
clang-format: remove trailing lines in lamdas and arrow functions.
Summary:
clang-format already removes empty lines at the beginning & end of
blocks:
int x() {
foo(); // lines before and after will be removed.
}
However because lamdas and arrow functions are parsed as expressions,
the existing logic to remove empty lines in UnwrappedLineFormatter
doesn't handle them.
This change special cases arrow functions in ContinuationIndenter to
remove empty lines:
x = []() {
foo(); // lines before and after will now be removed.
};
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D40178
llvm-svn: 318537
Alexey Bataev [Fri, 17 Nov 2017 17:57:25 +0000 (17:57 +0000)]
[OPENMP] Codegen for `target simd` construct.
Added codegen support for `target simd` directive.
llvm-svn: 318536
Rafael Espindola [Fri, 17 Nov 2017 17:46:39 +0000 (17:46 +0000)]
Try to fix the windows build.
llvm-svn: 318535
Rafael Espindola [Fri, 17 Nov 2017 17:33:09 +0000 (17:33 +0000)]
Use TempFile in dsymutil.
I don't think there is any functionality change, but the code is
easier to understand IMHO.
llvm-svn: 318534
Rafael Espindola [Fri, 17 Nov 2017 17:31:20 +0000 (17:31 +0000)]
Revert "[MC] Fix regression tests on Windows when git “core.autocrlf” is set to true."
This reverts commit r318528.
MC/AsmParser/preserve-comments-crlf.s fails on linux.
llvm-svn: 318533
Michal Gorny [Fri, 17 Nov 2017 17:12:14 +0000 (17:12 +0000)]
[CMake] Allow for Solaris ld -V output on stdout
In recent versions of Solaris 11.4 (previously 12), ld -V output went to
stdout instead of stderr. Since AddLLVM.cmake only expects it on stderr,
Solaris ld wasn't properly detected and options not understood by it are
passed during the build.
The following patch fixes this, allowing for both variants.
Tested on i386-pc-solaris2.11.4 (on top of D35755 which is needed for
proper Solaris support).
Patch by Rainer Orth.
Differential Revision: https://reviews.llvm.org/D39601
llvm-svn: 318532
Evandro Menezes [Fri, 17 Nov 2017 16:42:15 +0000 (16:42 +0000)]
[AArch64] Adjust the cost model for Exynos M1 and M2
Improve the accuracy of the model by specifying the proper number of uops.
llvm-svn: 318531
Stephan Bergmann [Fri, 17 Nov 2017 16:34:36 +0000 (16:34 +0000)]
Indent code blocks so they are actually treated as such
llvm-svn: 318530
Dave Lee [Fri, 17 Nov 2017 16:27:21 +0000 (16:27 +0000)]
Fix skipping of flags in getClangStripDependencyFileAdjuster
Summary:
The ArgumentsAdjuster returned from `getClangStripDependencyFileAdjuster` will
skip dependency flags, and also their associated values for those flags that
take an argument. This change corrects the handling of the `-MD` and `-MMD`
flags, which do not take an argument.
Reviewers: saugustine, klimek, alexshap
Reviewed By: alexshap
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D40024
llvm-svn: 318529
Zhen Cao [Fri, 17 Nov 2017 16:17:56 +0000 (16:17 +0000)]
[MC] Fix regression tests on Windows when git “core.autocrlf” is set to true.
Differential Revision: https://reviews.llvm.org/D39737
llvm-svn: 318528
Jonas Hahnfeld [Fri, 17 Nov 2017 15:26:44 +0000 (15:26 +0000)]
[OMPT] Fix inaccuracies in worksharing tests
These tests were failing rarely on my MacBook when there was some
activity in the background. Read: one of a thousand executions?
* sections.c missed the sorting based on thread ids. This worked
as long as the master thread finished its section before the
worker thread started the second one but failed if the master
thread was put to sleep by the OS.
* The checks in single.c assumed that the master thread executes
the single region which works most of the time because it is
usually faster than the newly spawned worker thread.
Differential Revision: https://reviews.llvm.org/D39853
llvm-svn: 318527
Dmitry Preobrazhensky [Fri, 17 Nov 2017 15:15:40 +0000 (15:15 +0000)]
[AMDGPU][MC][GFX9][disassembler] Corrected decoding of op_sel_hi for v_mad_mix*
See bug 35148: https://bugs.llvm.org//show_bug.cgi?id=35148
Reviewers: tamazov, SamWot, arsenm
Differential Revision: https://reviews.llvm.org/D39492
llvm-svn: 318526
Krasimir Georgiev [Fri, 17 Nov 2017 15:10:49 +0000 (15:10 +0000)]
[clang-format] Add text proto filename detection
Summary: Adds text proto filename detection.
Reviewers: klimek
Reviewed By: klimek
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D40120
llvm-svn: 318525
Ben Dunbobbin [Fri, 17 Nov 2017 14:42:18 +0000 (14:42 +0000)]
[Support][CachePruning] Fix regression in pruning interval
Fixed broken comparison.
borked by: rL284966 (see: https://reviews.llvm.org/D25730).
Differential Revision: https://reviews.llvm.org/D40119
This is a second attempt to commit this.
The first attempt broke lld and gold tests that had been written against
the incorrect behaivour.
llvm-svn: 318524
Gabor Horvath [Fri, 17 Nov 2017 12:28:58 +0000 (12:28 +0000)]
[clang-tidy] Fix an oversight after renaming a check
llvm-svn: 318523
Gabor Horvath [Fri, 17 Nov 2017 12:23:30 +0000 (12:23 +0000)]
[clang-tidy] Add a check for undelegated copy of base classes
Finds copy constructors where the constructor don't call
the copy constructor of the base class.
```
class X : public Copyable {
X(const X &other) {} // Copyable(other) is missing
};
```
Differential Revision: https://reviews.llvm.org/D33722
llvm-svn: 318522
Andrew Ng [Fri, 17 Nov 2017 12:00:57 +0000 (12:00 +0000)]
[gold] Fix broken thin LTO cache test NFC
Fix test as it is assuming that the cache pruning is always being
performed by default. Explicitly set prune interval to 0s to ensure
pruning is always performed.
llvm-svn: 318520
George Rimar [Fri, 17 Nov 2017 11:57:47 +0000 (11:57 +0000)]
[ELF] - Teach LLD to use information from .debug_str for error reporting.
Recently we teached LLD to report line numbers for duplicate variables
definitions, though currently LLD is unable to do that for case when
strings are not built in .debug_info, but stored in .debug_str instead.
That is because out LLDDwarfObj does not handle .debug_str yet.
Patch fixes that.
Differential revision: https://reviews.llvm.org/D39542
llvm-svn: 318519
George Rimar [Fri, 17 Nov 2017 11:39:26 +0000 (11:39 +0000)]
[ELF] - Fix BB after r318516
Test did not run under windows because uses zlib.
Content of section changed because now strings
merging is applied.
llvm-svn: 318518
Philip Pfaffe [Fri, 17 Nov 2017 11:34:29 +0000 (11:34 +0000)]
[nfc] Iwyu: forward-declare/include raw_ostream in zone algo
llvm-svn: 318517
George Rimar [Fri, 17 Nov 2017 11:27:57 +0000 (11:27 +0000)]
[ELF] - Allow applying SHF_MERGE optimization for relocatable output.
This fixes PR35223.
Here I enabled SHF_MERGE section content merging for -r like
we do for regular linking.
Differential revision: https://reviews.llvm.org/D40026
llvm-svn: 318516
Manuel Klimek [Fri, 17 Nov 2017 11:17:15 +0000 (11:17 +0000)]
Implement more accurate penalty & trade-offs while breaking protruding tokens.
For each line that we break in a protruding token, compute whether the
penalty of breaking is actually larger than the penalty of the excess
characters. Only break if that is the case.
llvm-svn: 318515
Ilya Biryukov [Fri, 17 Nov 2017 10:09:02 +0000 (10:09 +0000)]
Use llvm-config.h instead of config.h
To fix standalone builds broken by r318411 (config.h is private to llvm).
llvm-svn: 318514
Rui Ueyama [Fri, 17 Nov 2017 08:17:36 +0000 (08:17 +0000)]
Ignore -no-ctors-in-init-array.
Patch by dxf@google.com.
llvm-svn: 318513
Rui Ueyama [Fri, 17 Nov 2017 08:17:21 +0000 (08:17 +0000)]
Add a missing #include.
llvm-svn: 318512
Martin Storsjo [Fri, 17 Nov 2017 08:06:49 +0000 (08:06 +0000)]
[MinGW] Define __ARM_DWARF_EH__ for MinGW/ARM
Since SVN r318510, the MinGW/ARM configuration defaults to
dwarf exception handling.
Differential Revision: https://reviews.llvm.org/D39533
llvm-svn: 318511
Martin Storsjo [Fri, 17 Nov 2017 08:04:40 +0000 (08:04 +0000)]
[ARM] Use dwarf exception handling on MinGW
Enabling and using dwarf exceptions seems like an easier path
to take, than to make the COFF/ARM backend output EHABI directives.
Previously, no EH model was enabled at all on this target.
There's no point in setting UseIntegratedAssembler to false since
GNU binutils doesn't support Windows on ARM, and since we don't
need to support external assembler, we don't need to use register
numbers in cfi directives.
Differential Revision: https://reviews.llvm.org/D39532
llvm-svn: 318510
Craig Topper [Fri, 17 Nov 2017 07:03:57 +0000 (07:03 +0000)]
[SelectionDAG] Allow custom vector widening through ReplaceNodeResults to handle nodes with chain outputs.
Previously we were assuming all results were vectors and calling SetWidenedVector, but if its a chain result we should just replace uses instead.
This fixes an error found by expensive checks after r318368.
llvm-svn: 318509
Max Kazantsev [Fri, 17 Nov 2017 06:49:26 +0000 (06:49 +0000)]
[IRCE] Remove folding of two range checks into RANGE_CHECK_BOTH
The logic of replacing of a couple `RANGE_CHECK_LOWER + RANGE_CHECK_UPPER`
into `RANGE_CHECK_BOTH` in fact duplicates the logic of range intersection which
happens when we calculate safe iteration space. Effectively, the result of intersection of
these ranges doesn't differ from the range of merged range check.
We chose to remove duplicating logic in favor of code simplicity.
Differential Revision: https://reviews.llvm.org/D39589
llvm-svn: 318508
Bruno Cardoso Lopes [Fri, 17 Nov 2017 04:26:07 +0000 (04:26 +0000)]
Change path used in a test from r318503 to work on windows
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/13565
llvm-svn: 318507
Matt Arsenault [Fri, 17 Nov 2017 04:18:26 +0000 (04:18 +0000)]
AMDGPU: Replace list of SMEM buffer opcodes
llvm-svn: 318506
Matt Arsenault [Fri, 17 Nov 2017 04:18:24 +0000 (04:18 +0000)]
AMDGPU: Fix breaking SMEM clauses
This was completely ignoring subregisters,
so was not very useful. Also only break them
if xnack is actually enabled.
llvm-svn: 318505
Eugene Zemtsov [Fri, 17 Nov 2017 03:28:58 +0000 (03:28 +0000)]
Fix LLDB build.
It was broken by r318489.
llvm-svn: 318504
Bruno Cardoso Lopes [Fri, 17 Nov 2017 03:24:11 +0000 (03:24 +0000)]
[PCH+Modules] Improve diagnosticts to help out users pass an extra header search path
When mixing PCH and Implicit Modules, missing a header search path
can lead to the implicit built PCM to complaint about not finding its
matching module map.
Instead of adding more magic to implicit modules engine, add a note to
help the user add the appropriate path.
rdar://problem/
33388847
llvm-svn: 318503
Vedant Kumar [Fri, 17 Nov 2017 02:58:23 +0000 (02:58 +0000)]
[llvm-profdata] Fix a dangling reference to an error string
llvm-svn: 318502
Aditya Nandakumar [Fri, 17 Nov 2017 02:44:55 +0000 (02:44 +0000)]
[GISel]: DCE copy instructions during legalization
We might have instructions such as ext(copy(trunc)), and while cleaning
up legalization artifacts, we can also dce the copies that are in
between legalization artifacts.
llvm-svn: 318501
Jason Molenda [Fri, 17 Nov 2017 01:55:50 +0000 (01:55 +0000)]
Update xcode project file to build new ppc64le files.
llvm-svn: 318500
Vedant Kumar [Fri, 17 Nov 2017 01:48:33 +0000 (01:48 +0000)]
[SelectionDAG] Consolidate (t|T)ransferDbgValues methods, NFC (reapply)
TransferDbgValues (capital 'T') is wired into ReplaceAllUsesWith, and
transferDbgValues (lowercase 't') is used elsewhere (e.g in Legalize).
Both functions should be doing the exact same thing. This patch
consolidates the logic into one place.
This was reverted in r318455 because some newly introduced asserts,
which I thought were NFC, were firing. I filed PR35338. For now I've
weakened the asserts.
Testing: check-llvm, check-clang, and a stage2 Rel+Deb build of clang
Differential Revision: https://reviews.llvm.org/D40104
llvm-svn: 318498
Rafael Espindola [Fri, 17 Nov 2017 01:37:50 +0000 (01:37 +0000)]
Remove IsLocal.
Since we always have Binding in the current symbol design IsLocal is
redundant.
llvm-svn: 318497
Jim Ingham [Fri, 17 Nov 2017 01:22:34 +0000 (01:22 +0000)]
Recognize another magic token sent in the LaunchInfo's EventData.
<rdar://problem/
32505028>
llvm-svn: 318496
Jim Ingham [Fri, 17 Nov 2017 01:19:59 +0000 (01:19 +0000)]
"source list -a" was calling DisplaySourceLinesWithNumbers incorrectly.
The parameters were just passed in the wrong order.
<rdar://problem/
35150446>
llvm-svn: 318495
Justin Lebar [Fri, 17 Nov 2017 01:15:43 +0000 (01:15 +0000)]
[CUDA] Remove implementations of nexttoward.
Summary:
__builtin_nexttoward lowers to a libcall, e.g. nexttowardf(), that CUDA
does not have.
Rather than try to implement it, we simply remove these functions --
nvcc doesn't support them either, and nextafter, which does work, does
essentially the same thing on GPUs, because GPUs don't have long double.
Reviewers: tra
Subscribers: cfe-commits, sanjoy
Differential Revision: https://reviews.llvm.org/D40152
llvm-svn: 318494
Walter Lee [Fri, 17 Nov 2017 01:15:31 +0000 (01:15 +0000)]
[asan] Test ASan instrumentation for shadow scale value of 5
Add additional RUN clauses to test for -asan-mapping-scale=5 in
selective tests, with special CHECK statements where needed.
Differential Revision: https://reviews.llvm.org/D39775
llvm-svn: 318493
David Blaikie [Fri, 17 Nov 2017 01:07:20 +0000 (01:07 +0000)]
Update for layering fix in LLVM CodeGen<>Target
llvm-svn: 318491
David Blaikie [Fri, 17 Nov 2017 01:07:10 +0000 (01:07 +0000)]
Fix a bunch more layering of CodeGen headers that are in Target
All these headers already depend on CodeGen headers so moving them into
CodeGen fixes the layering (since CodeGen depends on Target, not the
other way around).
llvm-svn: 318490
Zachary Turner [Fri, 17 Nov 2017 01:00:35 +0000 (01:00 +0000)]
Don't #include MemoryBuffer.h from Host.h.
It turns out this #include isn't used from Host.h anyway,
but by having it it causes circular include dependencies.
This issues only surfaced while I was working on a separate
patch, so I'm submitting this first so that it's independent
of the other, unrelated patch.
llvm-svn: 318489
Vitaly Buka [Fri, 17 Nov 2017 00:46:59 +0000 (00:46 +0000)]
[fuzzer] Initialize PcDescr buffer before calling __sanitizer_symbolize_pc
__sanitizer_symbolize_pc is not instrumented so msan assumes that PcDescr
was not initialized.
llvm-svn: 318488
Mandeep Singh Grang [Fri, 17 Nov 2017 00:43:24 +0000 (00:43 +0000)]
[PredicateInfo] Add comment about why we require stable sort
llvm-svn: 318487
Zachary Turner [Fri, 17 Nov 2017 00:41:18 +0000 (00:41 +0000)]
Re-revert "Refactor debuginfo-tests"
This is still broken because it causes certain tests to be
run twice with slightly different configurations, which is
wrong in some cases.
You can observe this by running:
ninja -nv check-all | grep debuginfo-tests
And seeing that it passes clang/test and clang/test/debuginfo-tests
to lit, which causes it to run debuginfo-tests twice. The fix is
going to involve either:
a) figuring out that we're running in this "deprecated" configuration,
and then deleting the clang/test/debuginfo-tests path, which should
cause it to behave identically to before, or:
b) make lit smart enough that it doesn't descend into a sub-suite if
that sub-suite already has a lit.cfg file.
llvm-svn: 318486
Dmitry Mikulin [Fri, 17 Nov 2017 00:30:24 +0000 (00:30 +0000)]
Current implementation of Value::replaceUsesExceptBlockAddr() uses UseList
iterator to walk the list which keeps changing inside the loop. When the
UseList contains several uses with the same user, we end processing the same
user more than once, which leads to an assert.
With this fix, unique users are saved and processed later to avoid
processing duplicates.
Differential Revision: https://reviews.llvm.org/D39864
llvm-svn: 318477
Matt Morehouse [Fri, 17 Nov 2017 00:11:12 +0000 (00:11 +0000)]
[libFuzzer] Fix flaky merge.test.
llvm-svn: 318475
Richard Smith [Thu, 16 Nov 2017 23:54:56 +0000 (23:54 +0000)]
PR22763: if a defaulted (non-user-provided) special member function is
explicitly instantiated, still emit it with each use.
We don't emit a definition of the member with an explicit instantiation
definition (and indeed it appears that we're not allowed to, since an explicit
instantiation definition does not constitute an odr-use and only odr-use
permits definition for defaulted special members). So we still need to emit a
weak definition with each use.
This also makes defaulted-in-class declarations behave more like
implicitly-declared special members, which matches their design intent.
And it matches the way this problem was solved in GCC.
llvm-svn: 318474
Yi Kong [Thu, 16 Nov 2017 23:38:17 +0000 (23:38 +0000)]
[ARM] 't' asm constraint should accept i32
't' constraint normally only accepts f32 operands, but for VCVT the
operands can be i32. LLVM is overly restrictive and rejects asm like:
float foo() {
float result;
__asm__ __volatile__(
"vcvt.f32.s32 %[result], %[arg1]\n"
: [result]"=t"(result)
: [arg1]"t"(0x01020304) );
return result;
}
Relax the value type for 't' constraint to either f32 or i32.
Differential Revision: https://reviews.llvm.org/D40137
llvm-svn: 318472
Walter Lee [Thu, 16 Nov 2017 23:29:19 +0000 (23:29 +0000)]
[asan] Properly mark or disable tests that only work with shadow scale of 3
Differential Revision: https://reviews.llvm.org/D39774
llvm-svn: 318471
Walter Lee [Thu, 16 Nov 2017 23:28:50 +0000 (23:28 +0000)]
[asan] Port tests to shadow scale of 5
The tests are ported as follows:
contiguous_container_crash.cc
use-after-delete.cc
use-after-free.cc
Replace hardwired shadow granularity in CHECK statements with regex.
max_redzone.cc
Bump max_redzone parameter to 32.
memset_test.cc
Bump size parameter of __asan_poison_memory_region to 32.
scariness_score_test.cc
For "far-from-bounds" heap overflow, make sure overflow is more than
one shadow granularity away.
At large shadow granularity, there is not enough redzone between
stack elements to detect far-from-bounds, so fake out that test.
Differential Revision: https://reviews.llvm.org/D39773
llvm-svn: 318470
Walter Lee [Thu, 16 Nov 2017 23:28:25 +0000 (23:28 +0000)]
[asan] Add lit feature to indicate compiler_rt's shadow scale value
This will be used to mark tests that require a specific shadow scale.
Differential Revision: https://reviews.llvm.org/D39772
llvm-svn: 318469
Craig Topper [Thu, 16 Nov 2017 23:09:06 +0000 (23:09 +0000)]
[X86] Add DAG combine to remove sext i32->i64 from gather/scatter instructions.
Only do this pre-legalize in case we're using the sign extend to legalize for KNL.
This recovers all of the tests that changed when I stopped SelectionDAGBuilder from deleting sign extends.
There's more work that could be done here particularly to fix the i8->i64 test case that experienced split.
llvm-svn: 318468
Craig Topper [Thu, 16 Nov 2017 23:09:03 +0000 (23:09 +0000)]
[X86] Add gather test with index sign extended from i8 type.
Previously SelectionDAGBuilder would remove this sign extend leading to a failure during isel.
The codegen here isn't very nice as we ended up triggering a split.
llvm-svn: 318467
Craig Topper [Thu, 16 Nov 2017 23:08:57 +0000 (23:08 +0000)]
[X86] Don't remove sign extend of gather/scatter indices during SelectionDAGBuilder.
The sign extend might be from an i16 or i8 type and was inserted by InstCombine to match the pointer width. X86 gather legalization isn't currently detecting this to reinsert a sign extend to make things legal.
It's a bit weird for the SelectionDAGBuilder to do this kind of optimization in the first place. With this removed we can at least lean on InstCombine somewhat to ensure the index is i32 or i64.
I'll work on trying to recover some of the test cases by removing sign extends in the backend when its safe to do so with an understanding of the current legalizer capabilities.
This should fix PR30690.
llvm-svn: 318466
Matt Morehouse [Thu, 16 Nov 2017 23:06:17 +0000 (23:06 +0000)]
[libFuzzer] Make merge-sigusr.test work on Mac.
llvm-svn: 318465
Lang Hames [Thu, 16 Nov 2017 23:04:44 +0000 (23:04 +0000)]
[Support] Support NetBSD PaX MPROTECT in sys::Memory.
Removes AllocateRWX, setWritable and setExecutable from sys::Memory and
standardizes on allocateMappedMemory / protectMappedMemory. The
allocateMappedMemory method is updated to request full permissions for memory
blocks so that they can be marked executable later.
llvm-svn: 318464
David Blaikie [Thu, 16 Nov 2017 22:40:02 +0000 (22:40 +0000)]
Attempt to fix inscrutible build break...
llvm-svn: 318463
Zachary Turner [Thu, 16 Nov 2017 22:39:55 +0000 (22:39 +0000)]
Fix some undefined beahvior in FileMapping.
This was broken when building a 32-bit native toolchain, as
shifting a size_t right by 32 is UB when sizeof(size_t) == 8.
llvm-svn: 318462
David Blaikie [Thu, 16 Nov 2017 22:30:36 +0000 (22:30 +0000)]
llvm-readobj/ARMEHABIPrinter.h: Make this a real/modular header
Had several non-inline/strong function definitions that needed to be
marked inline, etc.
llvm-svn: 318461
Walter Lee [Thu, 16 Nov 2017 22:02:58 +0000 (22:02 +0000)]
[asan] Avoid assert failure for non-default shadow scale
Rather than assertion failing, we can fall back to the
non-optimized version which works for any shadow scale.
Differential Revision: https://reviews.llvm.org/D39474
llvm-svn: 318460
Rafael Espindola [Thu, 16 Nov 2017 21:53:51 +0000 (21:53 +0000)]
Convert the last use of sys::fs::createUniqueFile in bugpoint.
llvm-svn: 318459
Rafael Espindola [Thu, 16 Nov 2017 21:40:10 +0000 (21:40 +0000)]
Convert another use of createUniqueFile to TempFile::create.
This one requires a new small feature in TempFile: the ability to keep
the temporary file with the temporary name.
llvm-svn: 318458
Petr Hosek [Thu, 16 Nov 2017 21:28:54 +0000 (21:28 +0000)]
[CMake][runtimes] Use cmake_parse_arguments in runtimes functions
Passing lists to functions in CMake is tricky, any list argument
has to be quoted otherwise it'll be expanded. To avoid this issue,
use cmake_parse_arguments in runtime functions and pass lists using
a keyword argument which eliminates any ambiguity when dealing with
lists.
Differential Revision: https://reviews.llvm.org/D40087
llvm-svn: 318457
Reid Kleckner [Thu, 16 Nov 2017 21:26:18 +0000 (21:26 +0000)]
Issue -Wempty-body warnings for else blocks
This looks like it was just an oversight.
Fixes http://llvm.org/pr35319
llvm-svn: 318456
Vedant Kumar [Thu, 16 Nov 2017 21:08:51 +0000 (21:08 +0000)]
Revert "[SelectionDAG] Consolidate (t|T)ransferDbgValues methods, NFC."
This reverts commit r318448. It looks like some of the asserts need to
be weakened.
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-autoconf/builds/16296
llvm-svn: 318455
Mandeep Singh Grang [Thu, 16 Nov 2017 20:30:49 +0000 (20:30 +0000)]
[RISCV] Fix 64-bit data layout mismatch between backend and target description
Reviewers: asb
Reviewed By: asb
Subscribers: rbar, johnrusso, simoncook, jordy.potman.lists, llvm-commits
Differential Revision: https://reviews.llvm.org/D40145
llvm-svn: 318454
Kostya Serebryany [Thu, 16 Nov 2017 20:25:45 +0000 (20:25 +0000)]
[libFuzzer] add more tests for merge
llvm-svn: 318453
Craig Topper [Thu, 16 Nov 2017 20:23:22 +0000 (20:23 +0000)]
[X86] Pre-truncate gather/scatter indices that have element sizes larger than 64-bits before Legalize.
The wider element type will normally cause legalize to try to split and scalarize the gather/scatter, but we can't handle that. Instead, truncate the index early so the gather/scatter node is insulated from the legalization.
This really shouldn't happen in practice since InstCombine will normalize index types to the same size as pointers.
llvm-svn: 318452
Craig Topper [Thu, 16 Nov 2017 20:23:17 +0000 (20:23 +0000)]
[X86] DAGCombinerInfo is in TargetLowering not X86TargetLowering.
llvm-svn: 318451
Craig Topper [Thu, 16 Nov 2017 20:23:12 +0000 (20:23 +0000)]
[DAGCombiner] Use cast instead of an unchecked dyn_cast.
llvm-svn: 318450
Justin Bogner [Thu, 16 Nov 2017 20:20:56 +0000 (20:20 +0000)]
llvm-objdump: Add missing requires for the test in r313921
This test needs an arm backend in addition to the arm64 one that's
already checked in the test directory.
llvm-svn: 318449
Vedant Kumar [Thu, 16 Nov 2017 19:50:24 +0000 (19:50 +0000)]
[SelectionDAG] Consolidate (t|T)ransferDbgValues methods, NFC.
TransferDbgValues (capital 'T') is wired into ReplaceAllUsesWith, and
transferDbgValues (lowercase 't') is used elsewhere (e.g in Legalize).
Both functions should be doing the exact same thing. This patch
consolidates the logic into one place.
Differential Revision: https://reviews.llvm.org/D40104
llvm-svn: 318448
Reid Kleckner [Thu, 16 Nov 2017 19:41:12 +0000 (19:41 +0000)]
Fix my typo of PDB_TableType
llvm-svn: 318447
Martin Storsjo [Thu, 16 Nov 2017 19:36:48 +0000 (19:36 +0000)]
Remove a FIXME about truncated section names
If the linker chose to store the full section name instead of truncating
it, this field doesn't contain a truncated name, but an offset into
the string table of the binary. The string table isn't loaded/mapped
into memory during runtime though, so it's not possible to read the
full section name, unless we try to locate the DLL/EXE on disk that
the HMODULE corresponds to and load that manually.
Due to this, lld now always prefers writing a truncated section name
for sections that will be mapped at runtime, even when debug info is
enabled.
Differential Revision: https://reviews.llvm.org/D39918
llvm-svn: 318446
Ben Hamilton [Thu, 16 Nov 2017 19:34:08 +0000 (19:34 +0000)]
[VirtualFileSystem] Support creating directories then adding files inside
Summary:
In https://reviews.llvm.org/D39572 , I added support for specifying
`Type` when invoking `InMemoryFileSystem::addFile()`.
However, I didn't account for the fact that when `Type` is
`directory_file`, we need to construct an `InMemoryDirectory`, not an
`InMemoryFile`, or else clients cannot create files inside that
directory.
This diff fixes the bug and adds a test.
Test Plan: New test added. Ran test with:
% make -j12 check-clang-tools
Reviewers: bkramer, hokein
Reviewed By: bkramer
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D40140
llvm-svn: 318445
Reid Kleckner [Thu, 16 Nov 2017 19:32:53 +0000 (19:32 +0000)]
Fix -Wreturn-type falling off the end of a function in new DIA code
llvm-svn: 318444
Daniel Sanders [Thu, 16 Nov 2017 19:16:56 +0000 (19:16 +0000)]
[arc] Fix ambiguous overloaded operator error
lib/Target/ARC/ARCISelLowering.cpp:490:22: error: use of overloaded operator '<<' is ambiguous (with operand types 'llvm::raw_ostream' and 'llvm::MVT::SimpleValueType')
<< RegVT.getSimpleVT().SimpleTy << "\n");
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
llvm-svn: 318443
Yonghong Song [Thu, 16 Nov 2017 19:15:36 +0000 (19:15 +0000)]
bpf: print backward branch target properly
Currently, it prints the backward branch offset as unsigned value
like below:
7: 7d 34 0b 00 00 00 00 00 if r4 s>= r3 goto 11 <LBB0_3>
8: b7 00 00 00 00 00 00 00 r0 = 0
LBB0_2:
9: 07 00 00 00 01 00 00 00 r0 += 1
......
17: bf 31 00 00 00 00 00 00 r1 = r3
18: 6d 32 f6 ff 00 00 00 00 if r2 s> r3 goto 65526 <LBB0_3+0x7FFB0>
The correct print insn 18 should be:
18: 6d 32 f6 ff 00 00 00 00 if r2 s> r3 goto -10 <LBB0_2>
To provide better clarity and be consistent with kernel verifier output,
the insn 7 output is changed to the following with "+" added to
non-negative branch offset:
7: 7d 34 0b 00 00 00 00 00 if r4 s>= r3 goto +11 <LBB0_3>
Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
llvm-svn: 318442
Daniel Sanders [Thu, 16 Nov 2017 19:10:26 +0000 (19:10 +0000)]
[arc] Update TargetInfo to include the new backend name argument
Also update a comment about the usage of RegisterTarget() that didn't mention
the new argument.
llvm-svn: 318441
Reid Kleckner [Thu, 16 Nov 2017 19:09:36 +0000 (19:09 +0000)]
[MS] Apply adjustments after storing 'this'
Summary:
The MS ABI convention is that the 'this' pointer on entry is the address
of the vfptr that was used to make the virtual method call. In other
words, the pointer on entry always points to the base subobject that
introduced the virtual method. Consider this hierarchy:
struct A { virtual void f() = 0; };
struct B { virtual void g() = 0; };
struct C : A, B {
void f() override;
void g() override;
};
On entry to C::g, [ER]CX will contain the address of C's B subobject,
and C::g will have to subtract sizeof(A) to recover a pointer to C.
Before this change, we applied this adjustment in the prologue and
stored the new value into the "this" local variable alloca used for
debug info. However, MSVC does not do this, presumably because it is
often profitable to fold the adjustment into later field accesses. This
creates a problem, because the debugger expects the variable to be
unadjusted. Unfortunately, CodeView doesn't have anything like DWARF
expressions for computing variables that aren't in the program anymore,
so we have to declare 'this' to be the unadjusted value if we want the
debugger to see the right value.
This has the side benefit that, in optimized builds, the 'this' pointer
will usually be available on function entry because it doesn't require
any adjustment.
Reviewers: hans
Subscribers: aprantl, cfe-commits
Differential Revision: https://reviews.llvm.org/D40109
llvm-svn: 318440
Kostya Serebryany [Thu, 16 Nov 2017 18:58:14 +0000 (18:58 +0000)]
[libFuzzer] add docs for -reduce_inputs
llvm-svn: 318439
Kostya Kortchinsky [Thu, 16 Nov 2017 18:53:18 +0000 (18:53 +0000)]
[sanitizer] Revert rL318410
Summary:
The patch seems to have turned some Android tests flaky. The reason is unclear.
This reverts D40100 in case we can't figure out what is happening.
Reviewers: eugenis
Reviewed By: eugenis
Subscribers: srhines, kubamracek
Differential Revision: https://reviews.llvm.org/D40138
llvm-svn: 318438
Azharuddin Mohammed [Thu, 16 Nov 2017 18:39:31 +0000 (18:39 +0000)]
Fix RISCV build after r318352
Reviewers: asb, apazos, mgrang
Reviewed By: mgrang
Subscribers: rbar, johnrusso, simoncook, jordy.potman.lists, llvm-commits
Differential Revision: https://reviews.llvm.org/D40139
llvm-svn: 318437