Vedant Kumar [Thu, 16 Aug 2018 23:05:15 +0000 (23:05 +0000)]
Add a basic integration test for C++ smart pointers
Check that the debugger can pretty-print unique_ptr and shared_ptr when
passed as a function argument.
rdar://
42314305
llvm-svn: 339961
Alex Langford [Thu, 16 Aug 2018 22:48:46 +0000 (22:48 +0000)]
Remove outdated TODOs in RegisterValue
These TODOs were for setting m_type in RegisterValue::SetValueFromString
in the case where reg_info's encoding was eEncodingUint or
eEncodingSint. m_type is set by SetUInt{8,16,32,64.128} during the
SetUInt call.
llvm-svn: 339959
Sanjay Patel [Thu, 16 Aug 2018 22:46:20 +0000 (22:46 +0000)]
[InstCombine] add reflection fold for tan(-x)
This is a follow-up suggested with rL339604.
For tan(), we don't have a corresponding LLVM
intrinsic -- unlike sin/cos -- so this is the
only way/place that we can do this fold currently.
llvm-svn: 339958
Evgeniy Stepanov [Thu, 16 Aug 2018 22:28:02 +0000 (22:28 +0000)]
Revert "[hwasan] Add __hwasan_handle_longjmp."
This reverts commit 339935 which breaks hwasan tests on x86_64.
llvm-svn: 339957
Vedant Kumar [Thu, 16 Aug 2018 22:24:47 +0000 (22:24 +0000)]
[InstrProf] Use atomic profile counter updates for TSan
Thread sanitizer instrumentation fails to skip all loads and stores to
profile counters. This can happen if profile counter updates are merged:
%.sink = phi i64* ...
%pgocount5 = load i64, i64* %.sink
%27 = add i64 %pgocount5, 1
%28 = bitcast i64* %.sink to i8*
call void @__tsan_write8(i8* %28)
store i64 %27, i64* %.sink
To suppress TSan diagnostics about racy counter updates, make the
counter updates atomic when TSan is enabled. If there's general interest
in this mode it can be surfaced as a clang/swift driver option.
Testing: check-{llvm,clang,profile}
rdar://
40477803
Differential Revision: https://reviews.llvm.org/D50867
llvm-svn: 339955
Greg Clayton [Thu, 16 Aug 2018 22:13:01 +0000 (22:13 +0000)]
Update the Core file loading instructions so they keep the process stopped after attaching to a core file.
llvm-svn: 339954
Sanjay Patel [Thu, 16 Aug 2018 22:05:51 +0000 (22:05 +0000)]
[InstCombine] add tests for tan with negated arg; NFC
llvm-svn: 339953
Richard Smith [Thu, 16 Aug 2018 22:04:36 +0000 (22:04 +0000)]
Factor Node creation out of the demangler. No functionality change intended.
(This is a port of llvm r339944 to libcxxabi.)
llvm-svn: 339952
Alina Sbirlea [Thu, 16 Aug 2018 21:58:44 +0000 (21:58 +0000)]
Update MemorySSA in Local utils removing blocks.
Summary: Extend Local utils to update MemorySSA.
Subscribers: sanjoy, jlebar, Prazek, george.burgess.iv, llvm-commits
Differential Revision: https://reviews.llvm.org/D48790
llvm-svn: 339951
Evgeniy Stepanov [Thu, 16 Aug 2018 21:56:04 +0000 (21:56 +0000)]
[hwasan] Enable Android logging.
Summary: Enable syslog as soon as the shadow is mapped.
Reviewers: vitalybuka, kcc
Subscribers: srhines, kubamracek, llvm-commits
Differential Revision: https://reviews.llvm.org/D50865
llvm-svn: 339950
Justin Bogner [Thu, 16 Aug 2018 21:55:09 +0000 (21:55 +0000)]
[docs] Try to clarify the FuzzingLLVM docs
Try to improve these docs based on some recent questions that were
sent to llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2018-August/125329.html
llvm-svn: 339949
Julie Hockett [Thu, 16 Aug 2018 21:54:34 +0000 (21:54 +0000)]
Implement a (simple) Markdown generator
Implementing a simple Markdown generator from the emitted bitcode
summary of declarations. Very primitive at this point, but will be
expanded. Currently emits an .md file for each class and namespace,
listing its contents.
For a more detailed overview of the tool, see the design document
on the mailing list:
http://lists.llvm.org/pipermail/cfe-dev/2017-December/056203.html
Differential Revision: https://reviews.llvm.org/D43424
llvm-svn: 339948
Alina Sbirlea [Thu, 16 Aug 2018 21:54:33 +0000 (21:54 +0000)]
[DomTree] Add constructor to create a new DT based on current DT/CFG and a set of Updates.
Summary:
Add the posibility of creating a new DT using a set of Updates.
This will essentially create a DT based on a CFG snapshot/view.
Additional refactoring for either this patch or follow-ups:
- create an utility for building BUI.
- replace BUI with a GraphDiff.
Reviewers: kuhar
Subscribers: sanjoy, jlebar, llvm-commits
Differential Revision: https://reviews.llvm.org/D50671
llvm-svn: 339947
Craig Topper [Thu, 16 Aug 2018 21:54:05 +0000 (21:54 +0000)]
[DAGCombiner] Don't reassociate operations that have the vector reduction flag set.
When nodes are reassociated the vector-reduction flag gets lost.
The test case is here is what would happen if you had a sum of absolute differences loop that started with a non-zero but contant sum and that loop was unrolled. The vectorizer will generate a constant vector for the initial value. And DAGCombiner reassociate tries to move it down the addition tree erasing the vector-reduction flag. Interestingly this moves constants the opposite direction of the reassociate IR pass.
I've chosen to just punt on the reassociate, but I suppose we could maybe preserve the flag if both nodes have it set.
Differential Revision: https://reviews.llvm.org/D50827
llvm-svn: 339946
Craig Topper [Thu, 16 Aug 2018 21:54:02 +0000 (21:54 +0000)]
[X86] In EFLAGS copy pass, don't emit EXTRACT_SUBREG instructions since we're after peephole
Normally the peephole pass converts EXTRACT_SUBREG to COPY instructions. But we're after peephole so we can't rely on it to clean these up.
To fix this, the eflags pass now emits a COPY with a subreg input.
I also noticed that in 32-bit mode we need to constrain the input to the copy to ensure the subreg is valid. Otherwise we'll fail verify-machineinstrs
Differential Revision: https://reviews.llvm.org/D50656
llvm-svn: 339945
Richard Smith [Thu, 16 Aug 2018 21:40:57 +0000 (21:40 +0000)]
Factor Node creation out of the demangler. No functionality change
intended.
llvm-svn: 339944
Marshall Clow [Thu, 16 Aug 2018 21:35:38 +0000 (21:35 +0000)]
Establish the <bit> header. NFC yet. Reviewed as https://reviews.llvm.org/D50815
llvm-svn: 339943
Reid Kleckner [Thu, 16 Aug 2018 21:34:41 +0000 (21:34 +0000)]
[MC] Improve COFF associative section lookup
Handle the case when the symbol is private. Private symbols are not in
the COFF object file symbol table, so they aren't inserted into
SymbolMap. We can't look up the section of the symbol that way. Instead,
get the MCSection from the MCSymbol and map that to the object file
section.
Print a better error message when the symbol has no section, like when
the symbol is undefined.
Fixes PR38607
llvm-svn: 339942
David Blaikie [Thu, 16 Aug 2018 21:30:24 +0000 (21:30 +0000)]
Update for LLVM API change
llvm-svn: 339941
Chandler Carruth [Thu, 16 Aug 2018 21:30:05 +0000 (21:30 +0000)]
[MI] Change the array of `MachineMemOperand` pointers to be
a generically extensible collection of extra info attached to
a `MachineInstr`.
The primary change here is cleaning up the APIs used for setting and
manipulating the `MachineMemOperand` pointer arrays so chat we can
change how they are allocated.
Then we introduce an extra info object that using the trailing object
pattern to attach some number of MMOs but also other extra info. The
design of this is specifically so that this extra info has a fixed
necessary cost (the header tracking what extra info is included) and
everything else can be tail allocated. This pattern works especially
well with a `BumpPtrAllocator` which we use here.
I've also added the basic scaffolding for putting interesting pointers
into this, namely pre- and post-instruction symbols. These aren't used
anywhere yet, they're just there to ensure I've actually gotten the data
structure types correct. I'll flesh out support for these in
a subsequent patch (MIR dumping, parsing, the works).
Finally, I've included an optimization where we store any single pointer
inline in the `MachineInstr` to avoid the allocation overhead. This is
expected to be the overwhelmingly most common case and so should avoid
any memory usage growth due to slightly less clever / dense allocation
when dealing with >1 MMO. This did require several ergonomic
improvements to the `PointerSumType` to reasonably support the various
usage models.
This also has a side effect of freeing up 8 bits within the
`MachineInstr` which could be repurposed for something else.
The suggested direction here came largely from Hal Finkel. I hope it was
worth it. ;] It does hopefully clear a path for subsequent extensions
w/o nearly as much leg work. Lots of thanks to Reid and Justin for
careful reviews and ideas about how to do all of this.
Differential Revision: https://reviews.llvm.org/D50701
llvm-svn: 339940
David Blaikie [Thu, 16 Aug 2018 21:29:55 +0000 (21:29 +0000)]
DebugInfo: Add metadata support for disabling DWARF pub sections
In cases where the debugger load time is a worthwhile tradeoff (or less
costly - such as loading from a DWP instead of a variety of DWOs
(possibly over a high-latency/distributed filesystem)) against object
file size, it can be reasonable to disable pubnames and corresponding
gdb-index creation in the linker.
A backend-flag version of this was implemented for NVPTX in
D44385/r327994 - which was fine for NVPTX which wouldn't mix-and-match
CUs. Now that it's going to be a user-facing option (likely powered by
"-gno-pubnames", the same as GCC) it should be encoded in the
DICompileUnit so it can vary per-CU.
After this, likely the NVPTX support should be migrated to the metadata
& the previous flag implementation should be removed.
Reviewers: aprantl
Differential Revision: https://reviews.llvm.org/D50213
llvm-svn: 339939
Michael Berg [Thu, 16 Aug 2018 20:59:45 +0000 (20:59 +0000)]
add a missed case for binary op FMF propagation under select folds
llvm-svn: 339938
Philip Reames [Thu, 16 Aug 2018 20:58:48 +0000 (20:58 +0000)]
[AST] Speculative build fix for a polly buildbot
I don't have polly setup to bulld locally and don't plan to. This should let the old API adapt to the new one. Can someone from polly please migrate usage and then delete the wrapper?
llvm-svn: 339937
Philip Reames [Thu, 16 Aug 2018 20:48:55 +0000 (20:48 +0000)]
[MemLoc] Fix a bug causing any use of invariant.end to crash in LICM
The fix is fairly simple, but is says something unpleasant about the usage and testing of invariant.start/end scopes that this went undetected. To put this in perspective, *any* invariant.end in a loop flowing through LICM crashed. I haven't bothered to figure out just how far back this goes, but it's not caused by any of the recent changes. We're probably talking months if not years.
llvm-svn: 339936
Evgeniy Stepanov [Thu, 16 Aug 2018 20:46:41 +0000 (20:46 +0000)]
[hwasan] Add __hwasan_handle_longjmp.
Summary:
A callback to annotate longjmp-like code.
Unlike __asan_handle_no_return, in hwasan we can not conservatively
"unpoison" the entire thread stack, because there is no such thing as
unpoisoned memory. Pointer and memory tags must always match.
Reviewers: vitalybuka, kcc
Subscribers: kubamracek, llvm-commits
Differential Revision: https://reviews.llvm.org/D50752
llvm-svn: 339935
Matt Arsenault [Thu, 16 Aug 2018 20:19:47 +0000 (20:19 +0000)]
AMDGPU: Correct errors in device table
llvm-svn: 339934
Emmett Neyman [Thu, 16 Aug 2018 20:13:40 +0000 (20:13 +0000)]
Update README and Dockerfile to include llvm-proto-fuzzer
Summary: Added commands to Dockerfile to build llvm-proto-fuzzer and the other related tools. Also added a section to the bottom of the README describing what llvm-proto-fuzzer does and how to run it.
Reviewers: morehouse, kcc
Reviewed By: morehouse
Subscribers: cfe-commits, llvm-commits
Differential Revision: https://reviews.llvm.org/D50829
llvm-svn: 339933
Evgeniy Stepanov [Thu, 16 Aug 2018 20:13:09 +0000 (20:13 +0000)]
[hwasan] Add malloc_fill_byte and free_fill_byte flags.
Reviewers: vitalybuka, kcc
Subscribers: kubamracek, llvm-commits
Differential Revision: https://reviews.llvm.org/D50753
llvm-svn: 339932
Krzysztof Parzyszek [Thu, 16 Aug 2018 20:12:15 +0000 (20:12 +0000)]
[SystemZ] Require asserts in subregliveness-06.mir
The option -misched=shuffle is only available with !NDEBUG builds.
llvm-svn: 339931
Philip Reames [Thu, 16 Aug 2018 20:11:15 +0000 (20:11 +0000)]
[LICM][NFC] Restructure pointer invalidation API in terms of MemoryLocation
Main value is just simplifying code. I'll further simply the argument handling case in a bit, but that involved a slightly orthogonal change so I went with the mildy ugly intermediate for this patch.
Note that the isSized check in the old LICM code was not carried across. It turns out that check was dead. a) no test exercised it, and b) langref and verifier had been updated to disallow unsized types used in loads.
llvm-svn: 339930
Vedant Kumar [Thu, 16 Aug 2018 19:56:38 +0000 (19:56 +0000)]
[dotest] Make --test-subdir work with --no-multiprocess
The single-process test runner is invoked in a number of different
scenarios, including when multiple test dirs are specified or (afaict)
when lit is used to drive the test suite.
Unfortunately the --test-subdir option did not work with the single
process test runner, breaking an important use case (using lit to run
swift-lldb Linux tests):
Failure URL: https://ci.swift.org/job/swift-PR-Linux/6841
We won't be able to run lldb tests within swift PR testing without
filtering down the set of tests.
This change makes --test-subdir work with the single-process runner.
llvm-svn: 339929
Andrea Di Biagio [Thu, 16 Aug 2018 19:45:13 +0000 (19:45 +0000)]
[llvm-mca] Fix -Wpessimizing-move warnings introduced by r339923.
Reported by buildbot `clang-with-lto-ubuntu` ( build #9858 ).
llvm-svn: 339928
Peter Collingbourne [Thu, 16 Aug 2018 19:29:01 +0000 (19:29 +0000)]
Add missing test file from r339799.
llvm-svn: 339927
Craig Topper [Thu, 16 Aug 2018 19:27:43 +0000 (19:27 +0000)]
[X86] Pre-commit test case for D50827.
llvm-svn: 339926
Jacob Gravelle [Thu, 16 Aug 2018 19:24:31 +0000 (19:24 +0000)]
[WebAssembly] Remove temporary workaround for function bitcasts
Summary:
EM_ASM no longer is lowered as varargs in C, so this workaround is
obsolete.
Reviewers: dschuff, sunfish
Subscribers: sbc100, aheejin, llvm-commits
Differential Revision: https://reviews.llvm.org/D50859
llvm-svn: 339925
Krzysztof Parzyszek [Thu, 16 Aug 2018 19:13:28 +0000 (19:13 +0000)]
[MachineVerifier] Check if predecessor is jointly dominated by undefs
Each use of a value should be jointly dominated by the union of defs and
undefs. It can happen that it will only be jointly dominated by undefs,
and that is still legal. Make sure that the verifier is aware of that.
llvm-svn: 339924
Andrea Di Biagio [Thu, 16 Aug 2018 19:00:48 +0000 (19:00 +0000)]
[llvm-mca] Refactor how execution is orchestrated by the Pipeline.
This patch changes how instruction execution is orchestrated by the Pipeline.
In particular, this patch makes it more explicit how instructions transition
through the various pipeline stages during execution.
The main goal is to simplify both the stage API and the Pipeline execution. At
the same time, this patch fixes some design issues which are currently latent,
but that are likely to cause problems in future if people start defining custom
pipelines.
The new design assumes that each pipeline stage knows the "next-in-sequence".
The Stage API has gained three new methods:
- isAvailable(IR)
- checkNextStage(IR)
- moveToTheNextStage(IR).
An instruction IR can be executed by a Stage if method `Stage::isAvailable(IR)`
returns true.
Instructions can move to next stages using method moveToTheNextStage(IR).
An instruction cannot be moved to the next stage if method checkNextStage(IR)
(called on the current stage) returns false.
Stages are now responsible for moving instructions to the next stage in sequence
if necessary.
Instructions are allowed to transition through multiple stages during a single
cycle (as long as stages are available, and as long as all the calls to
`checkNextStage(IR)` returns true).
Methods `Stage::preExecute()` and `Stage::postExecute()` have now become
redundant, and those are removed by this patch.
Method Pipeline::runCycle() is now simpler, and it correctly visits stages
on every begin/end of cycle.
Other changes:
- DispatchStage no longer requires a reference to the Scheduler.
- ExecuteStage no longer needs to directly interact with the
RetireControlUnit. Instead, executed instructions are now directly moved to the
next stage (i.e. the retire stage).
- RetireStage gained an execute method. This allowed us to remove the
dependency with the RCU in ExecuteStage.
- FecthStage now updates the "program counter" during cycleBegin() (i.e.
before we start executing new instructions).
- We no longer need Stage::Status to be returned by method execute(). It has
been dropped in favor of a more lightweight llvm::Error.
Overally, I measured a ~11% performance gain w.r.t. the previous design. I also
think that the Stage interface is probably easier to read now. That being said,
code comments have to be improved, and I plan to do it in a follow-up patch.
Differential revision: https://reviews.llvm.org/D50849
llvm-svn: 339923
Eli Friedman [Thu, 16 Aug 2018 18:39:39 +0000 (18:39 +0000)]
[SelectionDAG] Improve the legalisation lowering of UMULO.
There is no way in the universe, that doing a full-width division in
software will be faster than doing overflowing multiplication in
software in the first place, especially given that this same full-width
multiplication needs to be done anyway.
This patch replaces the previous implementation with a direct lowering
into an overflowing multiplication algorithm based on half-width
operations.
Correctness of the algorithm was verified by exhaustively checking the
output of this algorithm for overflowing multiplication of 16 bit
integers against an obviously correct widening multiplication. Baring
any oversights introduced by porting the algorithm to DAG, confidence in
correctness of this algorithm is extremely high.
Following table shows the change in both t = runtime and s = space. The
change is expressed as a multiplier of original, so anything under 1 is
“better” and anything above 1 is worse.
+-------+-----------+-----------+-------------+-------------+
| Arch | u64*u64 t | u64*u64 s | u128*u128 t | u128*u128 s |
+-------+-----------+-----------+-------------+-------------+
| X64 | - | - | ~0.5 | ~0.64 |
| i686 | ~0.5 | ~0.6666 | ~0.05 | ~0.9 |
| armv7 | - | ~0.75 | - | ~1.4 |
+-------+-----------+-----------+-------------+-------------+
Performance numbers have been collected by running overflowing
multiplication in a loop under `perf` on two x86_64 (one Intel Haswell,
other AMD Ryzen) based machines. Size numbers have been collected by
looking at the size of function containing an overflowing multiply in
a loop.
All in all, it can be seen that both performance and size has improved
except in the case of armv7 where code size has regressed for 128-bit
multiply. u128*u128 overflowing multiply on 32-bit platforms seem to
benefit from this change a lot, taking only 5% of the time compared to
original algorithm to calculate the same thing.
The final benefit of this change is that LLVM is now capable of lowering
the overflowing unsigned multiply for integers of any bit-width as long
as the target is capable of lowering regular multiplication for the same
bit-width. Previously, 128-bit overflowing multiply was the widest
possible.
Patch by Simonas Kazlauskas!
Differential Revision: https://reviews.llvm.org/D50310
llvm-svn: 339922
Jordan Rupprecht [Thu, 16 Aug 2018 18:29:40 +0000 (18:29 +0000)]
[llvm-strip] Add support for -p/--preserve-dates
Summary: [llvm-strip] Preserve access/modification timestamps when -p is used.
Reviewers: jakehehrlich, jhenderson, alexshap
Reviewed By: jhenderson
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D50744
llvm-svn: 339921
Reid Kleckner [Thu, 16 Aug 2018 18:24:59 +0000 (18:24 +0000)]
Fix lldb-vscode build on Windows
Include PosixAPI.h to get a PATH_MAX definition and replace CreateEvent
with CreateEventObject to avoid conflicts with the windows.h definition
of CreateEvent to CreateEventW.
llvm-svn: 339920
Raphael Isemann [Thu, 16 Aug 2018 18:22:21 +0000 (18:22 +0000)]
[ASTImporter] Add test for member pointer types.
Reviewers: a.sidorin, martong
Reviewed By: martong
Subscribers: rnkovacs, martong, cfe-commits
Differential Revision: https://reviews.llvm.org/D50792
llvm-svn: 339919
Raphael Isemann [Thu, 16 Aug 2018 18:21:33 +0000 (18:21 +0000)]
[ASTImporter] Add test for importing CompoundAssignOperators
Reviewers: a.sidorin, martong
Reviewed By: martong
Subscribers: rnkovacs, cfe-commits, martong
Differential Revision: https://reviews.llvm.org/D50793
llvm-svn: 339918
Raphael Isemann [Thu, 16 Aug 2018 18:20:52 +0000 (18:20 +0000)]
[ASTImporter] Add test for DoStmt
Reviewers: a.sidorin, martong
Reviewed By: martong
Subscribers: rnkovacs, martong, cfe-commits
Differential Revision: https://reviews.llvm.org/D50810
llvm-svn: 339917
Raphael Isemann [Thu, 16 Aug 2018 18:20:05 +0000 (18:20 +0000)]
[ASTImporter] Add test for WhileStmt
Reviewers: a.sidorin, martong
Reviewed By: martong
Subscribers: rnkovacs, martong, cfe-commits
Differential Revision: https://reviews.llvm.org/D50811
llvm-svn: 339916
Raphael Isemann [Thu, 16 Aug 2018 18:19:21 +0000 (18:19 +0000)]
[ASTImporter] Add test for IndirectGotoStmt
Reviewers: a.sidorin, martong
Reviewed By: martong
Subscribers: rnkovacs, martong, cfe-commits
Differential Revision: https://reviews.llvm.org/D50813
llvm-svn: 339915
Vedant Kumar [Thu, 16 Aug 2018 18:18:16 +0000 (18:18 +0000)]
Disable two flaky pexpect-backed tests on Darwin
These tests are sporadically timing out on our bots, e.g here:
https://ci.swift.org/job/swift-PR-Linux/6841
llvm-svn: 339914
Reid Kleckner [Thu, 16 Aug 2018 18:03:06 +0000 (18:03 +0000)]
Update LLD tests for CodeView dumper change in r339907
llvm-svn: 339913
Krzysztof Parzyszek [Thu, 16 Aug 2018 18:02:59 +0000 (18:02 +0000)]
[RegisterCoalescer] Shrink to uses if needed after removeCopyByCommutingDef
llvm-svn: 339912
Greg Clayton [Thu, 16 Aug 2018 17:59:38 +0000 (17:59 +0000)]
Add a new tool named "lldb-vscode" that implements the Visual Studio Code Debug Adaptor Protocol
This patch adds a new lldb-vscode tool that speaks the Microsoft Visual Studio Code debug adaptor protocol. It has full unit tests that test all packets.
This tool can be easily packaged up into a native extension and used with Visual Studio Code, and it can also be used by Nuclide
Differential Revision: https://reviews.llvm.org/D50365
llvm-svn: 339911
Reid Kleckner [Thu, 16 Aug 2018 17:51:58 +0000 (17:51 +0000)]
Update LLDB for LLVM CodeView API change in r339907
llvm-svn: 339910
Zachary Turner [Thu, 16 Aug 2018 17:48:32 +0000 (17:48 +0000)]
Fix memory leak in demangling of string literals.
llvm-svn: 339909
Simon Pilgrim [Thu, 16 Aug 2018 17:44:33 +0000 (17:44 +0000)]
[TargetLowering] Add support for non-uniform vectors to BuildSDIV
This patch refactors the existing TargetLowering::BuildSDIV base implementation to support non-uniform constant vector denominators.
This is the last patch necessary to close PR36545
Differential Revision: https://reviews.llvm.org/D50765
llvm-svn: 339908
Reid Kleckner [Thu, 16 Aug 2018 17:34:31 +0000 (17:34 +0000)]
[codeview] Use push_macro to avoid conflicts instead of a prefix
Summary:
This prefix was added in r333421, and it changed our dumper output to
say things like "CVRegEAX" instead of just "EAX". That's a functional
change that I'd rather avoid.
I tested GCC, Clang, and MSVC, and all of them support #pragma
push_macro. They don't issue warnings whem the macro is not defined
either.
I don't have a Mac so I can't test the real termios.h header, but I
looked at the termios.h sources online and looked for other conflicts.
I saw only the CR* macros, so those are the ones we work around.
Reviewers: zturner, JDevlieghere
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D50851
llvm-svn: 339907
Nirav Dave [Thu, 16 Aug 2018 17:22:31 +0000 (17:22 +0000)]
[MC] Cleanup noop default case spelling. NFC.
llvm-svn: 339906
Fangrui Song [Thu, 16 Aug 2018 17:22:02 +0000 (17:22 +0000)]
[ELF] mergeSections: remove non-alive MergeInputSection
Summary: This makes it conform to what the comment says. Otherwise when getErrPlace() is called afterwards, cast<InputSection>(D) will cause incompatible cast as MergeInputSection is not a subclass of InputSection.
Reviewers: ruiu, grimar, espindola, pcc
Reviewed By: grimar
Subscribers: emaste, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D50742
llvm-svn: 339904
Tom Stellard [Thu, 16 Aug 2018 17:15:03 +0000 (17:15 +0000)]
Revert "unittests: Don't install TestPlugin.so"
This reverts commit r339897.
This breaks the build on Windows and platforms where loadable modules
aren't supported.
llvm-svn: 339903
Matt Arsenault [Thu, 16 Aug 2018 17:07:52 +0000 (17:07 +0000)]
AMDGPU: Custom lower fexp
This will allow the library to just use __builtin_expf directly
without expanding this itself. Note f64 still won't work because
there is no exp instruction for it.
llvm-svn: 339902
Simon Pilgrim [Thu, 16 Aug 2018 17:07:41 +0000 (17:07 +0000)]
[X86][SSE] Add sdiv by nonuniform constant vector test containing -1/+1 and all-bits style constants
llvm-svn: 339901
Evandro Menezes [Thu, 16 Aug 2018 17:03:22 +0000 (17:03 +0000)]
[NFC] Fix typo in test cases
llvm-svn: 339900
Jordan Rupprecht [Thu, 16 Aug 2018 16:55:07 +0000 (16:55 +0000)]
NFC: Test commit access
Testing commit access from a new machine, so using this as an opportunity to revert my old test access commit (r336006) that I never cleaned up.
llvm-svn: 339899
Simon Pilgrim [Thu, 16 Aug 2018 16:54:06 +0000 (16:54 +0000)]
[TargetLowering] Refactor BuildSDIV in preparation for D50765. NFCI.
Pull out magic factor calculators into a helper function, use 0/+1/-1 multiplication factor to (optionally) add/sub the numerator.
llvm-svn: 339898
Tom Stellard [Thu, 16 Aug 2018 16:53:06 +0000 (16:53 +0000)]
unittests: Don't install TestPlugin.so
Summary:
add_llvm_loadable_module adds an install target by default, but this
module is only used for a unit test, so we don't need to install it.
Reviewers: philip.pfaffe, thakis
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D50668
llvm-svn: 339897
Benjamin Kramer [Thu, 16 Aug 2018 16:50:23 +0000 (16:50 +0000)]
[MC] Remove unused variable
llvm-svn: 339896
Nirav Dave [Thu, 16 Aug 2018 16:31:14 +0000 (16:31 +0000)]
[MC][X86] Enhance X86 Register expression handling to more closely match GCC.
Allow the comparison of x86 registers in the evaluation of assembler
directives. This generalizes and simplifies the extension from r334022
to catch another case found in the Linux kernel.
Reviewers: rnk, void
Reviewed By: rnk
Subscribers: hiraditya, nickdesaulniers, llvm-commits
Differential Revision: https://reviews.llvm.org/D50795
llvm-svn: 339895
Zachary Turner [Thu, 16 Aug 2018 16:30:27 +0000 (16:30 +0000)]
Fix -Wmicrosoft-goto warnings.
llvm-svn: 339894
Zachary Turner [Thu, 16 Aug 2018 16:17:55 +0000 (16:17 +0000)]
Add support for AVX-512 CodeView registers.
When compiling with /arch:AVX512 and optimizations turned on,
we could crash while emitting debug info because we did not
have CodeView register constants for the AVX 512 register
set defined. This patch defines them.
Differential Revision: https://reviews.llvm.org/D50819
llvm-svn: 339893
Zachary Turner [Thu, 16 Aug 2018 16:17:36 +0000 (16:17 +0000)]
[MS Demangler] Demangle string literals.
When demangling string literals, Microsoft's undname
simply prints 'string'. This patch implements string
literal demangling while doing a bit better than this
by decoding as much of the string as possible and
trying to faithfully reproduce the original string
literal definition.
This is a bit tricky because the different character
types char, char16_t, and char32_t are not uniquely
identified by the mangling, so we have to use a
heuristic to try to guess the character type. But
it works pretty well, and many tests are added to
illustrate the behavior.
Differential Revision: https://reviews.llvm.org/D50806
llvm-svn: 339892
Zachary Turner [Thu, 16 Aug 2018 16:17:17 +0000 (16:17 +0000)]
[MS Demangler] Don't fail on MD5-mangled names.
When we have an MD5 mangled name, we shouldn't choke and say
that it's an invalid name. Even though it's impossible to demangle,
we should just output the original name.
llvm-svn: 339891
Simon Pilgrim [Thu, 16 Aug 2018 16:16:28 +0000 (16:16 +0000)]
[TableGen] TypeSetByHwMode::operator== optimization
This operator is called a great deal, by checking for the cheap isSimple equality cases first (a common occurrence) we can improve performance as we avoid a lot of std::map find/iteration in hasDefault.
isSimple also means that a default value is present, so we can avoid some hasDefault calls.
This also avoids a rather dodgy piece of logic that was checking for isSimple() && !VTS.isSimple() but not the inverse - it now uses the general hasDefault mode comparison test instead.
Saves around 15secs in debug builds of x86 -gen-dag-isel.
Differential Revision: https://reviews.llvm.org/D50841
llvm-svn: 339890
Sanjay Patel [Thu, 16 Aug 2018 16:10:42 +0000 (16:10 +0000)]
[ConstantFolding] add tests for funnel shift intrinsics; NFC
No functionality for this yet.
llvm-svn: 339889
Simon Pilgrim [Thu, 16 Aug 2018 16:04:05 +0000 (16:04 +0000)]
[TableGen] Avoid self getPredicates() != comparison. NFCI.
We were performing a completely unnecessary full comparison of the same std::vector<Predicate>.
llvm-svn: 339888
Evandro Menezes [Thu, 16 Aug 2018 15:58:08 +0000 (15:58 +0000)]
[InstCombine] Expand the simplification of pow(x, 0.5) to sqrt(x)
Expand the number of cases when `pow(x, 0.5)` is simplified into `sqrt(x)`
by considering the math semantics with more granularity.
Differential revision: https://reviews.llvm.org/D50036
llvm-svn: 339887
David Carlier [Thu, 16 Aug 2018 15:54:38 +0000 (15:54 +0000)]
[Sanitizer] Fix build openbsd
- The alternative syscall exists only on FreeBSD.
- Adding OpenBSD's equivalent and while at it other
remaining oses ones.
Reviewers: vitalybuka, krytarowsky, hiraditya
Reviewed By: hiraditya
Differential Revision: https://reviews.llvm.org/D50760
llvm-svn: 339886
Andrea Di Biagio [Thu, 16 Aug 2018 15:43:09 +0000 (15:43 +0000)]
[llvm-mca] Small refactoring in preparation for another patch that will improve the modularity of the Pipeline. NFCI
The main difference is that now `cycleStart()` and `cycleEnd()` return an
llvm::Error.
This patch implements a few minor style changes, and adds missing 'const' to
some methods.
llvm-svn: 339885
Simon Pilgrim [Thu, 16 Aug 2018 15:29:24 +0000 (15:29 +0000)]
[TableGen] Return ValueTypeByHwMode by const reference from CodeGenRegisterClass::getValueTypeNum
Avoids costly std::map copies inside ValueTypeByHwMode constructor
llvm-svn: 339884
Hans Wennborg [Thu, 16 Aug 2018 15:12:12 +0000 (15:12 +0000)]
[cmake] Prevent LLVMgold.so from being unloaded on Linux
Extend the fix from D40459 to also apply to modules such as the LLVM
gold plugin. This is needed because current binutils master (and future
binutils 2.32) calls dlclose() on bfd plugins as part of a recent fix
for https://sourceware.org/bugzilla/show_bug.cgi?id=23460.
Patch by Evangelos Foutras!
Differential Revision: https://reviews.llvm.org/D50416
llvm-svn: 339883
George Rimar [Thu, 16 Aug 2018 14:07:29 +0000 (14:07 +0000)]
[LLD][ELF] - Add a test case for DT_SONAME entry reading.
This covers a following line with a test:
https://github.com/llvm-mirror/lld/blob/master/ELF/InputFiles.cpp#L899
llvm-svn: 339880
Simon Pilgrim [Thu, 16 Aug 2018 13:55:10 +0000 (13:55 +0000)]
Fixed unused variable warning. NFCI.
llvm-svn: 339879
Stefan Maksimovic [Thu, 16 Aug 2018 13:40:16 +0000 (13:40 +0000)]
[libunwind][mips] Include gcc_s for linkage
When compiling with optimizations, mips requires various helper routines(__ashldi3 and the like) contained in libgcc_s.
Conditionally include libgcc_s in the set of libraries to be linked to.
Differential Revision: https://reviews.llvm.org/D50243
llvm-svn: 339878
Kirill Bobyrev [Thu, 16 Aug 2018 13:19:43 +0000 (13:19 +0000)]
[clangd] NFC: Improve Dex Iterators debugging traits
This patch improves `dex::Iterator` string representation by
incorporating the information about the element which is currently being
pointed to by the `DocumentIterator`.
Reviewed by: ioeric
Differential Revision: https://reviews.llvm.org/D50689
llvm-svn: 339877
George Rimar [Thu, 16 Aug 2018 13:02:50 +0000 (13:02 +0000)]
[LLD][ELF] - Add a test case.
This covers the following line with a test:
https://github.com/llvm-mirror/lld/blob/master/ELF/InputFiles.cpp#L487
llvm-svn: 339876
Sanjay Patel [Thu, 16 Aug 2018 12:52:17 +0000 (12:52 +0000)]
[InstCombine] move vector compare before same-shuffled ops
This is a step towards fixing PR37463:
https://bugs.llvm.org/show_bug.cgi?id=37463
llvm-svn: 339875
Louis Dionne [Thu, 16 Aug 2018 12:44:28 +0000 (12:44 +0000)]
[libcxx] By default, do not use internal_linkage to hide symbols from the ABI
Summary:
https://reviews.llvm.org/D49240 led to symbol size problems in Chromium, and
we expect this may be the case in other projects built in debug mode too.
Instead, unless users explicitly ask for internal_linkage, we use always_inline
like we used to.
In the future, when we have a solution that allows us to drop always_inline
without falling back on internal_linkage, we can replace always_inline by
that.
Note that this commit introduces a change in contract for existing libc++
users: by default, libc++ used to guarantee that TUs built with different
versions of libc++ could be linked together. With the introduction of the
_LIBCPP_HIDE_FROM_ABI_PER_TU macro, the default behavior is that TUs built
with different libc++ versions are not guaranteed to link. This is a change
in contract but not a change in behavior, since the current implementation
still allows linking TUs built with different libc++ versions together.
Reviewers: EricWF, mclow.lists, dexonsmith, hans, rnk
Subscribers: christof, cfe-commits
Differential Revision: https://reviews.llvm.org/D50652
llvm-svn: 339874
George Rimar [Thu, 16 Aug 2018 12:44:17 +0000 (12:44 +0000)]
[yaml2obj] - Allow to use numeric sh_link (Link) value for sections.
That change allows using numeric values for Link field.
It is consistent with the code for another fields in this method.
llvm-svn: 339873
George Rimar [Thu, 16 Aug 2018 12:40:27 +0000 (12:40 +0000)]
[yaml2elf] - Use check-next in test.
Its a follow up for rL339870.
llvm-svn: 339872
Sam Parker [Thu, 16 Aug 2018 12:24:40 +0000 (12:24 +0000)]
[ARM] Ignore GEPs in ARMCodeGenPrepare
While searching through the use-def tree, ignore GetElementPtrInst
instructions because they don't need promoting and neither do their
indices. Otherwise, the wide indices prevent the transformation from
happening.
Differential Revision: https://reviews.llvm.org/D50762
llvm-svn: 339871
George Rimar [Thu, 16 Aug 2018 12:23:22 +0000 (12:23 +0000)]
[yaml2elf] - Simplify code, add a test. NFC.
This simplifies the code allowing to set the sh_info
for relocations sections. And adds a missing test.
llvm-svn: 339870
Dean Michael Berris [Thu, 16 Aug 2018 12:19:03 +0000 (12:19 +0000)]
[XRay][compiler-rt] Remove MAP_NORESERVE from XRay allocations
Summary:
This reverses an earlier decision to allow seg-faulting from the
XRay-allocated memory if it turns out that the system cannot provide
physical memory backing that cannot be swapped in/out on Linux.
This addresses http://llvm.org/PR38588.
Reviewers: eizan
Reviewed By: eizan
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D50831
llvm-svn: 339869
Sam Parker [Thu, 16 Aug 2018 11:54:09 +0000 (11:54 +0000)]
[ARM] Allow zext in ARMCodeGenPrepare
Treat zext instructions as roots, like we do for truncs.
Differential Revision: https://reviews.llvm.org/D50759
llvm-svn: 339868
George Rimar [Thu, 16 Aug 2018 11:48:18 +0000 (11:48 +0000)]
[LLD][ELF] - Add test case.
To cover the following error message:
https://github.com/llvm-mirror/lld/blob/master/ELF/InputFiles.cpp#L463
llvm-svn: 339867
Simon Pilgrim [Thu, 16 Aug 2018 11:41:19 +0000 (11:41 +0000)]
Attempt to fix clangd tests on older compilers
Old gcc versions of gcc struggle with raw string literals inside macros.
Inspired by rL339759
llvm-svn: 339866
Yvan Roux [Thu, 16 Aug 2018 11:38:09 +0000 (11:38 +0000)]
[libcxxabi] Fix test_exception_address_alignment test for ARM
Check _LIBCXXABI_ARM_EHABI macro instead of libunwind version.
Fixes PR34182
Differential revision: https://reviews.llvm.org/D50170
llvm-svn: 339865
Alex Bradbury [Thu, 16 Aug 2018 11:26:37 +0000 (11:26 +0000)]
[RISCV][MC] Don't fold symbol differences if requiresDiffExpressionRelocations is true
When emitting the difference between two symbols, the standard behavior is
that the difference will be resolved to an absolute value if both of the
symbols are offsets from the same data fragment. This is undesirable on
architectures such as RISC-V where relaxation in the linker may cause the
computed difference to become invalid. This caused an issue when compiling to
object code, where the size of a function in the debug information was already
calculated even though it could change as a consequence of relaxation in the
subsequent linking stage.
This patch inhibits the resolution of symbol differences to absolute values
where the target's AsmBackend has declared that it does not want these to be
folded.
Differential Revision: https://reviews.llvm.org/D45773
Patch by Edward Jones.
llvm-svn: 339864
Simon Pilgrim [Thu, 16 Aug 2018 11:08:23 +0000 (11:08 +0000)]
[ADT] Replace APInt::WORD_MAX with APInt::WORDTYPE_MAX
The windows SDK defines WORD_MAX, so any poor soul that wants to use LLVM in a project that depends on the windows SDK gets a build error.
Given that it actually describes the maximal value of WordType, it actually fits even better than WORD_MAX
Patch by: @miscco
Differential Revision: https://reviews.llvm.org/D50777
llvm-svn: 339863
Bruno Ricci [Thu, 16 Aug 2018 10:48:16 +0000 (10:48 +0000)]
[AST] Store the OwnedTagDecl as a trailing object in ElaboratedType.
The TagDecl *OwnedTagDecl in ElaboratedType is quite commonly
null (at least when parsing all of Boost, it is non-null for only about 600
of the 66k ElaboratedType). Therefore we can save a pointer in the
common case by storing it as a trailing object, and storing a bit in the
bit-fields of Type indicating when the pointer is null.
Reviewed By: rjmccall
Differential Revision: https://reviews.llvm.org/D50715
llvm-svn: 339862
Bruno Ricci [Thu, 16 Aug 2018 10:33:36 +0000 (10:33 +0000)]
[AST] Pack the unsigned of SubstTemplateTypeParmPackType into Type
The bit-fields of Type have enough space for the member
unsigned NumArgs of SubstTemplateTypeParmPackType.
Reviewed By: erichkeane
Differential Revision: https://reviews.llvm.org/D50713
llvm-svn: 339861
Bruno Ricci [Thu, 16 Aug 2018 10:28:18 +0000 (10:28 +0000)]
[AST] Pack the unsigned of DependentTemplateSpecializationType into Type
The bit-fields of `Type` have enough space for the member
`unsigned NumArgs` of `DependentTemplateSpecializationType`.
Reviewed By: erichkeane
Differential Revision: https://reviews.llvm.org/D50712
llvm-svn: 339860
Sam Parker [Thu, 16 Aug 2018 10:05:39 +0000 (10:05 +0000)]
[ARM] Allow signed icmps in ARMCodeGenPrepare
Originally committed in r339755 which was reverted in r339806 due to
an asan issue. The issue was caused by my assumption that operands to
a CallInst mapped to the FunctionType Params. CallInsts are now
handled by iterating over their ArgOperands instead of Operands.
Original Message:
Treat signed icmps as 'sinks', allowing them to be in the use-def
tree, enabling more promotions to be performed. As a sink, any
promoted incoming values need to be truncated before being used by
the signed icmp.
Differential Revision: https://reviews.llvm.org/D50067
llvm-svn: 339858
Stefan Maksimovic [Thu, 16 Aug 2018 08:49:50 +0000 (08:49 +0000)]
[libunwind][mips] Guard accumulator registers
Mipsr6 does not possess HI and LO accumulator registers, adjust validRegister functions to respect that.
Differential Revision: https://reviews.llvm.org/D50244
llvm-svn: 339849
Stefan Maksimovic [Thu, 16 Aug 2018 08:47:43 +0000 (08:47 +0000)]
[libunwind][mips] Modify the __mips_fpr macro check
The __mips_fpr macro can take the value of 0 as well, change to account for that case.
Differential Revision: https://reviews.llvm.org/D50245
llvm-svn: 339848