Jonas Devlieghere [Wed, 25 Jul 2018 15:20:15 +0000 (15:20 +0000)]
[ProcessGDBRemote] handle result from ConnectToDebugserver
We ignored the result from ConnectToDebugserver, causing certain errors
(like a failed handshake) not to surface.
llvm-svn: 337932
Stefan Granitz [Wed, 25 Jul 2018 15:19:04 +0000 (15:19 +0000)]
Use LLVM's new ItaniumPartialDemangler in LLDB
Summary:
Replace the existing combination of FastDemangle and the fallback to llvm::itaniumDemangle() with LLVM's new ItaniumPartialDemangler. It slightly reduces complexity and slightly improves performance, but doesn't introduce conceptual changes. This patch is preparing for more fundamental improvements on LLDB's demangling approach.
Reviewers: friss, jingham, erik.pilkington, labath, clayborg, mgorny, davide, JDevlieghere
Reviewed By: JDevlieghere
Subscribers: teemperor, JDevlieghere, labath, clayborg, davide, lldb-commits, mgorny, erik.pilkington
Differential Revision: https://reviews.llvm.org/D49612
llvm-svn: 337931
Andres Freund [Wed, 25 Jul 2018 15:04:57 +0000 (15:04 +0000)]
Move JIT listener C binding fallbackks to ExecutionEngineBindings.cpp.
Initially, in https://reviews.llvm.org/D44890, I had these defined as
empty functions inside the header when the respective event listener
was not built in. As done in that commit, that wasn't correct, because
it was a ODR violation. Krasimir hot-fixed that in r333265, but that
wasn't quite right either, because it'd lead to the symbol not being
available.
Instead just move the fallbacksto ExecutionEngineBindings.cpp. Could
define them as static inlines in the header too, but I don't think it
matters.
Reviewers: whitequark
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D49654
llvm-svn: 337930
Jeremy Morse [Wed, 25 Jul 2018 14:48:53 +0000 (14:48 +0000)]
[XRay tests] Don't filter test-critical calls
By default, xray filters events that takes less than 5uS from its log.
In this existing test, should printf complete very quickly this will
lead to test-critical function calls being filtered (i.e. print_parent_tid).
Given that we're not testing the filtering feature, disable it for this
test.
llvm-svn: 337929
Alexey Bataev [Wed, 25 Jul 2018 14:40:26 +0000 (14:40 +0000)]
[OPENMP] Fix PR38256: Fix locations of the artificial conditional op.
Fixed the source locations of the conditional op so that they don'r
crash coverage pass.
llvm-svn: 337928
David Carlier [Wed, 25 Jul 2018 14:27:14 +0000 (14:27 +0000)]
Fix tsan doc
llvm-svn: 337927
David Carlier [Wed, 25 Jul 2018 13:55:06 +0000 (13:55 +0000)]
[Docs] Update supported oses for safestack, ubsan, asan, tsan and msan
Adding oses others than Linux.
llvm-svn: 337926
Louis Dionne [Wed, 25 Jul 2018 13:40:49 +0000 (13:40 +0000)]
[NFC] Fix grammatical mistakes in libc++ FileTimeType design docs
llvm-svn: 337925
Pavel Labath [Wed, 25 Jul 2018 12:52:30 +0000 (12:52 +0000)]
Revert "dwarfgen: Add support for generating the debug_str_offsets section"
This reverts commit r337910 as it's generating "ambiguous call to
addAttribute" errors on some bots.
Will resubmit once I get a chance to look into the problem.
llvm-svn: 337924
Mikhail R. Gadelha [Wed, 25 Jul 2018 12:49:47 +0000 (12:49 +0000)]
[analyzer] Use the macro REGISTER_TRAIT_WITH_PROGRAMSTATE in the Z3 backend
Summary:
The macro was manually expanded in the Z3 backend and this patch adds it back.
Adding the expanded code is dangerous as the macro may change in the future and the expanded code might be left outdated.
Reviewers: NoQ, george.karpenkov
Reviewed By: george.karpenkov
Subscribers: xazax.hun, szepet, a.sidorin
Differential Revision: https://reviews.llvm.org/D49769
llvm-svn: 337923
Mikhail R. Gadelha [Wed, 25 Jul 2018 12:49:43 +0000 (12:49 +0000)]
[analyzer] Removed API used by the Refutation Manager from SMTConstraintManager and replace by proper calls to SMTSolver
Summary:
Third patch in the refactoring series, to decouple the SMT Solver from the Refutation Manager (1st: D49668, 2nd: D49767).
The refutation API in the `SMTConstraintManager` was a hack to allow us to create an SMT solver and verify the constraints; it was conceptually wrong from the start. Now, we don't actually need to use the `SMTConstraintManager` and can create an SMT object directly, add the constraints and check them.
While updating the Falsification visitor, I inlined the two functions that were used to collect the constraints and add them to the solver.
As a result of this patch, we could move the SMT API elsewhere and as it's not really dependent on the CSA anymore. Maybe we can create a new dir (utils/smt) for Z3 and future solvers?
Reviewers: NoQ, george.karpenkov
Reviewed By: george.karpenkov
Subscribers: xazax.hun, szepet, a.sidorin
Differential Revision: https://reviews.llvm.org/D49768
llvm-svn: 337922
Mikhail R. Gadelha [Wed, 25 Jul 2018 12:49:37 +0000 (12:49 +0000)]
[analyzer] Moved code from SMTConstraintManager to SMTSolver
Summary:
This is the second part of D49668, and moves all the code that's not specific to a ConstraintManager to SMTSolver.
No functional change intended.
Reviewers: NoQ, george.karpenkov
Reviewed By: george.karpenkov
Subscribers: xazax.hun, szepet, a.sidorin
Differential Revision: https://reviews.llvm.org/D49767
llvm-svn: 337921
Mikhail R. Gadelha [Wed, 25 Jul 2018 12:49:32 +0000 (12:49 +0000)]
[analyzer] Try to minimize the number of equivalent bug reports evaluated by the refutation manager
Summary:
This patch changes how the SMT bug refutation runs in an equivalent bug report class.
Now, all other visitor are executed until they find a valid bug or mark all bugs as invalid. When the one valid bug is found (and crosscheck is enabled), the SMT refutation checks the satisfiability of this single bug.
If the bug is still valid after checking with Z3, it is returned and a bug report is created. If the bug is found to be invalid, the next bug report in the equivalent class goes through the same process, until we find a valid bug or all bugs are marked as invalid.
Massive speedups when verifying redis/src/rax.c, from 1500s to 10s.
Reviewers: NoQ, george.karpenkov
Reviewed By: george.karpenkov
Subscribers: xazax.hun, szepet, a.sidorin
Differential Revision: https://reviews.llvm.org/D49693
llvm-svn: 337920
Mikhail R. Gadelha [Wed, 25 Jul 2018 12:49:29 +0000 (12:49 +0000)]
[analyzer] Moved non solver specific code from Z3ConstraintManager to SMTConstraintManager
Summary:
This patch moves a lot of code from `Z3ConstraintManager` to `SMTConstraintManager`, leaving only the necessary:
* `canReasonAbout` which returns if a Solver can handle a given `SVal` (should be moved to `SMTSolver` in the future).
* `removeDeadBindings`, `assumeExpr` and `print`: methods that need to use `ConstraintZ3Ty`, can probably be moved to `SMTConstraintManager` in the future.
The patch creates a new file, `SMTConstraintManager.cpp` with the moved code. Conceptually, this is move in the right direction and needs further improvements: `SMTConstraintManager` still does a lot of things that are not required by a `ConstraintManager`.
We ought to move the unrelated to `SMTSolver` and remove everything that's not related to a `ConstraintManager`. In particular, we could remove `addRangeConstraints` and `isModelFeasible`, and make the refutation manager create an Z3Solver directly.
Reviewers: NoQ, george.karpenkov
Reviewed By: george.karpenkov
Subscribers: mgorny, xazax.hun, szepet, a.sidorin
Differential Revision: https://reviews.llvm.org/D49668
llvm-svn: 337919
Mikhail R. Gadelha [Wed, 25 Jul 2018 12:49:23 +0000 (12:49 +0000)]
[analyzer] Implemented SMT generic API
Summary:
Created new SMT generic API.
Small changes to `Z3ConstraintManager` because of the new generic objects (`SMTSort` and `SMTExpr`) returned by `SMTSolver`.
Reviewers: george.karpenkov, NoQ
Reviewed By: george.karpenkov
Subscribers: mgorny, xazax.hun, szepet, a.sidorin
Differential Revision: https://reviews.llvm.org/D49495
llvm-svn: 337918
Mikhail R. Gadelha [Wed, 25 Jul 2018 12:49:19 +0000 (12:49 +0000)]
[analyzer] Create generic SMT Expr class
Summary:
New base class for all future SMT Exprs.
No major changes except moving `areEquivalent` and `getFloatSemantics` outside of `Z3Expr` to keep the class minimal.
Reviewers: NoQ, george.karpenkov
Reviewed By: george.karpenkov
Subscribers: xazax.hun, szepet, a.sidorin
Differential Revision: https://reviews.llvm.org/D49551
llvm-svn: 337917
Mikhail R. Gadelha [Wed, 25 Jul 2018 12:49:15 +0000 (12:49 +0000)]
[analyzer] Create generic SMT Sort Class
Summary:
New base class for all future SMT sorts.
The only change is that the class implements methods `isBooleanSort()`, `isBitvectorSort()` and `isFloatSort()` so it doesn't rely on `Z3`'s enum.
Reviewers: NoQ, george.karpenkov
Reviewed By: george.karpenkov
Subscribers: xazax.hun, szepet, a.sidorin
Differential Revision: https://reviews.llvm.org/D49550
llvm-svn: 337916
Mikhail R. Gadelha [Wed, 25 Jul 2018 12:49:11 +0000 (12:49 +0000)]
[analyzer] Moved static Context to class member
Summary:
Although it is a big patch, the changes are simple:
1. There is one `Z3_Context` now, member of the `SMTConstraintManager` class.
2. `Z3Expr`, `Z3Sort`, `Z3Model` and `Z3Solver` are constructed with a reference to the `Z3_Context` in `SMTConstraintManager`.
3. All static functions are now members of `Z3Solver`, e.g, the `SMTConstraintManager` now calls `Solver.fromBoolean(false)` instead of `Z3Expr::fromBoolean(false)`.
Most of the patch only move stuff around except:
1. New method `Z3Sort MkSort(const QualType &Ty, unsigned BitWidth)`, that creates a sort based on the `QualType` and its width. Used to simplify the `fromData` method.
Unfortunate consequence of this patch:
1. `getInterpretation` was moved from `Z3Model` class to `Z3Solver`, because it needs to create a `Z3Sort` before returning the interpretation. This can be fixed by changing both `toAPFloat` and `toAPSInt` by removing the dependency of `Z3Sort` (it's only used to check which Sort was created and to retrieve the type width).
Reviewers: NoQ, george.karpenkov, ddcc
Reviewed By: george.karpenkov
Subscribers: xazax.hun, szepet, a.sidorin
Differential Revision: https://reviews.llvm.org/D49236
llvm-svn: 337915
Mikhail R. Gadelha [Wed, 25 Jul 2018 12:49:07 +0000 (12:49 +0000)]
[analyzer] Create generic SMT Context class
Summary:
This patch creates `SMTContext` which will wrap a specific SMT context, through `SMTSolverContext`.
The templated `SMTSolverContext` class it's a simple wrapper around a SMT specific context (currently only used in the Z3 backend), while `Z3Context` inherits `SMTSolverContext<Z3_context>` and implements solver specific operations like initialization and destruction of the context.
This separation was done because:
1. We might want to keep one single context, shared across different `SMTConstraintManager`s. It can be achieved by constructing a `SMTContext`, through a function like `CreateSMTContext(Z3)`, `CreateSMTContext(BOOLECTOR)`, etc. The rest of the CSA only need to know about `SMTContext`, so maybe it's a good idea moving `SMTSolverContext` to a separate header in the future.
2. Any generic SMT operation will only require one `SMTSolverContext`object, which can access the specific context by calling `getContext()`.
Reviewers: NoQ, george.karpenkov
Reviewed By: george.karpenkov
Subscribers: xazax.hun, szepet, a.sidorin
Differential Revision: https://reviews.llvm.org/D49233
llvm-svn: 337914
David Carlier [Wed, 25 Jul 2018 12:38:23 +0000 (12:38 +0000)]
[Asan][Msan] Unit tests Disable some tests for FreeBSD
Reviewers: krytarowski
Reviewed By: krytarowski
Differential Revision: https://reviews.llvm.org/D49784
llvm-svn: 337913
Petar Jovanovic [Wed, 25 Jul 2018 12:35:01 +0000 (12:35 +0000)]
[MIPS GlobalISel] Lower pointer arguments
Add support for lowering pointer arguments.
Changing type from pointer to integer is already done in
MipsTargetLowering::getRegisterTypeForCallingConv.
Patch by Petar Avramovic.
Differential Revision: https://reviews.llvm.org/D49419
llvm-svn: 337912
Jonas Hahnfeld [Wed, 25 Jul 2018 12:34:31 +0000 (12:34 +0000)]
[OMPT] Fix typo in test parallel/nested_thread_num.c
This caused test failures with GCC since its initial commit in
r336085 (https://reviews.llvm.org/D46533).
llvm-svn: 337911
Pavel Labath [Wed, 25 Jul 2018 11:55:59 +0000 (11:55 +0000)]
dwarfgen: Add support for generating the debug_str_offsets section
Summary:
The motivation for this is D49493, where we'd like to test details of
debug_str_offsets behavior which is difficult to trigger from a
traditional test.
This adds the plubming necessary for dwarfgen to generate this section.
The more interesting changes are:
- I've moved emitStringOffsetsTableHeader function from DwarfFile to
DwarfStringPool, so I can generate the section header more easily from
the unit test.
- added a new addAttribute overload taking an MCExpr*. This is used to
generate the DW_AT_str_offsets_base, which links a compile unit to the
offset table.
I've also added a basic test for reading and writing DW_form_strx forms.
Reviewers: dblaikie, JDevlieghere, probinson
Subscribers: llvm-commits, aprantl
Differential Revision: https://reviews.llvm.org/D49670
llvm-svn: 337910
Jonas Paulsson [Wed, 25 Jul 2018 11:42:55 +0000 (11:42 +0000)]
[SystemZ] Use tablegen loops in SchedModels
NFC changes to make scheduler TableGen files more readable, by using loops
instead of a lot of similar defs with just e.g. a latency value that changes.
https://reviews.llvm.org/D49598
Review: Ulrich Weigand, Javed Abshar
llvm-svn: 337909
Pavel Labath [Wed, 25 Jul 2018 11:35:28 +0000 (11:35 +0000)]
Fix PythonString::GetString for >=python-3.7
The return value of PyUnicode_AsUTF8AndSize is now "const char *".
Thanks to Brett Neumeier for testing the patch out on python 3.7.
llvm-svn: 337908
Eric Liu [Wed, 25 Jul 2018 11:26:35 +0000 (11:26 +0000)]
[clangd] Use a sigmoid style function for #usages boost in symbol quality.
Summary:
This has a shape to similar logarithm function but grows much slower for
large #usages.
Metrics: https://reviews.llvm.org/P8096
Reviewers: ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, cfe-commits, sammccall
Differential Revision: https://reviews.llvm.org/D49780
llvm-svn: 337907
Eric Fiselier [Wed, 25 Jul 2018 11:19:13 +0000 (11:19 +0000)]
Fix dangling reference in test
llvm-svn: 337906
Eric Fiselier [Wed, 25 Jul 2018 11:16:39 +0000 (11:16 +0000)]
Fix diagnostic test to tolerate Clang diagnosing it as well.
Tuple has tests that ensure we diagnose non-lifetime extended
reference bindings inside tuples constructors. As of yesterday,
Clang now does this for us.
Adjust the test to tolerate the new diagnostics, while still
testing that we emit diagnostics of our own. Maybe after this
version of Clang has been adopted by most users we should
remove our diagnostics; but for now more error detection is
better!
llvm-svn: 337905
Florian Hahn [Wed, 25 Jul 2018 11:13:40 +0000 (11:13 +0000)]
Recommit r333268: [IPSCCP] Use PredicateInfo to propagate facts from cmp instructions.
r337828 resolves a PredicateInfo issue with unnamed types.
Original message:
This patch updates IPSCCP to use PredicateInfo to propagate
facts to true branches predicated by EQ and to false branches
predicated by NE.
As a follow up, we should be able to extend it to also propagate additional
facts about nonnull.
Reviewers: davide, mssimpso, dberlin, efriedma
Reviewed By: davide, dberlin
llvm-svn: 337904
Thomas Preud'homme [Wed, 25 Jul 2018 11:11:12 +0000 (11:11 +0000)]
Fix PR34170: Crash on inline asm with 64bit output in 32bit GPR
Add support for inline assembly with output operand that do not
naturally go in the register class it is constrained to (eg. double in a
32-bit GPR as in the PR).
llvm-svn: 337903
Paul Semel [Wed, 25 Jul 2018 11:09:20 +0000 (11:09 +0000)]
[llvm-objdump] Add dynamic section printing to private-headers option
Differential Revision: https://reviews.llvm.org/D49016
llvm-svn: 337902
Kirill Bobyrev [Wed, 25 Jul 2018 10:34:57 +0000 (10:34 +0000)]
[clangd] Introduce Dex symbol index search tokens
This patch introduces the core building block of the next-generation
Clangd symbol index - Dex. Search tokens are the keys in the inverted
index and represent a characteristic of a specific symbol: examples of
search token types (Token Namespaces) are
* Trigrams - these are essential for unqualified symbol name fuzzy
search * Scopes for filtering the symbols by the namespace * Paths, e.g.
these can be used to uprank symbols defined close to the edited file
This patch outlines the generic for such token namespaces, but only
implements trigram generation.
The intuition behind trigram generation algorithm is that each extracted
trigram is a valid sequence for Fuzzy Matcher jumps, proposed
implementation utilize existing FuzzyMatcher API for segmentation and
trigram extraction.
However, trigrams generation algorithm for the query string is different
from the previous one: it simply yields sequences of 3 consecutive
lowercased valid characters (letters, digits).
Dex RFC in the mailing list:
http://lists.llvm.org/pipermail/clangd-dev/2018-July/000022.html
The trigram generation techniques are described in detail in the
proposal:
https://docs.google.com/document/d/1C-A6PGT6TynyaX4PXyExNMiGmJ2jL1UwV91Kyx11gOI/edit#heading=h.903u1zon9nkj
Reviewers: sammccall, ioeric, ilya-biryukovA
Subscribers: cfe-commits, klimek, mgorny, MaskRay, jkorous, arphaman
Differential Revision: https://reviews.llvm.org/D49591
llvm-svn: 337901
Eric Fiselier [Wed, 25 Jul 2018 10:22:07 +0000 (10:22 +0000)]
Fix another typo in the FileTimeType docs
llvm-svn: 337900
Krasimir Georgiev [Wed, 25 Jul 2018 10:21:47 +0000 (10:21 +0000)]
[clang-format ]Extend IncludeCategories regex documentation
Summary:
Extend the Clang-Format IncludeCategories documentation by adding a link to the supported regular expression standard (POSIX).
And extenting the example with a system header regex.
[[ https://bugs.llvm.org/show_bug.cgi?id=35041 | bug 35041]]
Contributed by WimLeflere!
Reviewers: krasimir, Typz
Reviewed By: krasimir
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D48827
llvm-svn: 337899
Balazs Keri [Wed, 25 Jul 2018 10:21:06 +0000 (10:21 +0000)]
[ASTImporter] Add support for import of CXXInheritedCtorInitExpr.
Reviewers: a.sidorin, martong
Reviewed By: martong
Subscribers: rnkovacs, a_sidorin, martong, cfe-commits
Differential Revision: https://reviews.llvm.org/D49293
llvm-svn: 337898
Eric Fiselier [Wed, 25 Jul 2018 10:17:04 +0000 (10:17 +0000)]
Fix typos, spelling, and grammar in the FileTimeType design docs.
I'm sure I'll discover more mistakes as I go on...
llvm-svn: 337897
Paul Semel [Wed, 25 Jul 2018 10:04:37 +0000 (10:04 +0000)]
[llvm-readobj] Generic hex-dump option
Helpers are available to make this option file format independant. This
patch adds the feature for Wasm file format. It doesn't change the
behavior of the other file format handling.
Differential Revision: https://reviews.llvm.org/D49545
llvm-svn: 337896
Chandler Carruth [Wed, 25 Jul 2018 09:18:48 +0000 (09:18 +0000)]
[x86/SLH] Sink the return hardening into the main block-walk + hardening
code.
This consolidates all our hardening calls, and simplifies the code
a bit. It seems much more clear to handle all of these together.
No functionality changed here.
llvm-svn: 337895
Chandler Carruth [Wed, 25 Jul 2018 09:00:26 +0000 (09:00 +0000)]
[x86/SLH] Improve name and comments for the main hardening function.
This function actually does two things: it traces the predicate state
through each of the basic blocks in the function (as that isn't directly
handled by the SSA updater) *and* it hardens everything necessary in the
block as it goes. These need to be done together so that we have the
currently active predicate state to use at each point of the hardening.
However, this also made obvious that the flag to disable actual
hardening of loads was flawed -- it also disabled tracing the predicate
state across function calls within the body of each block. So this patch
sinks this debugging flag test to correctly guard just the hardening of
loads.
Unless load hardening was disabled, no functionality should change with
tis patch.
llvm-svn: 337894
Simon Atanasyan [Wed, 25 Jul 2018 07:07:43 +0000 (07:07 +0000)]
[mips] Replace custom parsing logic for data directives by the `addAliasForDirective`
The target independent AsmParser doesn't recognise .hword, .word, .dword
which are required for Mips. Currently MipsAsmParser recognises these
through dispatch to MipsAsmParser::parseDataDirective. This contains
equivalent logic to AsmParser::parseDirectiveValue. This patch allows
reuse of AsmParser::parseDirectiveValue by making use of
addAliasForDirective to support .hword, .word and .dword.
Original patch provided by Alex Bradbury at D47001 was modified to fix
handling of microMIPS symbols. The `AsmParser::parseDirectiveValue`
calls either `EmitIntValue` or `EmitValue`. In this patch we override
`EmitIntValue` in the `MipsELFStreamer` to clear a pending set of
microMIPS symbols.
Differential revision: https://reviews.llvm.org/D49539
llvm-svn: 337893
Fangrui Song [Wed, 25 Jul 2018 06:57:31 +0000 (06:57 +0000)]
cc1_main: fix -Wsign-compare on FreeBSD
Its __rlim_t is intentionally signed (__int64_t) because of legacy code
that uses -1 for RLIM_INFINITY.
llvm-svn: 337892
Chijun Sima [Wed, 25 Jul 2018 06:18:33 +0000 (06:18 +0000)]
[Dominators] Assert if there is modification to DelBB while it is awaiting deletion
Summary:
Previously, passes use
```
DomTreeUpdater DTU(DT, DomTreeUpdater::UpdateStrategy::Lazy);
DTU.deleteBB(DelBB);
```
to delete a BasicBlock.
But passes which don't have the ability to update DomTree (e.g. tailcallelim, simplifyCFG) cannot recognize a DelBB awaiting deletion and will continue to process this DelBB.
This is a simple approach to notify devs of passes which may use DTU in the future to deal with deleted BasicBlocks under Lazy Strategy correctly.
Reviewers: kuhar, brzycki, dmgreen
Reviewed By: kuhar
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D49731
llvm-svn: 337891
Craig Topper [Wed, 25 Jul 2018 05:33:36 +0000 (05:33 +0000)]
[X86] Use X86ISD::MUL_IMM instead of ISD::MUL for multiply we intend to be selected to LEA.
This prevents other combines from possibly disturbing it.
llvm-svn: 337890
Craig Topper [Wed, 25 Jul 2018 05:22:13 +0000 (05:22 +0000)]
[X86] Autogenerate complete checks and fix a failure introduced in r337875.
llvm-svn: 337889
Eric Fiselier [Wed, 25 Jul 2018 04:46:32 +0000 (04:46 +0000)]
Fix bugs in create_directory implementation.
Libc++ was incorrectly reporting an error when the target of create_directory
already exists, but was not a directory. This behavior is not specified
in the most recent standard, which says no error should be reported.
Additionally, libc++ failed to report an error when the attribute directory
path didn't exist or didn't name a directory. This has been fixed as well.
Although it's not clear if we should call status or symlink_status on the
attribute directory. This patch chooses to still call status.
llvm-svn: 337888
JF Bastien [Wed, 25 Jul 2018 04:29:03 +0000 (04:29 +0000)]
CodeGen: use non-zero memset when possible for automatic variables
Summary:
Right now automatic variables are either initialized with bzero followed by a few stores, or memcpy'd from a synthesized global. We end up encountering a fair amount of code where memcpy of non-zero byte patterns would be better than memcpy from a global because it touches less memory and generates a smaller binary. The optimizer could reason about this, but it's not really worth it when clang already knows.
This code could definitely be more clever but I'm not sure it's worth it. In particular we could track a histogram of bytes seen and figure out (as we do with bzero) if a memset could be followed by a handful of stores. Similarly, we could tune the heuristics for GlobalSize, but using the same as for bzero seems conservatively OK for now.
<rdar://problem/
42563091>
Reviewers: dexonsmith
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D49771
llvm-svn: 337887
Eric Fiselier [Wed, 25 Jul 2018 04:21:59 +0000 (04:21 +0000)]
Fix missing includes in format_string.hpp helper
llvm-svn: 337886
Marshall Clow [Wed, 25 Jul 2018 04:21:21 +0000 (04:21 +0000)]
New test support for comparisons. Reviewed as https://reviews.llvm.org/D49773
llvm-svn: 337885
Eric Fiselier [Wed, 25 Jul 2018 03:41:31 +0000 (03:41 +0000)]
Make <experimental/filesystem> explicitly require C++11.
Previously the <experimental/filesystem> didn't guard its
contents in any dialect. However, the implementation implicitly
requires at least C++11, and the tests have always been marked
unsupported in C++03. This patch puts a header guard around the
contents to avoid exposing them before C++11.
Additionally, it replaces all of the usages of _NOEXCEPT or
_LIBCPP_CONSTEXPR with the keyword directly, since we can
expect the compiler to implement those by now.
llvm-svn: 337884
Eric Fiselier [Wed, 25 Jul 2018 03:31:48 +0000 (03:31 +0000)]
Ensure path::iterator and PathParser share the same enumeration values.
To avoid exposing implementation details, path::iterator and PathParser
both implicitly used the same set of values to represent the state,
but they were defined twice. This could have lead to a mismatch
occuring.
This patch moves all of the parser state values into the filesystem
header and changes PathParser to use those value to avoid this.
llvm-svn: 337883
Tom Stellard [Wed, 25 Jul 2018 03:08:35 +0000 (03:08 +0000)]
[RegisterBankInfo] Ignore InstrMappings that create impossible to repair operands
Summary:
This is a follow-up to r303043. In computeMapping(), we need to disqualify an
InstrMapping if it would be impossible to repair one of the registers in the
instruction to match the mapping.
This change is needed in order to be able to define an instruction
mapping for G_SELECT for the AMDGPU target and will be tested
by test/CodeGen/AMDGPU/GlobalISel/regbankselect-select.mir
Reviewers: ab, qcolombet, t.p.northover, dsanders
Reviewed By: qcolombet
Subscribers: tpr, llvm-commits
Differential Revision: https://reviews.llvm.org/D49735
llvm-svn: 337882
Petr Hosek [Wed, 25 Jul 2018 03:01:35 +0000 (03:01 +0000)]
[profile] Support profiling runtime on Fuchsia
This ports the profiling runtime on Fuchsia and enables the
instrumentation. Unlike on other platforms, Fuchsia doesn't use
files to dump the instrumentation data since on Fuchsia, filesystem
may not be accessible to the instrumented process. We instead use
the data sink to pass the profiling data to the system the same
sanitizer runtimes do.
Differential Revision: https://reviews.llvm.org/D47208
llvm-svn: 337881
Eric Fiselier [Wed, 25 Jul 2018 02:53:53 +0000 (02:53 +0000)]
Add design docs for upcoming file_time_type change.
In upcoming changes to filesystem I plan to change file_time_type
to use __int128_t as its underlying representation, in order
to allow it to have a range and resolution at least that of
the timespec struct.
There was some pushback against this decision, so I drafted
a document explaining the problems, potential solutions, and
the rational for the decision.
However, it's probably easier to let people read the generated
HTML rather than the raw restructured text. For this reason
I'm commiting the design documents before hand, so they can
be available during any subsequent discussion or code review.
llvm-svn: 337880
Marshall Clow [Wed, 25 Jul 2018 01:55:25 +0000 (01:55 +0000)]
Mark <span> as complete
llvm-svn: 337879
Chandler Carruth [Wed, 25 Jul 2018 01:51:29 +0000 (01:51 +0000)]
[x86/SLH] Teach the x86 speculative load hardening pass to harden
against v1.2 BCBS attacks directly.
Attacks using spectre v1.2 (a subset of BCBS) are described in the paper
here:
https://people.csail.mit.edu/vlk/spectre11.pdf
The core idea is to speculatively store over the address in a vtable,
jumptable, or other target of indirect control flow that will be
subsequently loaded. Speculative execution after such a store can
forward the stored value to subsequent loads, and if called or jumped
to, the speculative execution will be steered to this potentially
attacker controlled address.
Up until now, this could be mitigated by enableing retpolines. However,
that is a relatively expensive technique to mitigate this particular
flavor. Especially because in most cases SLH will have already mitigated
this. To fully mitigate this with SLH, we need to do two core things:
1) Unfold loads from calls and jumps, allowing the loads to be post-load
hardened.
2) Force hardening of incoming registers even if we didn't end up
needing to harden the load itself.
The reason we need to do these two things is because hardening calls and
jumps from this particular variant is importantly different from
hardening against leak of secret data. Because the "bad" data here isn't
a secret, but in fact speculatively stored by the attacker, it may be
loaded from any address, regardless of whether it is read-only memory,
mapped memory, or a "hardened" address. The only 100% effective way to
harden these instructions is to harden the their operand itself. But to
the extent possible, we'd like to take advantage of all the other
hardening going on, we just need a fallback in case none of that
happened to cover the particular input to the control transfer
instruction.
For users of SLH, currently they are paing 2% to 6% performance overhead
for retpolines, but this mechanism is expected to be substantially
cheaper. However, it is worth reminding folks that this does not
mitigate all of the things retpolines do -- most notably, variant #2 is
not in *any way* mitigated by this technique. So users of SLH may still
want to enable retpolines, and the implementation is carefuly designed to
gracefully leverage retpolines to avoid the need for further hardening
here when they are enabled.
Differential Revision: https://reviews.llvm.org/D49663
llvm-svn: 337878
Petr Hosek [Wed, 25 Jul 2018 01:44:22 +0000 (01:44 +0000)]
[CMake] Link static libunwind and libc++abi into libc++ in Fuchsia toolchain
When building libc++ for Fuchsia, we want to distribute shared libc++,
libc++abi and libunwind as separate libraries, but for static versions
we would like to link all of them into libc++ so -lc++ flag has the same
effect whether shared or static library is being used.
Differential Revision: https://reviews.llvm.org/D49628
llvm-svn: 337877
George Karpenkov [Wed, 25 Jul 2018 01:27:15 +0000 (01:27 +0000)]
[analyzer] Syntactic matcher for leaks associated with run loop and autoreleasepool
A checker for detecting leaks resulting from allocating temporary
autoreleasing objects before starting the main run loop.
Checks for two antipatterns:
1. ObjCMessageExpr followed by [[NARunLoop mainRunLoop] run] in the same
autorelease pool.
2. ObjCMessageExpr followed by [[NARunLoop mainRunLoop] run] in no
autorelease pool.
Happens-before relationship is modeled purely syntactically.
rdar://
39299145
Differential Revision: https://reviews.llvm.org/D49528
llvm-svn: 337876
Craig Topper [Wed, 25 Jul 2018 01:15:38 +0000 (01:15 +0000)]
[X86] Use a shift plus an lea for multiplying by a constant that is a power of 2 plus 2/4/8.
The LEA allows us to combine an add and the multiply by 2/4/8 together so we just need a shift for the larger power of 2.
llvm-svn: 337875
Craig Topper [Wed, 25 Jul 2018 01:15:35 +0000 (01:15 +0000)]
[X86] Expand mul by pow2 + 2 using a shift and two adds similar to what we do for pow2 - 2.
llvm-svn: 337874
Raphael Isemann [Tue, 24 Jul 2018 23:52:39 +0000 (23:52 +0000)]
Add unit tests for VMRange
Subscribers: clayborg, labath, mgorny, lldb-commits
Differential Revision: https://reviews.llvm.org/D49415
llvm-svn: 337873
Matt Morehouse [Tue, 24 Jul 2018 23:50:42 +0000 (23:50 +0000)]
[sanitizer] Update symbolizer test.
llvm-svn: 337872
Craig Topper [Tue, 24 Jul 2018 23:44:17 +0000 (23:44 +0000)]
[X86] Use a two lea sequence for multiply by 37, 41, and 73.
These fit a pattern used by 11, 21, and 19.
llvm-svn: 337871
Craig Topper [Tue, 24 Jul 2018 23:44:15 +0000 (23:44 +0000)]
[X86] Add test cases for multiply by 37, 41, and 73.
These can all be handled with 2 LEAs similar to what we do for 11, 19, 21.
llvm-svn: 337870
Craig Topper [Tue, 24 Jul 2018 23:44:12 +0000 (23:44 +0000)]
[X86] Change multiply by 26 to use two multiplies by 5 and an add instead of multiply by 3 and 9 and a subtract.
Same number of operations, but ending in an add is friendlier due to it being commutable.
llvm-svn: 337869
Petr Hosek [Tue, 24 Jul 2018 23:42:51 +0000 (23:42 +0000)]
[CMake] Include CMakeDependentOption in libunwind
This should resolve the breakage introduced in r337867 which introduced
the use of cmake_dependent_option without include the necessary file.
llvm-svn: 337868
Petr Hosek [Tue, 24 Jul 2018 23:27:51 +0000 (23:27 +0000)]
[CMake] Option to control whether shared/static library is installed
Currently it's only possible to control whether shared or static library
build of libc++, libc++abi and libunwind is enabled or disabled and
whether to install everything we've built or not. However, it'd be
useful to have more fine grained control, e.g. when static libraries are
merged together into libc++.a we don't need to install libc++abi.a and
libunwind.a. This change adds this option.
Differential Revision: https://reviews.llvm.org/D49573
llvm-svn: 337867
George Karpenkov [Tue, 24 Jul 2018 23:23:33 +0000 (23:23 +0000)]
Revert "[analyzer] Extend NoStoreFuncVisitor to insert a note on IVars"
This reverts commit
a9e21bd727112cd69eabc1af648c5da6b773d06e.
Reverted because the dependency has not landed yet.
llvm-svn: 337866
Jason Molenda [Tue, 24 Jul 2018 23:19:56 +0000 (23:19 +0000)]
Add DumpRegisterValue.cpp.
llvm-svn: 337865
George Karpenkov [Tue, 24 Jul 2018 23:14:29 +0000 (23:14 +0000)]
[analyzer] Extend NoStoreFuncVisitor to insert a note on IVars
The note is added in the following situation:
- We are throwing a nullability-related warning on an IVar
- The path goes through a method which *could have* (syntactically
determined) written into that IVar, but did not
rdar://
42444460
Differential Revision: https://reviews.llvm.org/D49689
llvm-svn: 337864
Rui Ueyama [Tue, 24 Jul 2018 22:52:11 +0000 (22:52 +0000)]
Fix error messages for bad symbols.
Previously, the error messages didn't contain symbol name because we
didn't read a symbol name for these error messages.
Differential Revision: https://reviews.llvm.org/D49762
llvm-svn: 337863
Benjamin Kramer [Tue, 24 Jul 2018 22:47:16 +0000 (22:47 +0000)]
[Sema] Destroy tokens in DeclaratorChunk params
Otherwise this leaks in some edge cases.
llvm-svn: 337862
Hideki Saito [Tue, 24 Jul 2018 22:30:31 +0000 (22:30 +0000)]
[LV] Fix for PR38110, LV encountered llvm_unreachable()
Summary: truncateToMinimalBitWidths() doesn't handle all Instructions and the worst case is compiler crash via llvm_unreachable(). Fix is to add a case to handle PHINode and changed the worst case to NO-OP (from compiler crash).
Reviewers: sbaranga, mssimpso, hsaito
Reviewed By: hsaito
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D49461
llvm-svn: 337861
Benjamin Kramer [Tue, 24 Jul 2018 21:50:06 +0000 (21:50 +0000)]
[clangd] Guard fuzzer against empty inputs.
llvm-svn: 337860
Roman Tereshin [Tue, 24 Jul 2018 21:48:56 +0000 (21:48 +0000)]
[SCEV] Add zext(C + x + ...) -> D + zext(C-D + x + ...)<nuw><nsw> transform
if the top level addition in (D + (C-D + x + ...)) could be proven to
not wrap, where the choice of D also maximizes the number of trailing
zeroes of (C-D + x + ...), ensuring homogeneous behaviour of the
transformation and better canonicalization of such expressions.
This enables better canonicalization of expressions like
1 + zext(5 + 20 * %x + 24 * %y) and
zext(6 + 20 * %x + 24 * %y)
which get both transformed to
2 + zext(4 + 20 * %x + 24 * %y)
This pattern is common in address arithmetics and the transformation
makes it easier for passes like LoadStoreVectorizer to prove that 2 or
more memory accesses are consecutive and optimize (vectorize) them.
Reviewed By: mzolotukhin
Differential Revision: https://reviews.llvm.org/D48853
llvm-svn: 337859
Craig Topper [Tue, 24 Jul 2018 21:31:21 +0000 (21:31 +0000)]
[X86] When expanding a multiply by a negative of one less than a power of 2, like 31, don't generate a negate of a subtract that we'll never optimize.
We generated a subtract for the power of 2 minus one then negated the result. The negate can be optimized away by swapping the subtract operands, but DAG combine doesn't know how to do that and we don't add any of the new nodes to the worklist anyway.
This patch makes use explicitly emit the swapped subtract.
llvm-svn: 337858
Richard Smith [Tue, 24 Jul 2018 21:18:30 +0000 (21:18 +0000)]
Don't lifetime-extend or track lifetime problems through the LHS of '->*'.
Fixes a false-positive warning found by selfhost.
llvm-svn: 337857
Craig Topper [Tue, 24 Jul 2018 21:15:41 +0000 (21:15 +0000)]
[X86] Generalize the multiply by 30 lowering to generic multipy by power 2 minus 2.
Use a left shift and 2 subtracts like we do for 30. Move this out from behind the slow lea check since it doesn't even use an LEA.
Use this for multiply by 14 as well.
llvm-svn: 337856
Raphael Isemann [Tue, 24 Jul 2018 21:09:17 +0000 (21:09 +0000)]
Remove unused History class
Summary: This class doesn't seem to be used anywhere, so we might as well remove the code.
Reviewers: labath
Reviewed By: labath
Subscribers: labath, mgorny, lldb-commits
Differential Revision: https://reviews.llvm.org/D49755
llvm-svn: 337855
Heejin Ahn [Tue, 24 Jul 2018 21:06:44 +0000 (21:06 +0000)]
[WebAssembly] Add tests for weaker memory consistency orderings
Summary:
Currently all wasm atomic memory access instructions are sequentially
consistent, so even if LLVM IR specifies weaker orderings than that, we
should upgrade them to sequential ordering and treat them in the same
way.
Reviewers: dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D49194
llvm-svn: 337854
Max Moroz [Tue, 24 Jul 2018 21:02:44 +0000 (21:02 +0000)]
[libFuzzer] Handle unstable edges by disregarding unstable edges
Summary:
Added a new mode within flag -handle_unstable for new unstable handling algorithm that does the following:
When an edge is shown as unstable, copy to UnstableCounters the value 0.
During ApplyUnstableCounters we copy back the value 0 to ModuleInline8bitCounters if the edge was unstable.
This way we would be ignoring completely features that were collected through non-determinism.
Unstable hits would be counted as if it never hit.
Reviewers: metzman, Dor1s, kcc, morehouse
Reviewed By: metzman, morehouse
Subscribers: delcypher, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D49684
llvm-svn: 337853
Craig Topper [Tue, 24 Jul 2018 20:31:48 +0000 (20:31 +0000)]
[X86] Change multiply by 19 to use (9 * X) * 2 + X instead of (5 * X) * 4 - 1.
The new lowering can be done in 2 LEAs. The old code took 1 LEA, 1 shift, and 1 sub.
llvm-svn: 337851
Jordan Rupprecht [Tue, 24 Jul 2018 20:28:07 +0000 (20:28 +0000)]
Revert "[VFS] Cleanups to VFS interfaces."
This reverts commit r337834 due to test failures.
llvm-svn: 337850
Jessica Paquette [Tue, 24 Jul 2018 20:20:45 +0000 (20:20 +0000)]
[MachineOutliner][NFC] Move outlined function remark into its own function
This pulls the OutlinedFunction remark out into its own function to make
the code a bit easier to read.
llvm-svn: 337849
Jessica Paquette [Tue, 24 Jul 2018 20:13:10 +0000 (20:13 +0000)]
[MachineOutliner][NFC] Move target frame info into OutlinedFunction
Just some gardening here.
Similar to how we moved call information into Candidates, this moves outlined
frame information into OutlinedFunction. This allows us to remove
TargetCostInfo entirely.
Anywhere where we returned a TargetCostInfo struct, we now return an
OutlinedFunction. This establishes OutlinedFunctions as more of a general
repeated sequence, and Candidates as occurrences of those repeated sequences.
llvm-svn: 337848
Peter Collingbourne [Tue, 24 Jul 2018 19:34:37 +0000 (19:34 +0000)]
Put "built-in" function definitions in global Used list, for LTO. (fix bug 34169)
When building with LTO, builtin functions that are defined but whose calls have not been inserted yet, get internalized. The Global Dead Code Elimination phase in the new LTO implementation then removes these function definitions. Later optimizations add calls to those functions, and the linker then dies complaining that there are no definitions. This CL fixes the new LTO implementation to check if a function is builtin, and if so, to not internalize (and later DCE) the function. As part of this fix I needed to move the RuntimeLibcalls.{def,h} files from the CodeGen subidrectory to the IR subdirectory. I have updated all the files that accessed those two files to access their new location.
Fixes PR34169
Patch by Caroline Tice!
Differential Revision: https://reviews.llvm.org/D49434
llvm-svn: 337847
Chandler Carruth [Tue, 24 Jul 2018 19:04:37 +0000 (19:04 +0000)]
[x86] Teach the x86 backend that it can fold between TCRETURNm* and TCRETURNr* and fix latent bugs with register class updates.
Summary:
Enabling this fully exposes a latent bug in the instruction folding: we
never update the register constraints for the register operands when
fusing a load into another operation. The fused form could, in theory,
have different register constraints on its operands. And in fact,
TCRETURNm* needs its memory operands to use tailcall compatible
registers.
I've updated the folding code to re-constrain all the registers after
they are mapped onto their new instruction.
However, we still can't enable folding in the general case from
TCRETURNr* to TCRETURNm* because doing so may require more registers to
be available during the tail call. If the call itself uses all but one
register, and the folded load would require both a base and index
register, there will not be enough registers to allocate the tail call.
It would be better, IMO, to teach the register allocator to *unfold*
TCRETURNm* when it runs out of registers (or specifically check the
number of registers available during the TCRETURNr*) but I'm not going
to try and solve that for now. Instead, I've just blocked the forward
folding from r -> m, leaving LLVM free to unfold from m -> r as that
doesn't introduce new register pressure constraints.
The down side is that I don't have anything that will directly exercise
this. Instead, I will be immediately using this it my SLH patch. =/
Still worse, without allowing the TCRETURNr* -> TCRETURNm* fold, I don't
have any tests that demonstrate the failure to update the memory operand
register constraints. This patch still seems correct, but I'm nervous
about the degree of testing due to this.
Suggestions?
Reviewers: craig.topper
Subscribers: sanjoy, mcrosier, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D49717
llvm-svn: 337845
Craig Topper [Tue, 24 Jul 2018 18:49:00 +0000 (18:49 +0000)]
[Inliner] Teach inliner to merge 'min-legal-vector-width' function attribute
When we inline a function with a min-legal-vector-width attribute we need to make sure the caller also ends up with at least that vector width.
This patch is necessary to make always_inline functions like intrinsics propagate their min-legal-vector-width. Though nothing uses min-legal-vector-width yet.
A future patch will add heuristics to preventing inlining with different vector width mismatches. But that code would need to be in inline cost analysis which is separate from the code added here.
Differential Revision: https://reviews.llvm.org/D49162
llvm-svn: 337844
Craig Topper [Tue, 24 Jul 2018 18:36:46 +0000 (18:36 +0000)]
[X86] Add test case to show failure to combine away negates that may be created by mul by constant expansion.
Mul by constant can expand to a sequence that ends with a negate. If the next instruction is an add or sub we might be able to fold the negate away.
We currently fail to do this because we explicitly don't add anything to the DAG combine worklist when we expand multiplies. This is primarily to keep the multipy from being reformed, but we should consider adding the users to worklist.
llvm-svn: 337843
Azharuddin Mohammed [Tue, 24 Jul 2018 18:34:13 +0000 (18:34 +0000)]
[docker] Fix LLVM_EXTERNAL_PROJECTS cmake variable value
Summary:
LLVM_ENABLE_PROJECTS expects a semicolon separated project list.
Fixes PR38158.
Reviewers: ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D49712
llvm-svn: 337842
Jessica Paquette [Tue, 24 Jul 2018 17:42:11 +0000 (17:42 +0000)]
[MachineOutliner][NFC] Make Candidates own their call information
Before this, TCI contained all the call information for each Candidate.
This moves that information onto the Candidates. As a result, each Candidate
can now supply how it ought to be called. Thus, Candidates will be able to,
say, call the same function in cheaper ways when possible. This also removes
that information from TCI, since it's no longer used there.
A follow-up patch for the AArch64 outliner will demonstrate this.
llvm-svn: 337840
Jessica Paquette [Tue, 24 Jul 2018 17:37:28 +0000 (17:37 +0000)]
[MachineOutliner][NFC] Move missed opt remark into its own function
Having the missed remark code in the middle of `findCandidates` made the
function hard to follow. This yanks that out into a new function,
`emitNotOutliningCheaperRemark`.
llvm-svn: 337839
Jessica Paquette [Tue, 24 Jul 2018 17:36:13 +0000 (17:36 +0000)]
[MachineOutliner][NFC] Sink some candidate logic into OutlinedFunction
Just some simple gardening to improve clarity.
Before, we had something along the lines of
1) Create a std::vector of Candidates
2) Create an OutlinedFunction
3) Create a std::vector of pointers to Candidates
4) Copy those over to the OutlinedFunction and the Candidate list
Now, OutlinedFunctions create the Candidate pointers. They're still copied
over to the main list of Candidates, but it makes it a bit clearer what's
going on.
llvm-svn: 337838
Kuba Mracek [Tue, 24 Jul 2018 16:19:06 +0000 (16:19 +0000)]
[tsan] Fix crash in objc_sync_enter/objc_sync_exit when using an Obj-C tagged pointer
Objective-C tagged pointers (either bottom-most or top-most bit is 1) are valid Obj-C objects but are not valid pointers. Make sure we don't crash on them when used in objc_sync_enter/objc_sync_exit. Instead, let's synchronize on a global object.
Differential Revision: https://reviews.llvm.org/D49707
llvm-svn: 337837
Erich Keane [Tue, 24 Jul 2018 16:11:30 +0000 (16:11 +0000)]
Remove stale documentation from InternalsManual.rst
The DuplicatesAllowedWhileMerging was removed a while ago,
but the documentation remained.
llvm-svn: 337835
Sam McCall [Tue, 24 Jul 2018 16:00:55 +0000 (16:00 +0000)]
[VFS] Cleanups to VFS interfaces.
Summary:
- add comments clarifying semantics
- Status::copyWithNewName(Status, Name) --> instance method
- Status::copyWithNewName(fs::file_status, Name) --> constructor (it's not a copy)
- File::getName() -> getRealPath(), reflecting its actual behavior/function
and stop returning status().getName() in the base class (callers can do this
fallback if they want to, it complicates the contracts).
This is mostly NFC, but the behavior of File::getName() affects FileManager's
FileEntry::tryGetRealPathName(), which now fails in more cases:
- non-real file cases
- real-file cases where the underlying vfs::File was opened in a way that
doesn't call realpath().
(In these cases we don't know a distinct real name, so in principle it seems OK)
Reviewers: klimek
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D49724
llvm-svn: 337834
Petr Hosek [Tue, 24 Jul 2018 15:49:29 +0000 (15:49 +0000)]
[CMake] Fix the setting of LIBCXX_HEADER_DIR in standalone build
This is an alternative approach to r337727 which broke the build
because libc++ headers were copied into the location outside of
directories used by Clang. This change sets LIBCXX_HEADER_DIR to
different values depending on whether libc++ is being built as
part of LLVM w/ per-target multiarch runtime, LLVM or standalone.
Differential Revision: https://reviews.llvm.org/D49711
llvm-svn: 337833
Pavel Labath [Tue, 24 Jul 2018 15:48:13 +0000 (15:48 +0000)]
Move dumping code out of RegisterValue class
Summary:
The dump function was the only part of this class which depended on
high-level functionality. This was due to the DumpDataExtractor
function, which uses info from a running target to control dump format
(although, RegisterValue doesn't really use the high-level part of
DumpDataExtractor).
This patch follows the same approach done for the DataExtractor class,
and extracts the dumping code into a separate function/file. This file
can stay in the higher level code, while the RegisterValue class and
anything that does not depend in dumping can stay go to lower layers.
The XCode project will need to be updated after this patch.
Reviewers: zturner, jingham, clayborg
Subscribers: lldb-commits, mgorny
Differential Revision: https://reviews.llvm.org/D48351
llvm-svn: 337832
Joel Galenson [Tue, 24 Jul 2018 15:21:54 +0000 (15:21 +0000)]
Use SCEV to avoid inserting some bounds checks.
This patch uses SCEV to avoid inserting some bounds checks when they are not needed. This slightly improves the performance of code compiled with the bounds check sanitizer.
Differential Revision: https://reviews.llvm.org/D49602
llvm-svn: 337830
Sid Manning [Tue, 24 Jul 2018 15:08:13 +0000 (15:08 +0000)]
[ELF][HEXAGON] Add R_HEX_B15_PCREL_X relocation
Update testcase
Differential Revision: https://reviews.llvm.org/D49567
llvm-svn: 337829
Florian Hahn [Tue, 24 Jul 2018 14:49:52 +0000 (14:49 +0000)]
[PredicateInfo] Use custom mangling to support ssa_copy with unnamed types.
This is a workaround and it would be better to fix this generally, but
doing it generally is quite tricky. See D48541 and PR38117.
Doing it in PredicateInfo directly allows us to use the type address to
differentiate different unnamed types, because neither the created
declarations nor the ssa_copy calls should be visible after
PredicateInfo got destroyed.
Reviewers: efriedma, davide
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D49126
llvm-svn: 337828