Saleem Abdulrasool [Thu, 25 Oct 2018 17:52:13 +0000 (17:52 +0000)]
CodeGen: alter CFConstantString class name for swift 5.0
Swift 5.0 has changed the name decoration for swift symbols, using a 'S' sigil
rather than 's' as in 4.2. Adopt the new convention.
llvm-svn: 345291
Simon Pilgrim [Thu, 25 Oct 2018 17:43:36 +0000 (17:43 +0000)]
[LegalizeDAG] Remove dead SINT_TO_FP legalization code
As noticed on D52965, the SINT_TO_FP i64 to f32 legalization code has been dead for years - protected by an assert.
Differential Revision: https://reviews.llvm.org/D53703
llvm-svn: 345290
Eric Fiselier [Thu, 25 Oct 2018 17:43:26 +0000 (17:43 +0000)]
fix incorrect placement of _LIBCPP_ALWAYS_INLINE in valarray
llvm-svn: 345289
Volkan Keles [Thu, 25 Oct 2018 17:37:07 +0000 (17:37 +0000)]
[GISel] LegalizerInfo: Rename MemDesc::Size to SizeInBits to make the value clearer
Requested in D53679.
llvm-svn: 345288
Adrian Prantl [Thu, 25 Oct 2018 17:36:05 +0000 (17:36 +0000)]
Remove accidentally committed duplicate code
llvm-svn: 345287
Craig Topper [Thu, 25 Oct 2018 17:29:00 +0000 (17:29 +0000)]
[X86] Remove ProcIntelKNL and replace with a SlowPMADDWD flag to use in the one place it was checked.
llvm-svn: 345286
Craig Topper [Thu, 25 Oct 2018 17:28:57 +0000 (17:28 +0000)]
[X86] Remove some uarch tuning flags from KNL that look to have been inherited from SNB/IVB incorrectly
KNL is based on a modified Silvermont core so I don't think these features apply. I think the LEA flag is probably also wrong, but I'm less sure as I barely understand the 3 LEA flags we have currently.
Differential Revision: https://reviews.llvm.org/D53671
llvm-svn: 345285
Mikhail R. Gadelha [Thu, 25 Oct 2018 17:27:42 +0000 (17:27 +0000)]
[analyzer] Move canReasonAbout from Z3ConstraintManager to SMTConstraintManager
Summary:
This patch moves the last method in `Z3ConstraintManager` to `SMTConstraintManager`: `canReasonAbout()`.
The `canReasonAbout()` method checks if a given `SVal` can be encoded in SMT. I've added a new method to the SMT API to return true if a solver can encode floating-point arithmetics and it was enough to make `canReasonAbout()` solver independent.
As an annoying side-effect, `Z3ConstraintManager` is pretty empty now and only (1) creates the Z3 solver object by calling `CreateZ3Solver()` and (2) instantiates `SMTConstraintManager`. Maybe we can get rid of this class altogether in the future: a `CreateSMTConstraintManager()` method that does (1) and (2) and returns the constraint manager object?
Reviewers: george.karpenkov, NoQ
Reviewed By: george.karpenkov
Subscribers: mehdi_amini, xazax.hun, szepet, a.sidorin, dexonsmith, Szelethus, donat.nagy, dkrupp
Differential Revision: https://reviews.llvm.org/D53694
llvm-svn: 345284
Mikhail R. Gadelha [Thu, 25 Oct 2018 17:27:36 +0000 (17:27 +0000)]
[analyzer] Fixed bitvector from model always being unsigned
Summary:
Getting an `APSInt` from the model always returned an unsigned integer because of the unused parameter.
This was not breaking any test case because no code relies on the actual value of the integer returned here, but rather it is only used to check if a symbol has more than one solution in `getSymVal`.
Reviewers: NoQ, george.karpenkov
Reviewed By: george.karpenkov
Subscribers: xazax.hun, szepet, a.sidorin, Szelethus, donat.nagy, dkrupp
Differential Revision: https://reviews.llvm.org/D53637
llvm-svn: 345283
Volkan Keles [Thu, 25 Oct 2018 17:23:25 +0000 (17:23 +0000)]
[AArch64][GlobalISel] Fix the LegalityPredicate for lowerIf for G_LOAD/G_STORE
Summary:
Currently, Legalizer is trying to lower G_LOAD with a vector type
that has more than two elements due to the incorrect LegalityPredicate.
This patch fixes the issue by removing the multiplication by 8
as `MemDesc.Size` already contains the size in bits.
Reviewers: dsanders, aemerson
Reviewed By: dsanders
Subscribers: rovka, javed.absar, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D53679
llvm-svn: 345282
Eric Fiselier [Thu, 25 Oct 2018 17:21:30 +0000 (17:21 +0000)]
Implement sized deallocation for std::allocator and friends.
Summary:
C++14 sized deallocation is disabled by default due to ABI concerns. However, when a user manually enables it then libc++ should take advantage of it since sized deallocation can provide a significant performance win depending on the underlying malloc implementation. (Note that libc++'s definitions of sized delete don't do anything special yet, but users are free to provide their own).
This patch updates __libcpp_deallocate to selectively call sized operator delete when it's available. `__libcpp_deallocate_unsized` should be used when the size of the allocation is unknown.
On Apple this patch makes no attempt to determine if the sized operator delete is unavailable, only that the language feature is enabled. This could cause a compile error when using `std::allocator`, but the same compile error would occur whenever the user calls `new`, so I don't think it's a problem.
Reviewers: ldionne, mclow.lists
Reviewed By: ldionne
Subscribers: rsmith, ckennelly, libcxx-commits, christof
Differential Revision: https://reviews.llvm.org/D53120
llvm-svn: 345281
Andrea Di Biagio [Thu, 25 Oct 2018 17:03:51 +0000 (17:03 +0000)]
[llvm-mca] Introduce a new base class for mca::Instruction, and change how read/write information is stored.
This patch introduces a new base class for Instruction named InstructionBase.
Class InstructionBase is responsible for tracking data dependencies with the
help of ReadState and WriteState objects. Class Instruction now derives from
InstructionBase, and adds extra information related to the `InstrStage` as well
as the `RCUTokenID`.
ReadState and WriteState objects are no longer unique pointers. This avoids
extra heap allocation and pointer checks that weren't really needed. Now, those
objects are simply stored into SmallVectors. We use a SmallVector instead of a
std::vector because we expect most instructions to only have a very small number
of reads and writes. By using a simple SmallVector we also avoid extra heap
allocations most of the time.
In a debug build, this improves the performance of llvm-mca by roughly 10% (I
still have to verify the impact in performance on a release build).
llvm-svn: 345280
Evandro Menezes [Thu, 25 Oct 2018 16:45:46 +0000 (16:45 +0000)]
[AArch64] Refactor Exynos feature sets (NFC)
llvm-svn: 345279
Adrian Prantl [Thu, 25 Oct 2018 16:15:17 +0000 (16:15 +0000)]
Get rid of casts. (NFC)
Differential Revision: https://reviews.llvm.org/D53709
llvm-svn: 345278
Alexey Bataev [Thu, 25 Oct 2018 15:35:27 +0000 (15:35 +0000)]
[OPENMP]Fix PR39422: variables are not firstprivatized in task context.
According to the OpenMP standard, In a task generating construct, if no
default clause is present, a variable for which the data-sharing
attribute is not determined by the rules above is firstprivatized.
Compiler tries to implement this, but if the variable is not directly
used in the task context, this variable may not be firstprivatized.
Patch fixes this problem.
llvm-svn: 345277
Simon Pilgrim [Thu, 25 Oct 2018 15:33:47 +0000 (15:33 +0000)]
[ARM] Regenerate vdup tests
llvm-svn: 345276
John Brawn [Thu, 25 Oct 2018 15:31:51 +0000 (15:31 +0000)]
[AArch64] Add EXT patterns for 64-bit EXT of a subvector of a 128-bit vector
If we have a 64-bit EXT where one of the operands is a subvector of a 128-bit
vector then in some cases we can eliminate an extract_subvector by converting
to a 128-bit EXT of the 128-bit vector.
Differential Revision: https://reviews.llvm.org/D53582
llvm-svn: 345275
Adrian Prantl [Thu, 25 Oct 2018 15:30:43 +0000 (15:30 +0000)]
Fix a bug PlatformDarwin::SDKSupportsModule.
This fixes a bug PlatformDarwin::SDKSupportsModule introduced by
https://reviews.llvm.org/D47889. VersionTuple::tryParse() can deal
with an optional third (micro) component, but the parse will fail when
there are extra characters after the version number (e.g.: trying to
parse the substring "12.0.sdk" out of "iPhoneSimulator12.0.sdk" fails
after that patch). Fixed here by stripping the ".sdk" suffix first.
(Part of) rdar://problem/
45041492
Differential Revision https://reviews.llvm.org/D53677
llvm-svn: 345274
Luke Cheeseman [Thu, 25 Oct 2018 15:23:49 +0000 (15:23 +0000)]
[AArch64] Branch Protection and Return Address Signing B Key Support
- Add support for -mbranch-protection=<type>[+<type>]* where
- <type> ::= [standard, none, bti, pac-ret[+b-key,+leaf]*]
- The protection emits relevant function attributes
- sign-return-address=<scope>
- sign-return-address-key=<key>
- branch-protection
llvm-svn: 345273
Sam Parker [Thu, 25 Oct 2018 15:08:29 +0000 (15:08 +0000)]
[ARM] Use Cortex-A57 sched model for Cortex-A72
This mirrors what we already do for AArch64 as the cores are similar.
As discussed in the review, enabling the machine scheduler causes
more variations in performance changes so it is not enabled for now.
This patch improves LNT scores by a geomean of 1.57% at -O3.
Differential Revision: https://reviews.llvm.org/D53562
llvm-svn: 345272
John Brawn [Thu, 25 Oct 2018 15:00:10 +0000 (15:00 +0000)]
[AArch64] Refactor definition of EXT patterns to use a multiclass
Using a multiclass reduces duplication, and makes it easier to add new patterns
later. This refactoring does add some new patterns, but as far as I can tell
there's no IR that will end up triggering them so this is effectively NFC.
Differential Revision: https://reviews.llvm.org/D53580
llvm-svn: 345271
John Brawn [Thu, 25 Oct 2018 14:56:48 +0000 (14:56 +0000)]
[AArch64] Do 64-bit vector move of 0 and -1 by extracting from the 128-bit move
Currently a vector move of 0 or -1 will use different instructions depending on
the size of the vector. Using a single instruction (the 128-bit one) for both
gives more opportunity for Machine CSE to eliminate instructions.
Differential Revision: https://reviews.llvm.org/D53579
llvm-svn: 345270
Alexey Bataev [Thu, 25 Oct 2018 14:27:27 +0000 (14:27 +0000)]
[DEBUG_INFO][NVPTX]Fix processing of DBG_VALUES.
Summary:
If the instruction in the eliminateFrameIndex function is a DBG_VALUE
instruction, it requires special processing. The frame register is set
to VRFrame and the offset is based on the object offset.
The code is similar to the code used in
lib/CodeGen/PrologEpilogInserter.cpp.
Reviewers: tra
Subscribers: jholewinski, llvm-commits
Differential Revision: https://reviews.llvm.org/D53657
llvm-svn: 345269
Sam McCall [Thu, 25 Oct 2018 14:19:14 +0000 (14:19 +0000)]
[clangd] workspace/symbol should be async, it reads from the index.
Summary:
To enable this, TUScheduler has to provide a way to run async tasks without
needing a preamble or AST!
Reviewers: ilya-biryukov
Subscribers: javed.absar, ioeric, MaskRay, jkorous, arphaman, jfb, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D53644
llvm-svn: 345268
Sylvestre Ledru [Thu, 25 Oct 2018 14:19:06 +0000 (14:19 +0000)]
update the clang doc about contributions
llvm-svn: 345267
Francis Visoiu Mistrih [Thu, 25 Oct 2018 14:11:07 +0000 (14:11 +0000)]
[X86] Fix llc invocation on MIR test case
The current state of the llc invocation is:
* Running all the passes from dwarfehprepare to stack coloring
(included)
* It runs it from the LLVM IR included in the file
* It *ADDS* the generated MI from ISel to the MI in the MIR file
* The machine verifier doesn't like it.
Differential Revision: https://reviews.llvm.org/D53698
llvm-svn: 345266
Amara Emerson [Thu, 25 Oct 2018 14:04:54 +0000 (14:04 +0000)]
[GlobalISel] Use the target preferred type for G_EXTRACT_VECTOR_ELT index.
Allows for better imported pattern re-use.
llvm-svn: 345265
Krasimir Georgiev [Thu, 25 Oct 2018 13:38:07 +0000 (13:38 +0000)]
IR: Optimize StructType::get to perform one hash lookup instead of two, NFCI
Summary:
This function was performing two hash lookups when a new struct type was requested: first checking if it exists and second to insert it. This patch updates the function to perform a single hash lookup in this case by updating the value in the hash table in-place in case the struct type was not there before.
Similar to r345151.
Reviewers: bkramer
Reviewed By: bkramer
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D53689
llvm-svn: 345264
Simon Pilgrim [Thu, 25 Oct 2018 13:06:20 +0000 (13:06 +0000)]
[CostModel][X86] Add realistic vXi64 uitofp vXf64 costs
Match codegen improvements from D53649/rL345256
llvm-svn: 345263
Alex Bradbury [Thu, 25 Oct 2018 12:45:20 +0000 (12:45 +0000)]
[RISCV] Use PatFrags for variable shift patterns
This follows SystemZ and I think is cleaner vs the multiclass.
llvm-svn: 345262
Simon Pilgrim [Thu, 25 Oct 2018 12:42:10 +0000 (12:42 +0000)]
[CostModel][X86] Add realistic i64 uitofp f64 scalar costs
llvm-svn: 345261
Louis Dionne [Thu, 25 Oct 2018 12:13:43 +0000 (12:13 +0000)]
[libc++] Make sure we can build libc++ with -fvisibility=hidden
Summary:
When building with -fvisibility=hidden, some symbols do not get exported from
libc++.dylib. This means that some entities are not explicitly given default
visibility in the source code, and that we rely on the fact -fvisibility=default
is the default. This commit explicitly gives default visibility to those
symbols to avoid being dependent on the command line flags used.
The commit also remove symbols from the dylib -- those symbols do not
actually need to be exported from the dylib and this should not be an
ABI break.
Finally, in the future, we may want to mark the whole std:: namespace as
having hidden visibility (to switch from opt-out to opt-in), in which
case the changes done in this commit will be required.
Reviewers: EricWF
Subscribers: mgorny, christof, dexonsmith, libcxx-commits
Differential Revision: https://reviews.llvm.org/D52662
llvm-svn: 345260
Andrea Di Biagio [Thu, 25 Oct 2018 11:51:34 +0000 (11:51 +0000)]
[llvm-mca] Removed a couple of redundant method declarations, and simplified code in ResourcePressureView. NFC
llvm-svn: 345259
Will Wilson [Thu, 25 Oct 2018 11:45:32 +0000 (11:45 +0000)]
[ms] Prevent explicit constructor name lookup if scope is missing
MicrosoftExt allows explicit constructor calls. Prevent lookup of constructor name unless the name has explicit scope.
This avoids a compile-time crash due to confusing a member access for a constructor name.
Test case included. All tests pass.
Differential Revision: https://reviews.llvm.org/D53441
llvm-svn: 345258
Simon Pilgrim [Thu, 25 Oct 2018 11:38:17 +0000 (11:38 +0000)]
Missing semicolon.
llvm-svn: 345257
Simon Pilgrim [Thu, 25 Oct 2018 11:15:57 +0000 (11:15 +0000)]
[TargetLowering] Improve vXi64 UINT_TO_FP vXf64 support (P38226)
As suggested on D52965, this patch moves the i64 to f64 UINT_TO_FP expansion code from LegalizeDAG into TargetLowering and makes it available to LegalizeVectorOps as well.
Not only does this help perform X86 lowering as a true vectorization instead of (partially vectorized) scalar conversions, it avoids the HADDPD op from the scalar code which can be slow on most targets.
The AVX512F does have the vcvtusi2sdq scalar operation but we don't unroll to use it as it seems to only help for the v2f64 case - otherwise the unrolling cost will certainly be too high. My feeling is that we should leave it to the vectorizers - and if it generates the vector UINT_TO_FP we should use it.
Differential Revision: https://reviews.llvm.org/D53649
llvm-svn: 345256
Andrey Churbanov [Thu, 25 Oct 2018 11:04:01 +0000 (11:04 +0000)]
remove duplicate omp_control_tool export to fix windows build
Patch by squallatf@gmail.com
Differential Revision: https://reviews.llvm.org/D53480
llvm-svn: 345255
George Rimar [Thu, 25 Oct 2018 10:56:44 +0000 (10:56 +0000)]
[llvm-dwarfdump] - Fix incorrect parsing of the DW_LLE_startx_length
As was already mentioned in comments for D53364, DWARF 5
spec says about DW_LLE_startx_length:
"This is a form of bounded location description that has two unsigned ULEB operands.
The first value is an address index (into the .debug_addr section) that indicates the beginning of the address range
over which the location is valid. The second value is the length of the range. ")
Currently, the length is always parsed as U32.
Patch change the behavior to parse DW_LLE_startx_length as ULEB128 for DWARF 5
and keeps it as U32 for DWARF4+(pre-DWARF5) for compatibility.
Differential revision: https://reviews.llvm.org/D53564
llvm-svn: 345254
Simon Pilgrim [Thu, 25 Oct 2018 10:52:36 +0000 (10:52 +0000)]
[TTI] Add generic SK_Broadcast shuffle costs
I noticed while fixing PR39368 that we don't have generic shuffle costs for broadcast style shuffles.
This patch adds SK_BROADCAST handling, but exposes ARM/AARCH64 lack of handling of this type, which I've added a fix for at the same time.
Differential Revision: https://reviews.llvm.org/D53570
llvm-svn: 345253
Simon Pilgrim [Thu, 25 Oct 2018 10:45:38 +0000 (10:45 +0000)]
Fix MSVC llvm-exegesis build. NFCI.
MSVC is a bit funny about is_pod.....
llvm-svn: 345252
George Rimar [Thu, 25 Oct 2018 10:25:45 +0000 (10:25 +0000)]
Recommit r345127 "[LLDB] - Add support for DW_RLE_base_address and DW_RLE_offset_pair entries (.debug_rnglists)"
With the fix: do not forget to hanlde the DW_RLE_start_end, which seems was
omited/forgotten/removed by mistake.
Original commit message:
The patch implements the support for DW_RLE_base_address and DW_RLE_offset_pair
.debug_rnglists entries
Differential revision: https://reviews.llvm.org/D53140
----
Added : /lldb/trunk/lit/Breakpoint/Inputs/debug_rnglist_offset_pair.yaml
Added : /lldb/trunk/lit/Breakpoint/debug_rnglist_offset_pair.test
Modified : /lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
Modified : /lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
Modified : /lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h
Modified : /lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
Modified : /lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
llvm-svn: 345251
Carlos Alberto Enciso [Thu, 25 Oct 2018 09:58:59 +0000 (09:58 +0000)]
[DebugInfo][Dexter] Unreachable line stepped onto after SimplifyCFG.
When SimplifyCFG changes the PHI node into a select instruction, the debug line records becomes ambiguous. It causes the debugger to display unreachable source lines.
Differential Revision: https://reviews.llvm.org/D53287
llvm-svn: 345250
George Rimar [Thu, 25 Oct 2018 09:22:26 +0000 (09:22 +0000)]
[LLDB] - Parse the DW_LLE_startx_length correctly for DWARF v5 case.
Currently, we always parse the length field of DW_LLE_startx_length entry as U32.
That is correct for pre-standard definition:
https://gcc.gnu.org/wiki/DebugFission - "A start/length entry contains one unsigned LEB128 number
and a 4-byte unsigned value (as would be represented by the form code DW_FORM_const4u). The first
number is an index into the .debug_addr section that selects the beginning offset, and the second
number is the length of the range. ")
But DWARF v5 says: "This is a form of bounded location description that has two unsigned ULEB operands.
The first value is an address index (into the .debug_addr section) that indicates the beginning of the address
range over which the location is valid. The second value is the length of the range."
Fortunately, we can easily handle the difference. No test case because it seems impossible to test
until we will be ready to use DWARF v5 in tests that need to run the executables.
Differential revision: https://reviews.llvm.org/D53646
llvm-svn: 345249
Gabor Buella [Thu, 25 Oct 2018 08:32:29 +0000 (08:32 +0000)]
Add -instcombine-code-sinking option
Reviewers: craig.topper, andrew.w.kaylor, efriedma
Reviewed By: craig.topper, andrew.w.kaylor, efriedma
Differential Revision: https://reviews.llvm.org/D52709
llvm-svn: 345248
Aleksandr Urakov [Thu, 25 Oct 2018 08:27:42 +0000 (08:27 +0000)]
[API] Extend the `SBThreadPlan` interface
Summary:
This patch extends the `SBThreadPlan` to allow retrieving of thread plans
for scripted steps.
Reviewers: labath, zturner, jingham
Reviewed By: jingham
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D53361
llvm-svn: 345247
Clement Courbet [Thu, 25 Oct 2018 08:11:35 +0000 (08:11 +0000)]
[llvm-exegesis] Add missing initializer.
This is a better fix than rL345245.
llvm-svn: 345246
Clement Courbet [Thu, 25 Oct 2018 08:08:58 +0000 (08:08 +0000)]
[llvm-exegesis] Fix VC build of r345243.
"const members cannot be default initialized unless their type has a user defined default constructor"
Make members non-const.
llvm-svn: 345245
Clement Courbet [Thu, 25 Oct 2018 08:06:35 +0000 (08:06 +0000)]
[llvm-exegesis] Fix warning in r345243.
warning C4099: 'llvm::exegesis::PfmCountersInfo': type name first seen using 'class' now seen using 'struct'
llvm-svn: 345244
Clement Courbet [Thu, 25 Oct 2018 07:44:01 +0000 (07:44 +0000)]
[MCSched] Bind PFM Counters to the CPUs instead of the SchedModel.
Summary:
The pfm counters are now in the ExegesisTarget rather than the
MCSchedModel (PR39165).
This also compresses the pfm counter tables (PR37068).
Reviewers: RKSimon, gchatelet
Subscribers: mgrang, llvm-commits
Differential Revision: https://reviews.llvm.org/D52932
llvm-svn: 345243
Krasimir Georgiev [Thu, 25 Oct 2018 07:39:30 +0000 (07:39 +0000)]
[clang-format] Break before next parameter after a formatted multiline raw string parameter
Summary:
Currently clang-format breaks before the next parameter after multiline parameters (also recursively for the parent expressions of multiline parameters). However, it fails to do so for formatted multiline raw string literals:
```
$ cat test.cc
// Examples
// Regular multiline tokens
int x = f(R"(multi
line)", 2);
}
int y = g(h(R"(multi
line)"), 2);
// Formatted multiline tokens
int z = f(R"pb(multi: 1 #
line: 2)pb", 2);
int w = g(h(R"pb(multi: 1 #
line: 2)pb"), 2);
$ clang-format -style=google test.cc
// Examples
// Regular multiline tokens
int x = f(R"(multi
line)",
2);
}
int y = g(h(R"(multi
line)"),
2);
// Formatted multiline tokens
int z = f(R"pb(multi: 1 #
line: 2)pb", 2);
int w = g(h(R"pb(multi: 1 #
line: 2)pb"), 2);
```
This patch addresses this inconsistency by forcing breaking after multiline formatted raw string literals. This requires a little tweak to the indentation chosen for the contents of a formatted raw string literal: in case when that's a parameter and not the last one, the indentation is based off of the uniform indentation of all of the parameters.
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D52448
llvm-svn: 345242
Craig Topper [Thu, 25 Oct 2018 07:00:09 +0000 (07:00 +0000)]
[X86] Don't use the OriginalDemandedBits to calculate the DemandedMask for PMULUDQ/PMULDQ inputs.
Multiply a is complex operation so just because some bit of the output isn't used doesn't mean that bit of the input isn't used.
We might able to bound it, but it will require some more thought.
llvm-svn: 345241
Eric Christopher [Thu, 25 Oct 2018 06:43:56 +0000 (06:43 +0000)]
Revert "Fix use of __libcpp_deallocate in dynarray"
This reverts commit r345234 as it depended on the sized deallocation commit.
llvm-svn: 345240
Eric Christopher [Thu, 25 Oct 2018 06:20:12 +0000 (06:20 +0000)]
Temporarily Revert "Implement sized deallocation for std::allocator and friends."
This is breaking the bots here (and related): http://lab.llvm.org:8011/builders/libcxx-libcxxabi-x86_64-linux-ubuntu-asan/builds/1428
This reverts commit r345214.
llvm-svn: 345239
Simon Atanasyan [Thu, 25 Oct 2018 05:39:27 +0000 (05:39 +0000)]
[llvm-readobj] Print ELF header flags names in GNU output
GNU readelf tool prints hex value of the ELF header flags field and the
flags names. This change adds the same functionality to llvm-readobj.
Now llvm-readobj can print MIPS and RISCV flags.
New GNUStyle::printFlags() method is a copy of ScopedPrinter::printFlags()
routine. Probably we can escape code duplication and / or simplify the
printFlags() method. But it's a task for separate commit.
Differential revision: https://reviews.llvm.org/D52027
llvm-svn: 345238
Craig Topper [Thu, 25 Oct 2018 05:04:35 +0000 (05:04 +0000)]
[CodeGen] Always emit the 'min-legal-vector-width' attribute even when the value is 0.
The X86 backend will need to see the attribute to make decisions. If it isn't present the backend will have to assume large vectors may be present.
llvm-svn: 345237
Craig Topper [Thu, 25 Oct 2018 05:00:20 +0000 (05:00 +0000)]
[X86] Fix typo in comment. NFC
llvm-svn: 345236
Sam McCall [Thu, 25 Oct 2018 04:22:52 +0000 (04:22 +0000)]
[clangd] Clean up LSP structs around configuration. NFC, no protocol changes.
- align struct names/comments with LSP, remove redundant "clangd" prefixes.
- don't map config structs as Optional<> when their presence/absence
doesn't signal anything and all fields must have sensible "absent" values
- be more lax around parsing of 'any'-typed messages
llvm-svn: 345235
Eric Fiselier [Thu, 25 Oct 2018 02:36:31 +0000 (02:36 +0000)]
Fix use of __libcpp_deallocate in dynarray
llvm-svn: 345234
Sam McCall [Thu, 25 Oct 2018 02:25:44 +0000 (02:25 +0000)]
[clangd] Remove unused CDB function. NFC
llvm-svn: 345233
Sam McCall [Thu, 25 Oct 2018 02:22:53 +0000 (02:22 +0000)]
[clangd] Fix -compile-commands-dir flag, broken in r345031
llvm-svn: 345232
Sam McCall [Thu, 25 Oct 2018 02:04:30 +0000 (02:04 +0000)]
[clangd] Don't invalidate LSP-set compile commands when closing a file.
Summary:
It doesn't make much sense: setting them is not coupled to opening the file,
it's an asynchronous notification.
I don't think this is a breaking change - this behavior is hard to observe!
Reviewers: ilya-biryukov
Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D53642
llvm-svn: 345231
Thomas Lively [Thu, 25 Oct 2018 01:46:07 +0000 (01:46 +0000)]
[WebAssembly] Set LoadExt and TruncStore actions for SIMD types
Summary: Fixes part of the problem reported in bug 39275.
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits, alexcrichton
Differential Revision: https://reviews.llvm.org/D53542
llvm-svn: 345230
Douglas Yung [Thu, 25 Oct 2018 01:21:08 +0000 (01:21 +0000)]
Fix test to work on Windows.
llvm-svn: 345229
Richard Trieu [Thu, 25 Oct 2018 01:08:00 +0000 (01:08 +0000)]
[Sema] Fix -Wcomma for C89
There is a small difference in the scope flags for C89 versus the other C/C++
dialects. This change ensures that the -Wcomma warning won't be duplicated or
issued in the wrong location. Also, the test case is refactored into C and C++
parts, with the C++ parts guarded by a #ifdef to allow the test to run in both
modes.
https://bugs.llvm.org/show_bug.cgi?id=32370
llvm-svn: 345228
Reid Kleckner [Wed, 24 Oct 2018 23:52:33 +0000 (23:52 +0000)]
[X86] Adjust MIR test case to pacify machine verifier
llvm-svn: 345227
Reid Kleckner [Wed, 24 Oct 2018 23:52:22 +0000 (23:52 +0000)]
[X86] Fix pipeline tests when enabling MIR verification, NFC
llvm-svn: 345226
Eric Fiselier [Wed, 24 Oct 2018 23:47:04 +0000 (23:47 +0000)]
Revert "[SemaCXX] Unconfuse Clang when std::align_val_t is unscoped in C++03"
This reverts commit
6f47cdd51341344c0e32630e19e72c94cd25f34e.
llvm-svn: 345225
David Blaikie [Wed, 24 Oct 2018 23:36:29 +0000 (23:36 +0000)]
DebugInfo: Reuse common addresses for rnglist base address selections
This makes the offsets larger (since they are further from the base
address) but those are in the .dwo - and allows removing addresses and
relocations from the .o file.
This could be built into the AddressPool more fundamentally, perhaps -
when you ask for an AddressPool entry you could say "or give me some
other entry and an offset I need to use" - though what to do about
situations where the first use of an address in a section is not the
earliest address in that section... is tricky.
At least with range addresses we can be fairly sure we've seen the
earliest address first because we see the start address for the
function.
llvm-svn: 345224
Heejin Ahn [Wed, 24 Oct 2018 23:31:24 +0000 (23:31 +0000)]
[WebAssembly] Fix immediate of rethrow when throwing to caller
Summary:
Currently when assigning depths 'rethrow' does not take the whole
control flow stack into accounts but only considers EH pad stacks. When
assigning depth immmediates to rethrows, in normal cases it is done
correctly but when a rethrow instruction throws up to a caller, i.e., we
convert a pseudo RETHROW_TO_CALLER instruction to a rethrow, it
mistakenly compute the whole stack depth.
Reviewers: dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D53619
llvm-svn: 345223
Saleem Abdulrasool [Wed, 24 Oct 2018 23:28:28 +0000 (23:28 +0000)]
Driver,CodeGen: introduce support for Swift CFString layout
Add a new driver level flag `-fcf-runtime-abi=` that allows one to specify the
runtime ABI for CoreFoundation. This controls the language interoperability.
In particular, this is relevant for generating the CFConstantString classes
(primarily through the `__builtin___CFStringMakeConstantString` builtin) which
construct a reference to the "CFObject"'s `isa` field. This type differs
between swift 4.1 and 4.2+.
Valid values for the new option include:
- objc [default behaviour] - enable ObjectiveC interoperability
- swift-4.1 - enable interoperability with swift 4.1
- swift-4.2 - enable interoperability with swift 4.2
- swift-5.0 - enable interoperability with swift 5.0
- swift [alias] - target the latest swift ABI
Furthermore, swift 4.2+ changed the layout for the CFString when building
CoreFoundation *without* ObjectiveC interoperability. In such a case, a field
was added to the CFObject base type changing it from: <{ const int*, int }> to
<{ uintptr_t, uintptr_t, uint64_t }>.
In swift 5.0, the CFString type will be further adjusted to change the length
from a uint32_t on everything but BE LP64 targets to uint64_t.
Note that the default behaviour for clang remains unchanged and the new layout
must be explicitly opted into via `-fcf-runtime-abi=swift*`.
llvm-svn: 345222
Thomas Lively [Wed, 24 Oct 2018 23:27:40 +0000 (23:27 +0000)]
[WebAssembly] Retain shuffle types during custom lowering
Summary:
Changing the node type in lowering was violating assumptions made in
the DAG combiner, so don't change the node type any more. This fixes
one of the issues reported in bug 39275.
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits, alexcrichton
Differential Revision: https://reviews.llvm.org/D53537
llvm-svn: 345221
Thomas Lively [Wed, 24 Oct 2018 23:14:59 +0000 (23:14 +0000)]
Make fminimum/fmaximum SDNodes commutative and associative
Reviewers: aheejin, dschuff
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D53680
llvm-svn: 345220
Reid Kleckner [Wed, 24 Oct 2018 22:57:28 +0000 (22:57 +0000)]
[ELF] Fix large code model MIR verifier errors
Instead of using the MOVGOT64r pseudo, use the existing
MO_PIC_BASE_OFFSET support on symbol operands. Now I don't have to
create a "scratch register operand" for the pseudo to use, and the
register allocator can make better decisions.
Fixes some X86 verifier errors tracked in PR27481.
llvm-svn: 345219
Thomas Lively [Wed, 24 Oct 2018 22:49:55 +0000 (22:49 +0000)]
[NFC] Rename minnan and maxnan to minimum and maximum
Summary:
Changes all uses of minnan/maxnan to minimum/maximum
globally. These names emphasize that the semantic difference between
these operations is more than just NaN-propagation.
Reviewers: arsenm, aheejin, dschuff, javed.absar
Subscribers: jholewinski, sdardis, wdng, sbc100, jgravelle-google, jrtc27, atanasyan, llvm-commits
Differential Revision: https://reviews.llvm.org/D53112
llvm-svn: 345218
Alexander Shaposhnikov [Wed, 24 Oct 2018 22:49:06 +0000 (22:49 +0000)]
[llvm-objcopy] Introduce dispatch mechanism based on the input
In this diff we introduce dispatch mechanism based on
the type of the input (archive, object file, raw binary)
and the format (coff, elf, macho).
We also move the ELF-specific code into the namespace llvm::objcopy::elf.
Test plan: make check-all
Differential revision: https://reviews.llvm.org/D53311
llvm-svn: 345217
Alina Sbirlea [Wed, 24 Oct 2018 22:46:45 +0000 (22:46 +0000)]
Update MemorySSA in LoopRotate.
Summary:
Teach LoopRotate to preserve MemorySSA.
Enable tests for correctness, dependency disabled by default.
Subscribers: sanjoy, jlebar, Prazek, george.burgess.iv, llvm-commits
Differential Revision: https://reviews.llvm.org/D51718
llvm-svn: 345216
David Blaikie [Wed, 24 Oct 2018 22:44:54 +0000 (22:44 +0000)]
llvm-dwarfdump: Account for skeleton addr_base when dumping addresses in split unit in the same file
llvm-svn: 345215
Eric Fiselier [Wed, 24 Oct 2018 22:44:01 +0000 (22:44 +0000)]
Implement sized deallocation for std::allocator and friends.
Summary:
C++14 sized deallocation is disabled by default due to ABI concerns. However, when a user manually enables it then libc++ should take advantage of it since sized deallocation can provide a significant performance win depending on the underlying malloc implementation. (Note that libc++'s definitions of sized delete don't do anything special yet, but users are free to provide their own).
This patch updates __libcpp_deallocate to selectively call sized operator delete when it's available. `__libcpp_deallocate_unsized` should be used when the size of the allocation is unknown.
On Apple this patch makes no attempt to determine if the sized operator delete is unavailable, only that the language feature is enabled. This could cause a compile error when using `std::allocator`, but the same compile error would occur whenever the user calls `new`, so I don't think it's a problem.
Reviewers: ldionne, mclow.lists
Reviewed By: ldionne
Subscribers: rsmith, ckennelly, libcxx-commits, christof
Differential Revision: https://reviews.llvm.org/D53120
llvm-svn: 345214
Volodymyr Sapsai [Wed, 24 Oct 2018 22:40:54 +0000 (22:40 +0000)]
[VFS] Remove 'ignore-non-existent-contents' attribute for YAML-based VFS.
'ignore-non-existent-contents' stopped working after r342232 in a way
that the actual attribute value isn't used and it works as if it is
always `true`.
Common use case for VFS iteration is iterating through files in umbrella
directories for modules. Ability to detect if some VFS entries point to
non-existing files is nice but non-critical. Instead of adding back
support for `'ignore-non-existent-contents': false` I am removing the
attribute, because such scenario isn't used widely enough and stricter
checks don't provide enough value to justify the maintenance.
Change is done both in LLVM and Clang, corresponding Clang commit is r345212.
rdar://problem/
45176119
Reviewers: bruno
Reviewed By: bruno
Subscribers: hiraditya, dexonsmith, sammccall, cfe-commits
Differential Revision: https://reviews.llvm.org/D53228
llvm-svn: 345213
Volodymyr Sapsai [Wed, 24 Oct 2018 22:39:38 +0000 (22:39 +0000)]
[VFS] Remove 'ignore-non-existent-contents' attribute for YAML-based VFS.
'ignore-non-existent-contents' stopped working after r342232 in a way
that the actual attribute value isn't used and it works as if it is
always `true`.
Common use case for VFS iteration is iterating through files in umbrella
directories for modules. Ability to detect if some VFS entries point to
non-existing files is nice but non-critical. Instead of adding back
support for `'ignore-non-existent-contents': false` I am removing the
attribute, because such scenario isn't used widely enough and stricter
checks don't provide enough value to justify the maintenance.
rdar://problem/
45176119
Reviewers: bruno
Reviewed By: bruno
Subscribers: hiraditya, dexonsmith, sammccall, cfe-commits
Differential Revision: https://reviews.llvm.org/D53228
llvm-svn: 345212
Eric Fiselier [Wed, 24 Oct 2018 22:38:49 +0000 (22:38 +0000)]
[SemaCXX] Unconfuse Clang when std::align_val_t is unscoped in C++03
Summary:
When -faligned-allocation is specified in C++03 libc++ defines std::align_val_t as an unscoped enumeration type (because Clang didn't provide scoped enumerations as an extension until 8.0).
Unfortunately Clang confuses the `align_val_t` overloads of delete with the sized deallocation overloads which aren't enabled. This caused Clang to call the aligned deallocation function as if it were the sized deallocation overload.
For example: https://godbolt.org/z/xXJELh
This patch fixes the confusion.
Reviewers: rsmith, EricWF
Reviewed By: EricWF
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D53508
llvm-svn: 345211
Thomas Lively [Wed, 24 Oct 2018 22:18:54 +0000 (22:18 +0000)]
[SelectionDAG] DAG combiner for fminnan and fmaxnan
Summary: Depends on D52765.
Reviewers: aheejin, dschuff
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D52768
llvm-svn: 345210
Vedant Kumar [Wed, 24 Oct 2018 22:15:41 +0000 (22:15 +0000)]
[HotColdSplitting] Identify larger cold regions using domtree queries
The current splitting algorithm works in three stages:
1) Identify cold blocks, then
2) Use forward/backward propagation to mark hot blocks, then
3) Grow a SESE region of blocks *outside* of the set of hot blocks and
start outlining.
While testing this pass on Apple internal frameworks I noticed that some
kinds of control flow (e.g. loops) are never outlined, even though they
unconditionally lead to / follow cold blocks. I noticed two other issues
related to how cold regions are identified:
- An inconsistency can arise in the internal state of the hotness
propagation stage, as a block may end up in both the ColdBlocks set
and the HotBlocks set. Further inconsistencies can arise as these sets
do not match what's in ProfileSummaryInfo.
- It isn't necessary to limit outlining to single-exit regions.
This patch teaches the splitting algorithm to identify maximal cold
regions and outline them. A maximal cold region is defined as the set of
blocks post-dominated by a cold sink block, or dominated by that sink
block. This approach can successfully outline loops in the cold path. As
a side benefit, it maintains less internal state than the current
approach.
Due to a limitation in CodeExtractor, blocks within the maximal cold
region which aren't dominated by a single entry point (a so-called "max
ancestor") are filtered out.
Results:
- X86 (LNT + -Os + externals): 134KB of TEXT were outlined compared to
47KB pre-patch, or a ~3x improvement. Did not see a performance impact
across two runs.
- AArch64 (LNT + -Os + externals + Apple-internal benchmarks): 149KB
of TEXT were outlined. Ditto re: performance impact.
- Outlining results improve marginally in the internal frameworks I
tested.
Follow-ups:
- Outline more than once per function, outline large single basic
blocks, & try to remove unconditional branches in outlined functions.
Differential Revision: https://reviews.llvm.org/D53627
llvm-svn: 345209
Rui Ueyama [Wed, 24 Oct 2018 22:15:32 +0000 (22:15 +0000)]
Do not call computeIsPreemptible() if its result is discarded. NFC.
llvm-svn: 345208
Jonas Devlieghere [Wed, 24 Oct 2018 22:04:20 +0000 (22:04 +0000)]
[Settings] Add -force flag to "settings set"
The -force option allows you to pass an empty value to settings set to
reset the value to its default. This means that the following operations
are equivalent:
settings set -f <setting>
settings clear <setting>
The motivation for this change is the ability to export and import
settings from LLDB. Because of the way the dumpers work, we don't know
whether a value is going to be the default or not. Hence we cannot use
settings clear and use settings set -f, potentially providing an empty
value.
Differential revision: https://reviews.llvm.org/D52772
llvm-svn: 345207
Sanjay Patel [Wed, 24 Oct 2018 22:02:05 +0000 (22:02 +0000)]
[InstCombine] add test for fptrunc with vector with undef elt; NFC
This should be fixed with D53650.
llvm-svn: 345206
Rui Ueyama [Wed, 24 Oct 2018 21:59:58 +0000 (21:59 +0000)]
Add more blank lines so that code doesn't look too dense. NFC.
llvm-svn: 345205
Rui Ueyama [Wed, 24 Oct 2018 21:59:48 +0000 (21:59 +0000)]
Add a comment for PPC64 .toc and GNU relro.
llvm-svn: 345204
Paul Robinson [Wed, 24 Oct 2018 21:51:55 +0000 (21:51 +0000)]
Make llvm-dwarfdump -name work on type units.
Differential Revision: https://reviews.llvm.org/D53672
llvm-svn: 345203
Joel E. Denny [Wed, 24 Oct 2018 21:46:42 +0000 (21:46 +0000)]
[SourceMgr][FileCheck] Obey -color by extending WithColor
(Relands r344930, reverted in r344935, and now hopefully fixed for
Windows.)
While this change specifically targets FileCheck, it affects any tool
using the same SourceMgr facilities.
Previously, -color was documented in FileCheck's -help output, but
-color had no effect. Now, -color obeys its documentation: it forces
colors to be used in FileCheck diagnostics even when stderr is not a
terminal.
-color is especially helpful when combined with FileCheck's -v, which
can produce a long series of diagnostics that you might wish to pipe
to a pager, such as less -R. The WithColor extensions here will also
help to clean up color usage in FileCheck's annotated dump of input,
which is proposed in D52999.
Reviewed By: JDevlieghere, zturner
Differential Revision: https://reviews.llvm.org/D53419
llvm-svn: 345202
Evandro Menezes [Wed, 24 Oct 2018 21:40:43 +0000 (21:40 +0000)]
[AArch64] Refactor Exynos machine model
Effectively, NFC.
llvm-svn: 345201
Tim Northover [Wed, 24 Oct 2018 21:36:34 +0000 (21:36 +0000)]
[DAG] check more operands for cycles when merging stores.
Until now, we've only checked whether merging stores would cause a cycle via
the value argument, but the address and indexed offset arguments are also
capable of creating cycles in some situations.
The addresses are all base+offset with notionally the same base, but the base
SDNode may still be different (e.g. via an indexed load in one case, and an
ISD::ADD elsewhere). This allows cycles to creep in if one of these sources
depends on another.
The indexed offset is usually undef (representing a non-indexed store), but on
some architectures (e.g. 32-bit ARM-mode ARM) it can be an arbitrary value,
again allowing dependency cycles to creep in.
llvm-svn: 345200
Petr Hosek [Wed, 24 Oct 2018 21:29:15 +0000 (21:29 +0000)]
Revert "Teach __libcpp_is_floating_point that __fp16 and _Float16 are"
This reverts commits r333103 and r333108. _Float16 and __fp16 are C11
extensions and compilers other than Clang don't define these for C++.
Differential Revision: https://reviews.llvm.org/D53670
llvm-svn: 345199
Tim Renouf [Wed, 24 Oct 2018 21:19:02 +0000 (21:19 +0000)]
Add gfx909 to GPU Arch
Subscribers: jholewinski, cfe-commits
Differential Revision: https://reviews.llvm.org/D53558
llvm-svn: 345198
Reid Kleckner [Wed, 24 Oct 2018 21:09:34 +0000 (21:09 +0000)]
[X86] Add *SP to tailcall register class to fix verifier error
It's possible to do a tail call to a stack argument. LLVM already
calculates the right stack offset to call through.
Fixes the sibcall* and musttail* verifier failures tracked at PR27481.
llvm-svn: 345197
Sanjin Sijaric [Wed, 24 Oct 2018 21:07:38 +0000 (21:07 +0000)]
[MIR] Add hasWinCFI field
Adding hasWinCFI field so that I can add MIR test cases to
https://reviews.llvm.org/D50166.
Differential Revision: https://reviews.llvm.org/D51201
llvm-svn: 345196
Lang Hames [Wed, 24 Oct 2018 20:37:40 +0000 (20:37 +0000)]
[ExecutionEngine] Remove some dead code from JITEventListener.h.
llvm-svn: 345195
Stephen Kelly [Wed, 24 Oct 2018 20:33:55 +0000 (20:33 +0000)]
[clang-query] Refactor Output settings to booleans
Summary: This will make it possible to add non-exclusive mode output.
Reviewers: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D53501
llvm-svn: 345194
Stephen Kelly [Wed, 24 Oct 2018 20:33:45 +0000 (20:33 +0000)]
[clang-query] Add 'detailed-ast' output as an alias for 'dump'
Summary: Future development can then dump other content than AST.
Reviewers: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D53500
llvm-svn: 345193
Stephen Kelly [Wed, 24 Oct 2018 20:33:14 +0000 (20:33 +0000)]
[clang-query] Re-word command help
Summary:
This will make it possible to easily
* Add new commands which accept <feature> parameters
* Extend the list of features
Reviewers: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D53498
llvm-svn: 345192