Matt Arsenault [Thu, 1 Mar 2018 19:09:25 +0000 (19:09 +0000)]
AMDGPU/GlobalISel: Add copyCost for VGPR->SGPR copies
Patch by Tom Stellard
llvm-svn: 326467
Matt Arsenault [Thu, 1 Mar 2018 19:09:21 +0000 (19:09 +0000)]
AMDGPU/GlobalISel: Make i32 xor legal
llvm-svn: 326466
Matt Arsenault [Thu, 1 Mar 2018 19:09:16 +0000 (19:09 +0000)]
AMDGPU/GlobalISel: Mark 32/64-bit G_FCMP as legal
Patch by Tom Stellard
llvm-svn: 326465
Matt Arsenault [Thu, 1 Mar 2018 19:04:25 +0000 (19:04 +0000)]
AMDGPU/GlobalISel: Mark 32-bit G_FPTOSI as legal
Patch by Tom Stellard
llvm-svn: 326464
Ed Maste [Thu, 1 Mar 2018 19:02:41 +0000 (19:02 +0000)]
Correct man page description for --section-start
The argument is section=address, not just address.
(For compatibility with GNU linkers we need to, but do not yet, accept
--section-start=section=address.)
llvm-svn: 326463
Artem Dergachev [Thu, 1 Mar 2018 18:53:13 +0000 (18:53 +0000)]
[analyzer] Enable cfg-temporary-dtors by default.
Don't enable c++-temp-dtor-inlining by default yet, due to this reference
counting pointe problem.
Otherwise the new mode seems stable and allows us to incrementally fix C++
problems in much less hacky ways.
Differential Revision: https://reviews.llvm.org/D43804
llvm-svn: 326461
Sam Clegg [Thu, 1 Mar 2018 18:48:08 +0000 (18:48 +0000)]
[WebAssembly] Fix broken gcc build after rL326454
The gcc builders were broken by rL326454
See: https://reviews.llvm.org/D43921
llvm-svn: 326460
Ed Maste [Thu, 1 Mar 2018 18:40:11 +0000 (18:40 +0000)]
Where possible use --long-opt=value in lld man page
We intend to maintain compatibility with GNU ld, and in the GNU world
long options are conventionally specified as --long-option=value. For
whatever reason GNU ld.bfd accepts both --long-option value and
--long-option=value, but documents the former. Follow suit.
Some lld long options do not accept the = form; this is probably a bug
to be fixed (along with a man page update).
Reported by Ingo Schwarze, for --entry.
llvm-svn: 326459
Eric Liu [Thu, 1 Mar 2018 18:30:48 +0000 (18:30 +0000)]
[clangd] Make symbol name a required parameter for CanonicalIncludes::mapHeader
llvm-svn: 326458
Artem Belevich [Thu, 1 Mar 2018 18:28:45 +0000 (18:28 +0000)]
[NVPTX] use pattern matching to lower int_nvvm_match_all_sync*.
Now that patterns can handle intrinsics returning multiple results,
use tablegen'ed pattern matching instead of custom lowering.
Differential Revision: https://reviews.llvm.org/D43890
llvm-svn: 326457
Eric Liu [Thu, 1 Mar 2018 18:06:40 +0000 (18:06 +0000)]
[clangd] Support include canonicalization in symbol leve.
Summary:
Symbols with different canonical includes might be defined in the same header
(e.g. symbols defined in STL <iosfwd>). This patch adds support for mapping from
qualified symbol names to canonical headers and special mapping for symbols in <iosfwd>
Reviewers: sammccall, hokein
Reviewed By: sammccall
Subscribers: klimek, ilya-biryukov, jkorous-apple, cfe-commits
Differential Revision: https://reviews.llvm.org/D43869
llvm-svn: 326456
Sam Clegg [Thu, 1 Mar 2018 18:06:39 +0000 (18:06 +0000)]
[WebAssembly] Use uint8_t for single byte values to match the spec
Differential Revision: https://reviews.llvm.org/D43922
llvm-svn: 326455
Sam Clegg [Thu, 1 Mar 2018 18:06:21 +0000 (18:06 +0000)]
[WebAssembly] Use uint8_t for single byte values to match the spec
The original BinaryEncoding.md document used to specify that
these values were `varint7`, but the official spec lists them
explicitly as single byte values and not LEB.
A similar change for wabt is in flight:
https://github.com/WebAssembly/wabt/pull/782
Differential Revision: https://reviews.llvm.org/D43921
llvm-svn: 326454
Zachary Turner [Thu, 1 Mar 2018 18:00:29 +0000 (18:00 +0000)]
[PDB] Defer writing the build id until the rest of the PDB is written.
For now this is NFC, but this small refactor opens the door to
letting us embed a hash of the PDB in the build id field of the
PDB.
Differential Revision: https://reviews.llvm.org/D43913
llvm-svn: 326453
Eric Liu [Thu, 1 Mar 2018 17:42:27 +0000 (17:42 +0000)]
[clangd] Forward all environment variables along with CLANGD_TRACE to clangd.
llvm-svn: 326452
Alexander Timofeev [Thu, 1 Mar 2018 17:36:43 +0000 (17:36 +0000)]
[AMDGPU] : fix for the crash in SIRegisterInfo when the regiser class not found
Differential revision: https://reviews.llvm.org./D43334
llvm-svn: 326451
Krzysztof Parzyszek [Thu, 1 Mar 2018 17:03:26 +0000 (17:03 +0000)]
[Hexagon] Add guest registers
llvm-svn: 326450
Pavel Labath [Thu, 1 Mar 2018 16:56:28 +0000 (16:56 +0000)]
Make TestDynamicValueSameBase gcc-compatible
gcc will say that the type of "this" is "T * const", clang "T *".
Compare the unqualified type names to erase the difference between the
two, as the constness is not a part of this test.
FWIW, I think that the gcc behavior makes more sense here.
llvm-svn: 326449
Sanjay Patel [Thu, 1 Mar 2018 16:28:32 +0000 (16:28 +0000)]
[InstCombine] remove stale comments for tests; NFC
llvm-svn: 326448
Stefan Pintilie [Thu, 1 Mar 2018 16:16:08 +0000 (16:16 +0000)]
[Power9] Add missing instructions to the Power 9 scheduler
Adding more instructions using InstRW so that we can move away from ItinRW
and ultimately have a complete Power 9 scheduler.
Differential Revision: https://reviews.llvm.org/D43899
llvm-svn: 326447
Ed Maste [Thu, 1 Mar 2018 16:02:19 +0000 (16:02 +0000)]
Correct markup and nits in ld.lld man page
Patch by Ingo Schwarze
llvm-svn: 326446
Nicholas Wilson [Thu, 1 Mar 2018 15:55:59 +0000 (15:55 +0000)]
[WebAssembly] Update pre-generated test files to match latest llc output. NFC.
The ordering of llc's output was changed in rL326334.
Differential Revision: https://reviews.llvm.org/D43941
llvm-svn: 326445
Sanjay Patel [Thu, 1 Mar 2018 15:50:26 +0000 (15:50 +0000)]
[InstCombine] simplify code for (X*Y) * X => (X*X) * Y ; NFCI
llvm-svn: 326444
Sebastian Pop [Thu, 1 Mar 2018 15:47:39 +0000 (15:47 +0000)]
[AArch64] generate vuzp instead of mov
when a BUILD_VECTOR is created out of a sequence of EXTRACT_VECTOR_ELT with a
specific pattern sequence, either <0, 2, 4, ...> or <1, 3, 5, ...>, replace the
BUILD_VECTOR with either vuzp1 or vuzp2.
With this patch LLVM generates the following code for the first function fun1 in the testcase:
adrp x8, .LCPI0_0
ldr q0, [x8, :lo12:.LCPI0_0]
tbl v0.16b, { v0.16b }, v0.16b
ext v1.16b, v0.16b, v0.16b, #8
uzp1 v0.8b, v0.8b, v1.8b
str d0, [x8]
ret
Without this patch LLVM currently generates this code:
adrp x8, .LCPI0_0
ldr q0, [x8, :lo12:.LCPI0_0]
tbl v0.16b, { v0.16b }, v0.16b
mov v1.16b, v0.16b
mov v1.b[1], v0.b[2]
mov v1.b[2], v0.b[4]
mov v1.b[3], v0.b[6]
mov v1.b[4], v0.b[8]
mov v1.b[5], v0.b[10]
mov v1.b[6], v0.b[12]
mov v1.b[7], v0.b[14]
str d1, [x8]
ret
llvm-svn: 326443
Sanjay Patel [Thu, 1 Mar 2018 15:30:44 +0000 (15:30 +0000)]
[InstCombine] move/add tests for fmul reassociation; NFC
This transform may be out-of-scope for instcombine,
but this is only documenting the current behavior.
llvm-svn: 326442
Rafael Espindola [Thu, 1 Mar 2018 15:25:46 +0000 (15:25 +0000)]
Don't allocate a header bellow address 0.
With the current code if the script has a PHDRS we always obey and try
to allocate a header. This can cause Min - HeaderSize to underflow.
It looks like bfd actually prints an error for this case. With this
patch we do the same.
Found while looking at pr36515.
llvm-svn: 326441
Sanjay Patel [Thu, 1 Mar 2018 15:13:42 +0000 (15:13 +0000)]
[InstCombine] auto-generate full checks; NFC
llvm-svn: 326440
Ilya Biryukov [Thu, 1 Mar 2018 14:54:16 +0000 (14:54 +0000)]
Resubmit [analyzer] Support for naive cross translation unit analysis
Originally submitted as r326323 and r326324.
Reverted in r326432.
Reverting the commit was a mistake.
The breakage was due to invalid build files in our internal buildsystem,
CMakeLists did not have any cyclic dependencies.
llvm-svn: 326439
Hans Wennborg [Thu, 1 Mar 2018 14:48:19 +0000 (14:48 +0000)]
UsersManual: improve the clang-cl text some more
llvm-svn: 326438
Tatyana Krasnukha [Thu, 1 Mar 2018 14:36:42 +0000 (14:36 +0000)]
Make Finalize tolerant of empty register sets.
llvm-svn: 326437
Alexey Bataev [Thu, 1 Mar 2018 14:32:37 +0000 (14:32 +0000)]
Revert "[DEBUGINFO] Add flag for DWARF2 or less to use sections as references."
This reverts commit r326328 to remove checks for emission of certain
sections after discussion with Eric Christofer.
llvm-svn: 326436
Jonas Hahnfeld [Thu, 1 Mar 2018 14:03:18 +0000 (14:03 +0000)]
[OMPT] Fix interoperability test with GCC
We have to ensure that the runtime is initialized _before_ waiting
for the two started threads to guarantee that the master threads
post their ompt_event_thread_begin before the worker threads. This
is not guaranteed in the parallel region where one worker thread
could start before the other master thread has invoked the callback.
The problem did not happen with Clang becauses the generated code
calls __kmpc_global_thread_num() and cashes its result for functions
that contain OpenMP pragmas.
Differential Revision: https://reviews.llvm.org/D43882
llvm-svn: 326435
Hans Wennborg [Thu, 1 Mar 2018 14:00:19 +0000 (14:00 +0000)]
UsersManual: beef up the clang-cl text a little
llvm-svn: 326434
Than McIntosh [Thu, 1 Mar 2018 13:31:57 +0000 (13:31 +0000)]
[CodeGen] fix argument attribute in lowering statepoint/patchpoint
Summary:
Use the correct loop index varaible, ArgI, to retrieve attributes.
Reviewers: thanm, sanjoy, rnk
Reviewed By: rnk
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D43832
llvm-svn: 326433
Ilya Biryukov [Thu, 1 Mar 2018 12:43:39 +0000 (12:43 +0000)]
Revert "[analyzer] Support for naive cross translation unit analysis"
Also revert "[analyzer] Fix a compiler warning"
This reverts commits r326323 and r326324.
Reason: the commits introduced a cyclic dependency in the build graph.
This happens to work with cmake, but breaks out internal integrate.
llvm-svn: 326432
George Rimar [Thu, 1 Mar 2018 12:36:01 +0000 (12:36 +0000)]
[ELF] - Don't crash on broken MEMORY declaration.
LLD crashes with broken scripts shown in testcase,
because fails to read memory regon name and accesses
MemoryRegions's element which is nullptr.
Patch fixes it.
Differential revision: https://reviews.llvm.org/D43866
llvm-svn: 326431
George Rimar [Thu, 1 Mar 2018 12:27:04 +0000 (12:27 +0000)]
[ELF] - Do not remove empty sections that use symbols in expressions.
This is PR36515.
Currenly if we have a script like .debug_info 0 : { *(.debug_info) },
we would not remove this section and keep it in the output.
That does not work, because it is common case for
debug sections to have a zero address expression.
Patch changes behavior so that we remove only sections
that do not use symbols in its expressions.
Differential revision: https://reviews.llvm.org/D43863
llvm-svn: 326430
Benjamin Kramer [Thu, 1 Mar 2018 11:31:44 +0000 (11:31 +0000)]
[SCCP] Fix unused variable warning in release builds.
llvm-svn: 326429
Joachim Protze [Thu, 1 Mar 2018 11:26:15 +0000 (11:26 +0000)]
[OMPT] Fix task-type test with GCC
This is similar to D43882. The runtime needs to be initialized before calling print_ids(0)
http://lab.llvm.org:8011/builders/openmp-gcc-x86_64-linux-debian/builds/60
Differential Revision: https://reviews.llvm.org/D43897
llvm-svn: 326428
George Rimar [Thu, 1 Mar 2018 10:38:51 +0000 (10:38 +0000)]
[ELF] - Fix eh-frame-reloc-out-of-range.test.
Was broken after recent testcases changes.
llvm-svn: 326427
Francois Ferrand [Thu, 1 Mar 2018 10:09:13 +0000 (10:09 +0000)]
[clang-format] Add SpaceBeforeColon option
Summary:
When disabled, this option allows removing the space before colon,
making it act more like the semi-colon. When enabled (default), the
current behavior is not affected.
This mostly affects C++11 loop, initializer list, inheritance list and
container literals:
class Foo: Bar {}
Foo::Foo(): a(a) {}
for (auto i: myList) {}
f({a: 1, b: 2, c: 3});
Reviewers: krasimir, djasper
Reviewed By: djasper
Subscribers: xvallspl, teemperor, karies, cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D32525
llvm-svn: 326426
Jonas Devlieghere [Thu, 1 Mar 2018 10:05:54 +0000 (10:05 +0000)]
[dsymutil] Move string pool into its own implementatino file. NFC.
The DwarfLinker implementation is already relatively large with over 4k
LOC. This commit moves the implementation of NonRelocatableStringpool
into a separate cpp file.
llvm-svn: 326425
Nicholas Wilson [Thu, 1 Mar 2018 09:38:02 +0000 (09:38 +0000)]
[WebAssembly] Reorder exports to match symbol table order
This fixes a TODO introduced in rLLD325861.
Differential Revision: https://reviews.llvm.org/D43877
llvm-svn: 326424
Shiva Chen [Thu, 1 Mar 2018 07:47:27 +0000 (07:47 +0000)]
[PATCH] [compiler-rt, RISCV] Support builtins for RISC-V
Summary:
Support builtins for RISC-V, RV32 and RV64.
Reviewers: asb, apazos, mgrang
Differential Revision: https://reviews.llvm.org/D42958
llvm-svn: 326420
Serge Pavlov [Thu, 1 Mar 2018 07:04:11 +0000 (07:04 +0000)]
Function definition may have uninstantiated body
Current implementation of `FunctionDecl::isDefined` does not take into
account redeclarations that do not have bodies, but the bodies can be
instantiated from corresponding templated definition. This behavior does
not allow to detect function redefinition in the cases where friend
functions is defined in class templates. For instance, the code:
```
template<typename T> struct X { friend void f() {} };
X<int> xi;
void f() {}
```
compiles successfully but must fail due to redefinition of `f`. The
declaration of the friend `f` is created when the containing template
`X` is instantiated, but it does not have a body as per 14.5.4p4
because `f` is not odr-used.
With this change the function `Sema::CheckForFunctionRedefinition`
considers functions with uninstantiated bodies as definitions.
Differential Revision: https://reviews.llvm.org/D30170
llvm-svn: 326419
Max Kazantsev [Thu, 1 Mar 2018 06:56:48 +0000 (06:56 +0000)]
[SCEV] Smart range calculation for SCEVUnknown Phis
The range of SCEVUnknown Phi which merges values `X1, X2, ..., XN`
can be evaluated as `U(Range(X1), Range(X2), ..., Range(XN))`.
Reviewed By: sanjoy
Differential Revision: https://reviews.llvm.org/D43810
llvm-svn: 326418
Craig Topper [Thu, 1 Mar 2018 06:25:13 +0000 (06:25 +0000)]
[X86] Stop passing two arguments by reference. NFC
I think these used to be out parameters, but they haven't been for a while.
llvm-svn: 326417
George Burgess IV [Thu, 1 Mar 2018 05:43:23 +0000 (05:43 +0000)]
Remove redundant casts. NFC
So I wrote a clang-tidy check to lint out redundant `isa`, `cast`, and
`dyn_cast`s for fun. This is a portion of what it found for clang; I
plan to do similar cleanups in LLVM and other subprojects when I find
time.
Because of the volume of changes, I explicitly avoided making any change
that wasn't highly local and obviously correct to me (e.g. we still have
a number of foo(cast<Bar>(baz)) that I didn't touch, since overloading
is a thing and the cast<Bar> did actually change the type -- just up the
class hierarchy).
I also tried to leave the types we were cast<>ing to somewhere nearby,
in cases where it wasn't locally obvious what we were dealing with
before.
llvm-svn: 326416
Rui Ueyama [Thu, 1 Mar 2018 04:21:42 +0000 (04:21 +0000)]
Convert more tests as linker scripts instead of assembly.
llvm-svn: 326415
Vedant Kumar [Thu, 1 Mar 2018 03:03:38 +0000 (03:03 +0000)]
[test] Restore cleanup behavior in TestQuoting.py
Before the change to compile tests out-of-tree, the cleanup classmethod
in TestQuoting.py would remove a temp file. After the change it threw an
exception due to a malformed call to getBuildArtifact().
Bring back the old behavior.
llvm-svn: 326414
Lang Hames [Thu, 1 Mar 2018 02:52:17 +0000 (02:52 +0000)]
[Support] Fix comments for handleAllErrors: it calls llvm_unreachable if the
contract is violated, not report_fatal_error.
llvm-svn: 326413
Jim Ingham [Thu, 1 Mar 2018 02:44:34 +0000 (02:44 +0000)]
We were getting the wrong dynamic type if there were two classes with the same basename.
There's a bug in FindTypes, it ignores the exact flag if you pass a name that doesn't begin with
:: and pass eTypeClassAny for the type.
In this case we always know that the name we get from the vtable name is absolute so we can
work around the bug by prepending the "::". This doesn't fix the FindTypes bug.
<rdar://problem/
38010986>
llvm-svn: 326412
Rui Ueyama [Thu, 1 Mar 2018 02:37:26 +0000 (02:37 +0000)]
[WebAssembly] Remove unused forward declaration.
llvm-svn: 326411
Rui Ueyama [Thu, 1 Mar 2018 02:31:29 +0000 (02:31 +0000)]
Do not create multiple NOTE segments.
Previously, we didn't try to make effort to put .note sections next
to each other in the output file, so two .note sections were likely
to be stored to two separate NOTE segments. That's undesirable because
we should create as few segments as possible in general.
Differential Revision: https://reviews.llvm.org/D43858
llvm-svn: 326410
Rafael Espindola [Thu, 1 Mar 2018 02:25:40 +0000 (02:25 +0000)]
Expand test a bit.
It now includes both linkerscript and non linkerscript variants.
Extracted from a patch by Rui while I was trying to figure out what
exactly was changing.
llvm-svn: 326409
George Karpenkov [Thu, 1 Mar 2018 02:18:54 +0000 (02:18 +0000)]
[analyzer] [tests] Create a directory for the log file
llvm-svn: 326408
Martin Pelikan [Thu, 1 Mar 2018 01:59:24 +0000 (01:59 +0000)]
[XRay] cache symbolized function names for a repeatedly queried function ID
Summary:
Processing 2 GB XRay traces with "llvm-xray convert -symbolize" needs to
go over each trace record and symbolize the function name refered to by
its ID. Currently this happens by asking the LLVM symbolizer code every
single time. A simple cache can save around 30 minutes of processing of
that trace.
llvm-xray's resident memory usage increased negligibly with this cache.
Reviewers: dberris
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D43896
llvm-svn: 326407
Lang Hames [Thu, 1 Mar 2018 01:44:33 +0000 (01:44 +0000)]
[RuntimeDyld][MachO] Fix assertion in encodeAddend, add missing directive to
test case.
r326290 fixed the assertion for decodeAddend, but not encodeAddend. The
regression test failed to catch this because it was missing the
subsections_via_symbols flag, so the desired relocation was not applied.
This patch also fixes the formatting of the assertion from r326290.
llvm-svn: 326406
Artem Dergachev [Thu, 1 Mar 2018 01:27:46 +0000 (01:27 +0000)]
[analyzer] Add a checker for mmap()s which are both writable and executable.
This is a security check that warns when both PROT_WRITE and PROT_EXEC are
set during mmap(). If mmap()ed memory is both writable and executable, it makes
it easier for the attacker to execute arbitrary code when contents of this
memory are compromised. Some applications require such mmap()s though, such as
different sorts of JIT.
Re-applied after a revert in r324167.
Temporarily stays in the alpha package because it needs a better way of
determining macro values that are not immediately available in the AST.
Patch by David Carlier!
Differential Revision: https://reviews.llvm.org/D42645
llvm-svn: 326405
Reid Kleckner [Thu, 1 Mar 2018 01:19:18 +0000 (01:19 +0000)]
[IPSCCP] do not break musttail invariant (PR36485)
Do not replace results of `musttail` calls with a constant if the
call itself can't be removed.
Do not zap returns of `musttail` callees, if the call site can't be
removed and replaced with a constant.
Do not zap returns of `musttail`-calling blocks, this breaks
invariant too.
Patch by Fedor Indutny
Differential Revision: https://reviews.llvm.org/D43695
llvm-svn: 326404
Rui Ueyama [Thu, 1 Mar 2018 01:19:12 +0000 (01:19 +0000)]
Convert more .s files to linker script files.
Summary:
This change removes large "echo" commands from the test by writing
tests themselves as linker scripts.
Reviewers: rafael
Subscribers: emaste, javed.absar, llvm-commits, arichardson
Differential Revision: https://reviews.llvm.org/D43900
llvm-svn: 326403
Artem Dergachev [Thu, 1 Mar 2018 01:09:24 +0000 (01:09 +0000)]
[CFG] [analyzer] Recall that we only skip NoOp casts in construction contexts.
For now. We should also add support for ConstructorConversion casts as presented
in the attached test case, but this requires more changes because AST around
them seems different.
The check was originally present but was accidentally lost during r326021.
Differential Revision: https://reviews.llvm.org/D43840
llvm-svn: 326402
Rafael Espindola [Thu, 1 Mar 2018 01:08:00 +0000 (01:08 +0000)]
Simplify removing empty output sections.
With this the meaning of the Live bit in output sections is clear: we
have at some point added a input section into it.
llvm-svn: 326401
Fangrui Song [Thu, 1 Mar 2018 01:05:04 +0000 (01:05 +0000)]
[ELF] Fix a test comment. NFC
llvm-svn: 326400
Jason Molenda [Thu, 1 Mar 2018 01:04:07 +0000 (01:04 +0000)]
Add another entitlement that we need for debugserver.
<rdar://problem/
29855293>
llvm-svn: 326399
Sam Clegg [Thu, 1 Mar 2018 00:42:57 +0000 (00:42 +0000)]
[WebAssembly] Use Twine rather than StringRef for logging messages
Also add missing tracing to writeU8.
Differential Revision: https://reviews.llvm.org/D43919
llvm-svn: 326398
Rafael Espindola [Thu, 1 Mar 2018 00:35:47 +0000 (00:35 +0000)]
Start setting dllimport/dllexport in setGVProperties.
This is the next step in setting dso_local for COFF.
The patches changes setGVProperties to first set dllimport/dllexport
and changes a few cases that were setting dllimport/dllexport
manually. With this a few more GVs are marked dso_local.
llvm-svn: 326397
Roman Tereshin [Thu, 1 Mar 2018 00:27:48 +0000 (00:27 +0000)]
[GlobalISel][AArch64] Adding -disable-gisel-legality-check CL option
Currently it's impossible to test InstructionSelect pass with MIR which
is considered illegal by the Legalizer in Assert builds. In early stages
of porting an existing backend from SelectionDAG ISel to GlobalISel,
however, we would have very basic CallLowering, Legalizer, and
RegBankSelect implementations, but rather functional Instruction Select
with quite a few patterns selectable due to the semi-automatic porting
process borrowing them from SelectionDAG ISel.
As we are trying to define legality as a property of being selectable by
the instruction selector, it would be nice to be able to easily check
what the selector can do in its current state w/o the legality check
provided by the Legalizer getting in the way.
It also seems beneficial to have a regression testing set up that would
not allow the selector to silently regress in its support of the MIR not
supported yet by the previous passes in the GlobalISel pipeline.
This commit adds -disable-gisel-legality-check command line option to
llc that disables those legality checks in RegBankSelect and
InstructionSelect passes.
It also adds quite a few MIR test cases for AArch64's Instruction
Selector. Every one of them would fail on the legality check at the
moment, but will select just fine if the check is disabled. Every test
MachineFunction is intended to exercise a specific selection rule and
that rule only, encoded in the MachineFunction's name by the rule's
number, ID, and index of its GIM_Try opcode in TableGen'erated
MatchTable (-optimize-match-table=false).
Reviewers: ab, dsanders, qcolombet, rovka
Reviewed By: bogner
Subscribers: kristof.beyls, volkan, aditya_nandakumar, aemerson,
rengolin, t.p.northover, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D42886
llvm-svn: 326396
Paul Robinson [Thu, 1 Mar 2018 00:12:35 +0000 (00:12 +0000)]
[DWARF] Emit a split line table only if there are split type units.
A .debug_info.dwo section doesn't use the .debug_line.dwo section.
llvm-svn: 326395
Reid Kleckner [Thu, 1 Mar 2018 00:09:35 +0000 (00:09 +0000)]
[DAE] don't remove args of musttail target/caller
`musttail` requires identical signatures of caller and callee. Removing
arguments breaks `musttail` semantics.
PR36441
Patch by Fedor Indutny
Differential Revision: https://reviews.llvm.org/D43708
llvm-svn: 326394
Craig Topper [Thu, 1 Mar 2018 00:08:38 +0000 (00:08 +0000)]
[X86] Make sure we don't combine (fneg (fma X, Y, Z)) to a target specific node when there are no FMA instructions.
This would cause a 'cannot select' error at isel when we should have emitted a lib call and an xor.
Fixes PR36553.
llvm-svn: 326393
Rafael Espindola [Thu, 1 Mar 2018 00:06:55 +0000 (00:06 +0000)]
Pass a GlobalDecl to SetCommonAttributes. NFC.
Part of D43900.
llvm-svn: 326392
Rafael Espindola [Thu, 1 Mar 2018 00:00:02 +0000 (00:00 +0000)]
Inline a trivial function. NFC.
llvm-svn: 326391
Justin Lebar [Wed, 28 Feb 2018 23:58:05 +0000 (23:58 +0000)]
[NVPTX] Lower loads from global constants using ld.global.nc (aka LDG).
Summary:
After D43914, loads from global variables in addrspace(1) happen with
ld.global. But since they're constants, even better would be to use
ld.global.nc, aka ldg.
Reviewers: tra
Subscribers: jholewinski, sanjoy, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D43915
llvm-svn: 326390
Justin Lebar [Wed, 28 Feb 2018 23:57:48 +0000 (23:57 +0000)]
[NVPTX] Use addrspacecast instead of target-specific intrinsics in NVPTXGenericToNVVM.
Summary:
NVPTXGenericToNVVM was using target-specific intrinsics to do address
space casts. Using the addrspacecast instruction is (a lot) simpler.
But it also has the advantage of being understandable to other passes.
In particular, InferAddrSpaces is able to understand these address space
casts and remove them in most cases.
Reviewers: tra
Subscribers: jholewinski, sanjoy, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D43914
llvm-svn: 326389
Rafael Espindola [Wed, 28 Feb 2018 23:54:23 +0000 (23:54 +0000)]
Pass a GlobalDecl to setNonAliasAttributes. NFC.
Also part of D43900.
llvm-svn: 326388
Roman Tereshin [Wed, 28 Feb 2018 23:51:49 +0000 (23:51 +0000)]
[MIRParser] Accept overloaded intrinsic names w/o type suffixes
Function::lookupIntrinsicID is somewhat forgiving as it comes to
overloaded intrinsics' names: it returns an ID as soon as the name
provided has a prefix that matches a registered intrinsic's name w/o
actually checking that the rest of the name encodes all the concrete arg
types, let alone that those types are compatible with the intrinsic's
definition.
That's probably fine and comes in handy in MIR serialization: we don't
care about IR types at MIR level and every intrinsic should be
selectable based on its ID and low-level types (LLTs) of its operands,
including the overloaded ones, so there is no point in serializing
mangled IR types as part of the intrinsic's name.
However, lookupIntrinsicID is somewhat inconsistent in its forgiveness:
if the name provided is actually an exact match, it will refuse to
return the ID if the intrinsic is overloaded. There is probably no
real reason for that and it renders MIRParser incapable to deserialize
MIR MIRPrinter serialized.
This commit fixes it.
Reviewers: rnk, aditya_nandakumar, qcolombet, thegameg, dsanders,
marcello.maggioni
Reviewed By: bogner
Subscribers: javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D43267
llvm-svn: 326387
Alexander Kornienko [Wed, 28 Feb 2018 23:47:15 +0000 (23:47 +0000)]
[clang-tidy] Another batch of checks to rename from misc- to bugprone-.
Summary:
clang-tidy/rename_check.py {misc,bugprone}-suspicious-semicolon
clang-tidy/rename_check.py {misc,bugprone}-suspicious-string-compare
clang-tidy/rename_check.py {misc,bugprone}-swapped-arguments
clang-tidy/rename_check.py {misc,bugprone}-undelegated-constructor --check_class_name UndelegatedConstructor
Reviewers: hokein, sammccall, aaron.ballman
Subscribers: klimek, mgorny, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D43870
llvm-svn: 326386
Rafael Espindola [Wed, 28 Feb 2018 23:46:35 +0000 (23:46 +0000)]
Pass a GlobalDecl to SetInternalFunctionAttributes. NFC.
This just reduces the noise in a followup patch.
Part of D43900.
llvm-svn: 326385
Alexander Kornienko [Wed, 28 Feb 2018 23:30:29 +0000 (23:30 +0000)]
Rename more checks from misc- to bugprone-.
Summary:
clang-tidy/rename_check.py {misc,bugprone}-string-integer-assignment
clang-tidy/rename_check.py {misc,bugprone}-string-literal-with-embedded-nul
clang-tidy/rename_check.py {misc,bugprone}-suspicious-enum-usage
clang-tidy/rename_check.py {misc,bugprone}-suspicious-missing-comma
Reviewers: hokein, sammccall, aaron.ballman
Subscribers: klimek, cfe-commits, mgorny
Differential Revision: https://reviews.llvm.org/D43868
llvm-svn: 326384
Volodymyr Sapsai [Wed, 28 Feb 2018 23:27:40 +0000 (23:27 +0000)]
[libcxx] Fix last_write_time test for filesystems that don't support very small times.
APFS minimum supported file write time is -2^63 nanoseconds, which doesn't go
as far as `file_time_type::min()` that is equal to -2^63 microseconds on macOS.
This change doesn't affect filesystems that support `file_time_type` range only
for in-memory file time representation but not for on-disk representation. Such
filesystems are considered as `SupportsMinTime`.
rdar://problem/
35865151
Reviewers: EricWF, Hahnfeld
Subscribers: jkorous-apple, mclow.lists, cfe-commits, christof
Differential Revision: https://reviews.llvm.org/D42755
llvm-svn: 326383
Rui Ueyama [Wed, 28 Feb 2018 23:03:06 +0000 (23:03 +0000)]
Use DenseMap::lookup() instead of find() and a hand-written null check.
llvm-svn: 326382
Saleem Abdulrasool [Wed, 28 Feb 2018 23:00:50 +0000 (23:00 +0000)]
build: add the ability to create a symlink for dsymutil
Add a `LLVM_INSTALL_CCTOOLS_SYMLINKS` to mirror
`LLVM_INSTALL_BINUTILS_SYMLINKS`. For now, this allows us to create
symlinks for `dsymutil` to `llvm-dsymutil`. This option is off by
default, but the user can enable it.
llvm-svn: 326381
Simon Pilgrim [Wed, 28 Feb 2018 22:57:23 +0000 (22:57 +0000)]
[X86] Regenerate cmpxchg tests
Add 64-bit cmpxchg8b tests
llvm-svn: 326380
Rui Ueyama [Wed, 28 Feb 2018 22:51:51 +0000 (22:51 +0000)]
[WebAssembly] Reduce code repetition. NFC.
Differential Revision: https://reviews.llvm.org/D43910
llvm-svn: 326379
Jim Ingham [Wed, 28 Feb 2018 22:41:11 +0000 (22:41 +0000)]
Fix up the gtest targets for changes in the UnwindAssembly tests.
llvm-svn: 326378
Sanjay Patel [Wed, 28 Feb 2018 22:30:04 +0000 (22:30 +0000)]
[InstCombine] simplify code for X * -1.0 --> -X; NFC
I've added random FMF to one of the tests to show those are propagated.
llvm-svn: 326377
Jonas Devlieghere [Wed, 28 Feb 2018 22:28:44 +0000 (22:28 +0000)]
[GlobalOpt] don't change CC of musttail calle(e|r)
When the function has musttail call - its cc is fixed to be equal to the
cc of the musttail callee. In such case (and in the case of the musttail
callee), GlobalOpt should not change the cc to fastcc as it will break
the invariant.
This fixes PR36546
Patch by: Fedor Indutny (indutny)
Differential revision: https://reviews.llvm.org/D43859
llvm-svn: 326376
Craig Topper [Wed, 28 Feb 2018 22:23:55 +0000 (22:23 +0000)]
[X86] Lower extract_element from k-registers by bitcasting from v16i1 to i16 and extending/truncating.
This is equivalent to what isel was doing anyway but by canonicalizing earlier we can remove some patterns.
llvm-svn: 326375
Han Ming Ong [Wed, 28 Feb 2018 22:18:45 +0000 (22:18 +0000)]
Add ability to collect memory limit.
Reviewer: Jason Molenda
<rdar://problem/
37686560>
llvm-svn: 326374
Kostya Serebryany [Wed, 28 Feb 2018 21:58:19 +0000 (21:58 +0000)]
[hwasan] update the asm snippet in the docs to match the current default behaviour
llvm-svn: 326373
Simon Pilgrim [Wed, 28 Feb 2018 21:42:19 +0000 (21:42 +0000)]
[X86][AVX512] Improve support for signed saturation truncation stores
Matches what we already manage for unsigned saturation truncation stores
Differential Revision: https://reviews.llvm.org/D43629
llvm-svn: 326372
Rui Ueyama [Wed, 28 Feb 2018 21:32:24 +0000 (21:32 +0000)]
Make sure that clang-format doesn't reorder include files.
clang-format won't reorder include files if there is a blank line.
Thanks to Nico for the tips.
llvm-svn: 326371
Nico Weber [Wed, 28 Feb 2018 20:58:06 +0000 (20:58 +0000)]
Attempt to fix cl-include.c on Windows.
llvm-svn: 326370
Pavel Labath [Wed, 28 Feb 2018 20:57:26 +0000 (20:57 +0000)]
Adapt some tests to work with PPC64le architecture
Summary: Merge branch 'master' into adaptPPC64tests
Reviewers: clayborg, alexandreyy, labath
Reviewed By: clayborg, alexandreyy
Subscribers: luporl, lbianc, alexandreyy, lldb-commits
Differential Revision: https://reviews.llvm.org/D42917
Patch by Ana Julia Caetano <ana.caetano@eldorado.org.br>.
llvm-svn: 326369
Carlo Bertolli [Wed, 28 Feb 2018 20:48:35 +0000 (20:48 +0000)]
[OpenMP] Extend NVPTX SPMD implementation of combined constructs
Differential Revision: https://reviews.llvm.org/D43852
This patch extends the SPMD implementation to all target constructs and guards this implementation under a new flag.
llvm-svn: 326368
Pavel Labath [Wed, 28 Feb 2018 20:42:29 +0000 (20:42 +0000)]
Revert "[lldb] Use vFlash commands when writing to target's flash memory regions"
This reverts commit r326261 as it introduces inconsistencies in the
handling of load addresses for ObjectFileELF -- some parts of the class
use physical addresses, and some use virtual. This has manifested itself
as us not being able to set the load address of the vdso "module" on
android.
llvm-svn: 326367
Krzysztof Parzyszek [Wed, 28 Feb 2018 20:31:55 +0000 (20:31 +0000)]
[Hexagon] Add -ffixed-r19 driver option and translate it to +reserved-r19
llvm-svn: 326366
Eric Liu [Wed, 28 Feb 2018 20:31:00 +0000 (20:31 +0000)]
[clangd] Try to fix failures on clang-x64-ninja-win7 build bot.
llvm-svn: 326365
Krzysztof Parzyszek [Wed, 28 Feb 2018 20:29:36 +0000 (20:29 +0000)]
[Hexagon] Implement target feature +reserved-r19
llvm-svn: 326364