Vassil Vassilev [Fri, 14 Apr 2017 08:48:08 +0000 (08:48 +0000)]
PR32280: Do not crash on nested initializers.
Patch by Yuka Takahashi (D31591)!
llvm-svn: 300313
Alex Denisov [Fri, 14 Apr 2017 08:34:32 +0000 (08:34 +0000)]
Add more test cases for StringRef::edit_distance
Example strings taken from here: http://www.let.rug.nl/~kleiweg/lev/
llvm-svn: 300312
Andrew V. Tischenko [Fri, 14 Apr 2017 07:44:23 +0000 (07:44 +0000)]
This patch closes PR#32216: Better testing of schedule model instruction latencies/throughputs.
The details are here: https://reviews.llvm.org/D30941
llvm-svn: 300311
Gil Rapaport [Fri, 14 Apr 2017 07:30:23 +0000 (07:30 +0000)]
[LV] Remove implicit single basic block assumption
This patch is part of D28975's breakdown - no change in output intended.
LV's code currently assumes the vectorized loop is a single basic block up
until predicateInstructions() is called. This patch removes two manifestations
of this assumption (loop phi incoming values, dominator tree update) by
replacing the use of vectorLoopBody with the vectorized loop's latch/header.
Differential Revision: https://reviews.llvm.org/D32040
llvm-svn: 300310
Craig Topper [Fri, 14 Apr 2017 06:43:34 +0000 (06:43 +0000)]
[ValueTracking] Calculate the KnownZeros for Intrinsic::ctpop without using a temporary APInt to count leading zeros on.
The APInt was created from an 'unsigned' and we just wanted to know how many bits the value needed to represent it. We can just use Log2_32 from MathExtras.h to get the info.
llvm-svn: 300309
Craig Topper [Fri, 14 Apr 2017 06:43:32 +0000 (06:43 +0000)]
[ValueTracking] Use APInt::isNegative(). NFC
llvm-svn: 300308
Craig Topper [Fri, 14 Apr 2017 06:43:29 +0000 (06:43 +0000)]
[ValueTracking] Use APInt::sext instead of zext and setBitsFrom. NFC
llvm-svn: 300307
Konstantin Zhuravlyov [Fri, 14 Apr 2017 05:33:57 +0000 (05:33 +0000)]
[AMDGPU][GFX9] Set +fp32-denormals for >=gfx900 unless -cl-denorms-are-zero is set
Differential Revision: https://reviews.llvm.org/D31482
llvm-svn: 300306
Craig Topper [Fri, 14 Apr 2017 05:09:04 +0000 (05:09 +0000)]
[InstCombine] Use APInt::setSignBit and APInt::isNegative(). NFC
llvm-svn: 300305
Xinliang David Li [Fri, 14 Apr 2017 04:14:29 +0000 (04:14 +0000)]
Fix use after free error
llvm-svn: 300304
NAKAMURA Takumi [Fri, 14 Apr 2017 03:16:48 +0000 (03:16 +0000)]
clang/test/CoverageMapping/unused_names.c: Relax an expression for targeting PECOFF.
llvm-svn: 300303
Xinliang David Li [Fri, 14 Apr 2017 03:03:24 +0000 (03:03 +0000)]
Fix test failure on windows: pass module to getInstrProfXXName calls
llvm-svn: 300302
Xinliang David Li [Fri, 14 Apr 2017 03:01:25 +0000 (03:01 +0000)]
Remove unused function /nfc
llvm-svn: 300301
Peter Collingbourne [Fri, 14 Apr 2017 02:55:06 +0000 (02:55 +0000)]
Object, LTO: Add target triple to irsymtab and LTO API.
Start using it in LLD to avoid needing to read bitcode again just to get the
target triple, and in llvm-lto2 to avoid printing symbol table information
that is inappropriate for the target.
Differential Revision: https://reviews.llvm.org/D32038
llvm-svn: 300300
Daniel Berlin [Fri, 14 Apr 2017 02:53:37 +0000 (02:53 +0000)]
NewGVN: Don't propagate over phi backedges where undef causes us to
have >1 value, unless we can prove the phi node is cycle free.
Fixes PR 32607.
llvm-svn: 300299
Peter Collingbourne [Fri, 14 Apr 2017 02:34:47 +0000 (02:34 +0000)]
COFF: Remove some unused fields.
llvm-svn: 300298
Peter Collingbourne [Fri, 14 Apr 2017 02:34:32 +0000 (02:34 +0000)]
ELF: Remove some dead code.
llvm-svn: 300297
Richard Smith [Fri, 14 Apr 2017 02:04:44 +0000 (02:04 +0000)]
Remove empty test directory for nonexistent standard clause.
llvm-svn: 300296
Vedant Kumar [Fri, 14 Apr 2017 01:59:44 +0000 (01:59 +0000)]
[docs] UBSan: Mention that print_stacktrace=1 is unsupported on Darwin
Printing out stack traces along with UBSan diagnostics is unsupported on
Darwin. That's because it isn't possible to use the fast unwinder or the
slow unwinder.
Apparently, it's inappropriate to use the fast unwinder for UBSan
issues. I'm not exactly sure why (see the comment in ubsan_diag.cc).
Forcing use of the fast unwinder produces decent results, AFAICT.
Darwin also does not appear to have a slow unwinder suitable for use
with the sanitizers. Apparently that's because of PR20800 [1][2]. But
that bug has been fixed. I'm not sure if there is anything preventing
use of the slow unwinder now.
Currently, passing UBSAN_OPTIONS=print_stacktrace=1 does nothing on
Darwin. This isn't good, but it might be a while before we can fix the
situation, so we should at least document it.
[1] https://github.com/google/sanitizers/issues/137
"We can't use the slow unwinder on OSX now, because Clang produces
incorrect unwind info for the ASan runtime functions on OSX
(http://llvm.org/PR20800)."
[2] https://bugs.llvm.org/show_bug.cgi?id=20800
Bug 20800 - Invalid compact unwind info generated for a function without
frame pointers on OSX
llvm-svn: 300295
Rui Ueyama [Fri, 14 Apr 2017 01:35:04 +0000 (01:35 +0000)]
Remove useless local variable.
llvm-svn: 300294
Rui Ueyama [Fri, 14 Apr 2017 01:34:45 +0000 (01:34 +0000)]
Replace uintX_t with uint64_t.
We generally want to use uint64_t instead of uintX_t if the 64-bit
type works for both 32-bit and 64-bit because it is simpler than
the variable-size type.
llvm-svn: 300293
Sanjoy Das [Fri, 14 Apr 2017 01:33:15 +0000 (01:33 +0000)]
Use range-for; NFC
llvm-svn: 300292
Sanjoy Das [Fri, 14 Apr 2017 01:33:13 +0000 (01:33 +0000)]
Use transform instead of manual loop; NFC
llvm-svn: 300291
Kuba Mracek [Fri, 14 Apr 2017 01:00:03 +0000 (01:00 +0000)]
Revert r300287.
llvm-svn: 300290
NAKAMURA Takumi [Fri, 14 Apr 2017 00:36:06 +0000 (00:36 +0000)]
LLVMCodeGen: Add ProfileData into deps corresponding to r300277.
llvm-svn: 300289
Stanislav Mekhanoshin [Fri, 14 Apr 2017 00:33:44 +0000 (00:33 +0000)]
[AMDGPU] added SIInstrInfo::getAddNoCarry() helper
Addressed rest of post submit comments from D31993.
Differential Revision: https://reviews.llvm.org/D32057
llvm-svn: 300288
Kuba Mracek [Fri, 14 Apr 2017 00:32:43 +0000 (00:32 +0000)]
[ObjC] Fix lifetime markers of loop variable in EmitObjCForCollectionStmt
CodeGenFunction::EmitObjCForCollectionStmt currently emits lifetime markers for the loop variable in an inconsistent way: lifetime.start is emitted before the loop is entered, but lifetime.end is emitted inside the loop. AddressSanitizer uses these markers to track out-of-scope accesses to local variables, and we get false positives in Obj-C foreach loops (in the 2nd iteration of the loop). The markers of the loop variable need to be either both inside the loop (so that we poison and unpoison the variable in each iteration), or both outside. This patch implements the "both inside" approach.
Differential Revision: https://reviews.llvm.org/D32029
llvm-svn: 300287
Lang Hames [Fri, 14 Apr 2017 00:06:12 +0000 (00:06 +0000)]
[ORC] Re-enable the Error/Expected unit tests that were disabled in r300177.
The tests were failing due to an occasional deadlock in SerializationTraits
for Error: Both serializers and deserializers were protected by a single
mutex and in the unit test (where both ends of the RPC are in the same
process) one side might obtain the mutex, then block waiting for input,
leaving the other side of the connection unable to obtain the mutex to
write the data the first side was waiting for. Splitting the mutex into
two (one for serialization, one for deserialization) appears to have fixed the
issue.
llvm-svn: 300286
Reid Kleckner [Fri, 14 Apr 2017 00:06:06 +0000 (00:06 +0000)]
Simplify some Verifier attribute checks with AttributeSet
Now that we have a type that can represent the attributes on a single
return, function, or parameter, we can pass it around directly rather
than passing around AttributeList and Idx. Removes some more one-based
argument attribute index counting.
NFC
llvm-svn: 300285
Rui Ueyama [Thu, 13 Apr 2017 23:49:54 +0000 (23:49 +0000)]
Remove useless namespaces.
llvm-svn: 300284
George Burgess IV [Thu, 13 Apr 2017 23:47:08 +0000 (23:47 +0000)]
Fix PR31934: forming refs to functions with enable_if attrs.
llvm-svn: 300283
Matthias Braun [Thu, 13 Apr 2017 23:45:14 +0000 (23:45 +0000)]
MIRLangRef: Add a section on simplifying .mir tests
Differential Revision: http://reviews.llvm.org/D32058
llvm-svn: 300282
Rui Ueyama [Thu, 13 Apr 2017 23:40:19 +0000 (23:40 +0000)]
Rename readOutputSectionFiller parseFill.
"read" is used as a prefix for functions that read tokens from input
streams. This function doesn't really read anything, but just parses
a given string as an integer, so rename.
llvm-svn: 300281
Rui Ueyama [Thu, 13 Apr 2017 23:40:00 +0000 (23:40 +0000)]
Fix FILL linker script command.
FILL command doesn't need a semicolon.
Fixes https://bugs.llvm.org/show_bug.cgi?id=32657
llvm-svn: 300280
Xinliang David Li [Thu, 13 Apr 2017 23:37:21 +0000 (23:37 +0000)]
[Profile] PE binary coverage bug fix
PR/32584
Differential Revision: https://reviews.llvm.org/D32023
llvm-svn: 300279
Xinliang David Li [Thu, 13 Apr 2017 23:37:15 +0000 (23:37 +0000)]
[Profile] PE binary coverage bug fix
PR/32584
Differential Revision: https://reviews.llvm.org/D32023
llvm-svn: 300278
Xinliang David Li [Thu, 13 Apr 2017 23:37:12 +0000 (23:37 +0000)]
[Profile] PE binary coverage bug fix
PR/32584
Differential Revision: https://reviews.llvm.org/D32023
llvm-svn: 300277
Adam Nemet [Thu, 13 Apr 2017 23:32:47 +0000 (23:32 +0000)]
[AArch64] Avoid partial register writes on lane 0 of BUILD_VECTOR for i8/i16/f16
This further improves Ahmed's change in rL299482. See the new comment for the
rationale.
The patch recovers most of the regression for bzip2 after D31965. We're down
to +2.68% from +6.97%.
Differential Revision: https://reviews.llvm.org/D32028
llvm-svn: 300276
Konstantin Zhuravlyov [Thu, 13 Apr 2017 23:17:00 +0000 (23:17 +0000)]
AMDGPU/GFX9: Do not use v_pack_b32_f16 when packing
Differential Revision: https://reviews.llvm.org/D31819
llvm-svn: 300275
Hans Wennborg [Thu, 13 Apr 2017 23:13:23 +0000 (23:13 +0000)]
build_llvm_package.bat: Move to VS2017
It's required for building the clang-format plugin after r300225.
llvm-svn: 300273
Reid Kleckner [Thu, 13 Apr 2017 23:12:13 +0000 (23:12 +0000)]
[IR] Make getParamAttributes take argument numbers, not ArgNo+1
Add hasParamAttribute() and use it instead of hasAttribute(ArgNo+1,
Kind) everywhere.
The fact that the AttributeList index for an argument is ArgNo+1 should
be a hidden implementation detail.
NFC
llvm-svn: 300272
Richard Smith [Thu, 13 Apr 2017 22:44:22 +0000 (22:44 +0000)]
[docs] Regenerate diagnostics reference.
llvm-svn: 300271
Richard Smith [Thu, 13 Apr 2017 22:39:49 +0000 (22:39 +0000)]
[docs] Fix a couple of typos in command line flag help text and regenerate documentation.
llvm-svn: 300270
Alexei Starovoitov [Thu, 13 Apr 2017 22:24:13 +0000 (22:24 +0000)]
[bpf] Fix memory offset check for loads and stores
If the offset cannot fit into the instruction, an addition to the
pointer is emitted before the actual access. However, BPF offsets are
16-bit but LLVM considers them to be, for the matter of this check,
to be 32-bit long.
This causes the following program:
int bpf_prog1(void *ign)
{
volatile unsigned long t = 0x8983984739ull;
return *(unsigned long *)((0xffffffff8fff0002ull) + t);
}
To generate the following (wrong) code:
0: 18 01 00 00 39 47 98 83 00 00 00 00 89 00 00 00
r1 = 590618314553ll
2: 7b 1a f8 ff 00 00 00 00 *(u64 *)(r10 - 8) = r1
3: 79 a1 f8 ff 00 00 00 00 r1 = *(u64 *)(r10 - 8)
4: 79 10 02 00 00 00 00 00 r0 = *(u64 *)(r1 + 2)
5: 95 00 00 00 00 00 00 00 exit
Fix it by changing the offset check to 16-bit.
Patch by Nadav Amit <nadav.amit@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Differential Revision: https://reviews.llvm.org/D32055
llvm-svn: 300269
Matthias Braun [Thu, 13 Apr 2017 22:14:45 +0000 (22:14 +0000)]
MIRLangRef: Simplify/update documentation
- Refer to options by `-option` instead of `option`
- Use `-mtriple=` instead of `-march` in the example (-march will still
target the default operating system which is usually not what you want
in a test)
- Rephrase sentence because output does not go to stdout by default (you
need -o - for that as should be expected).
llvm-svn: 300268
Teresa Johnson [Thu, 13 Apr 2017 21:51:49 +0000 (21:51 +0000)]
[Support] Fix ErrorOr assertion when /proc/cpuinfo doesn't exist.
The ErrorOr should not be dereferenced on the error path.
Patch by Jacob Young
Reviewers: tejohnson
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32032
llvm-svn: 300267
Richard Smith [Thu, 13 Apr 2017 21:51:04 +0000 (21:51 +0000)]
Add test for anonymous struct containing an implicitly private data member.
Patch by Jacob Young!
llvm-svn: 300266
Craig Topper [Thu, 13 Apr 2017 21:49:48 +0000 (21:49 +0000)]
[InstCombine] Use APInt::getBitsSetFrom instead of inverting the result of getLowBitsSet. NFC
llvm-svn: 300265
Richard Smith [Thu, 13 Apr 2017 21:49:46 +0000 (21:49 +0000)]
Diagnose attempt to take address of bitfield members in anonymous structs.
Patch by Jacob Young!
Differential Revision: https://reviews.llvm.org/D27263
llvm-svn: 300264
Rui Ueyama [Thu, 13 Apr 2017 21:37:56 +0000 (21:37 +0000)]
Add "1" suffix if there's varaible ends with "2".
If we knew that we'd add End2, Edata2 and Etext2, we'd name their
original symbols with "1". This patch does it.
llvm-svn: 300263
Richard Smith [Thu, 13 Apr 2017 21:37:24 +0000 (21:37 +0000)]
PR32185: Revert r291512 and add a testcase for PR32185.
This reverts an attempt to check that types match when matching a
dependently-typed non-type template parameter. (This comes up when matching the
parameters of a template template parameter against the parameters of a
template template argument.)
The matching rules here are murky at best. Our behavior after this revert is
definitely wrong for certain C++17 features (for 'auto' template parameter
types within the parameter list of a template template argument in particular),
but our behavior before this revert is wrong for some pre-existing testcases,
so reverting to our prior behavior seems like our best option.
llvm-svn: 300262
Petr Hosek [Thu, 13 Apr 2017 21:29:21 +0000 (21:29 +0000)]
[libcxx] Direct support for Fuchsia
Fuchsia's libc was forked from musl, but has evolved sufficiently
since then so it no longer makes sense to pretend it's musl. This
change implements direct support for Fuchsia rather than
piggybacking on musl support.
Differential Revision: https://reviews.llvm.org/D31970
llvm-svn: 300261
Petr Hosek [Thu, 13 Apr 2017 21:29:03 +0000 (21:29 +0000)]
[CMake][runtimes] Use -nodefaultlibs for the runtimes build
We may not have a working C++ standard library at this point so we
shouldn't rely on it when running CMake checks.
Differential Revision: https://reviews.llvm.org/D31942
llvm-svn: 300260
Rui Ueyama [Thu, 13 Apr 2017 21:23:03 +0000 (21:23 +0000)]
Replace a clever lambda helper with a simpler one.
llvm-svn: 300259
Zachary Turner [Thu, 13 Apr 2017 21:11:00 +0000 (21:11 +0000)]
[llvm-pdbdump] Recursively dump class layout.
llvm-svn: 300258
Petr Hosek [Thu, 13 Apr 2017 21:09:42 +0000 (21:09 +0000)]
[CMake] Support building Fuchsia toolchain on Darwin
This is already supported on Linux but on Darwin it requires some
extra flags.
Differential Revision: https://reviews.llvm.org/D30958
llvm-svn: 300257
Craig Topper [Thu, 13 Apr 2017 20:39:37 +0000 (20:39 +0000)]
[ValueTracking] Remove duplicate call to computeKnownBits for the operands of Select.
We call it unconditionally on the operands of the select. Then decide if its a min/max and call it on the min/max operands or on the select operands again. Either of those second calls will overwrite the results of the initial call so we can just delete the first call.
llvm-svn: 300256
Davide Italiano [Thu, 13 Apr 2017 20:36:59 +0000 (20:36 +0000)]
[LCSSA] Efficiently compute blocks dominating at least one exit.
For LCSSA purposes, loop BBs not dominating any of the exits aren't
interesting, as none of the values defined in these blocks can be
used outside the loop.
The way the code computed this information was by comparing each
BB of the loop with each of the exit blocks and ask the dominator tree
about their dominance relation. This is slow.
A more efficient way, implemented here, is that of starting from the
exit blocks and walking the dom upwards until we hit an header. By
transitivity, all the blocks we encounter in our path dominate an exit.
For the testcase provided in PR31851, this reduces compile time on
`opt -O2` by ~25%, going from 1m47s to 1m22s.
Thanks to Dan/MichaelZ for discussions/suggesting the approach/review.
Differential Revision: https://reviews.llvm.org/D31843
llvm-svn: 300255
Reid Kleckner [Thu, 13 Apr 2017 20:32:58 +0000 (20:32 +0000)]
Fix -Wunused-value warning
llvm-svn: 300254
Richard Smith [Thu, 13 Apr 2017 20:31:21 +0000 (20:31 +0000)]
Revert accidentally-committed files in r300252.
llvm-svn: 300253
Richard Smith [Thu, 13 Apr 2017 20:29:59 +0000 (20:29 +0000)]
Remove all allocation and divisions from GreatestCommonDivisor
Switch from Euclid's algorithm to Stein's algorithm for computing GCD. This
avoids the (expensive) APInt division operation in favour of bit operations.
Remove all memory allocation from within the GCD loop by tweaking our `lshr`
implementation so it can operate in-place.
Differential Revision: https://reviews.llvm.org/D31968
llvm-svn: 300252
Reid Kleckner [Thu, 13 Apr 2017 20:26:38 +0000 (20:26 +0000)]
[InstCombine] Fix !prof metadata preservation for invokes
Summary:
Bug noticed by inspection.
Extend the test to handle invokes as well as calls, and rewrite it to
not depend on the inliner and other passes.
Also simplify the call site replacement code with CallSite, similar to
what I did to dead arg elimination and arg promotion (rL300235 and
rL300229).
Reviewers: danielcdh, davidxl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32041
llvm-svn: 300251
Vitaly Buka [Thu, 13 Apr 2017 20:25:24 +0000 (20:25 +0000)]
[msan] Fix msan_test.cc by checking bind results before assuming IPv6 supported.
llvm-svn: 300250
Vitaly Buka [Thu, 13 Apr 2017 20:25:20 +0000 (20:25 +0000)]
Revert "[msan] Fix msan_test broken after r299884."
This does not fix the test, it still fails to bind.
This reverts commit r300150.
llvm-svn: 300249
Francis Ricci [Thu, 13 Apr 2017 20:14:15 +0000 (20:14 +0000)]
Disable use of tls scanning on darwin leak sanitizer
Summary:
These checks appear linux-specific, disable them on darwin, at
least for now.
Reviewers: kubamracek, alekseyshl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32013
llvm-svn: 300248
Francis Ricci [Thu, 13 Apr 2017 20:13:53 +0000 (20:13 +0000)]
Move Linux-specific lsan tests into a new directory
Summary:
These tests aren't supported on other platforms, move them
to their own directory.
Reviewers: kubamracek, alekseyshl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32034
llvm-svn: 300247
Shoaib Meenai [Thu, 13 Apr 2017 20:13:32 +0000 (20:13 +0000)]
[libc++] Add _LIBCPP_DISABLE_EXTERN_TEMPLATE config option
When the libc++ extern template macros were added, the intent was for it
to be possible for consumers of the headers to disable extern templates
(via `-D_LIBCPP_EXTERN_TEMPLATE(...)=`). Unfortunately, support for
specifying function-like macros varies on the command line varies across
compilers (e.g. MSVC doesn't support it at all), and cmake doesn't allow
it for the same reason. Add a non-function macro for this purpose.
The intended use is for libraries which want to use the libc++ headers
without taking a dependency on the libc++ library itself. I can name the
macro something which reflects its intent rather than its behavior (e.g.
`_LIBCPP_HEADER_ONLY`) if desired.
Differential Revision: https://reviews.llvm.org/D31725
llvm-svn: 300246
Hans Wennborg [Thu, 13 Apr 2017 20:09:18 +0000 (20:09 +0000)]
clang-format-vs licence.txt: drop svn:executable
Not sure how it ended up with that property in the first place.
llvm-svn: 300245
Davide Italiano [Thu, 13 Apr 2017 20:05:37 +0000 (20:05 +0000)]
[LCSSA] Assert that we always have a valid loop.
We could otherwise add BBs not belonging to a loop in `formLCSSA`
and later crash when trying to iterate the loop blocks.
llvm-svn: 300244
Davide Italiano [Thu, 13 Apr 2017 20:02:27 +0000 (20:02 +0000)]
[LCSSA] Remove spurious whitespaces. NFCI.
llvm-svn: 300243
Davide Italiano [Thu, 13 Apr 2017 20:01:30 +0000 (20:01 +0000)]
[LCSSA] Use `auto` when the type is obvious. NFCI.
llvm-svn: 300242
Nirav Dave [Thu, 13 Apr 2017 20:00:27 +0000 (20:00 +0000)]
[DAG] Fold away temporary vector in store candidate merge NFC.
llvm-svn: 300241
Dehao Chen [Thu, 13 Apr 2017 19:52:10 +0000 (19:52 +0000)]
SamplePGO: convert callsite samples map key from callsite_location to callsite_location+callee_name
Summary: For iterative SamplePGO, an indirect call can be speculatively promoted to multiple direct calls and get inlined. All these promoted direct calls will share the same callsite location (offset+discriminator). With the current implementation, we cannot distinguish between different promotion candidates and its inlined instance. This patch adds callee_name to the key of the callsite sample map. And added helper functions to get all inlined callee samples for a given callsite location. This helps the profile annotator promote correct targets and inline it before annotation, and ensures all indirect call targets to be annotated correctly.
Reviewers: davidxl, dnovillo
Reviewed By: davidxl
Subscribers: andreadb, llvm-commits
Differential Revision: https://reviews.llvm.org/D31950
llvm-svn: 300240
Craig Topper [Thu, 13 Apr 2017 19:04:45 +0000 (19:04 +0000)]
[ValueTracking] Prevent a call to computeKnownBits if we already know the state of the bit we would calculate. Also reuse a temporary APInt instead of creating a new one.
llvm-svn: 300239
Anna Thomas [Thu, 13 Apr 2017 18:59:25 +0000 (18:59 +0000)]
[LV] Fix the vector code generation for first order recurrence
Summary:
In first order recurrences where phi's are used outside the loop,
we should generate an additional vector.extract of the second last element from
the vectorized phi update.
This is because we require the phi itself (which is the value at the second last
iteration of the vector loop) and not the phi's update within the loop.
Also fix the code gen when we just unroll, but don't vectorize.
Fixes PR32396.
Reviewers: mssimpso, mkuper, anemet
Subscribers: llvm-commits, mzolotukhin
Differential Revision: https://reviews.llvm.org/D31979
llvm-svn: 300238
Alex Shlyapnikov [Thu, 13 Apr 2017 18:49:29 +0000 (18:49 +0000)]
Revert "Enable LSan on PowerPC64."
This reverts commit r300204. Breaks ASAN tests on PPC.
llvm-svn: 300237
Sanjay Patel [Thu, 13 Apr 2017 18:47:06 +0000 (18:47 +0000)]
[InstCombine] fold X == 0 || X == -1 to one compare (PR32524)
This is effectively a retry of:
https://reviews.llvm.org/rL299851
but now we have tests and an assert to make sure the bug
that was exposed with that attempt will not happen again.
I'll fix the code duplication and missing sibling fold next,
but I want to make this change as small as possible to reduce
risk since I messed it up last time.
This should fix:
https://bugs.llvm.org/show_bug.cgi?id=32524
llvm-svn: 300236
Reid Kleckner [Thu, 13 Apr 2017 18:42:03 +0000 (18:42 +0000)]
[DAE] Simplify call site replacement code with CallSite NFC
llvm-svn: 300235
Francis Ricci [Thu, 13 Apr 2017 18:40:19 +0000 (18:40 +0000)]
Implement global pointer scanning for darwin leak sanitizer
Reviewers: kubamracek, kcc, alekseyshl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32012
llvm-svn: 300234
Craig Topper [Thu, 13 Apr 2017 18:25:53 +0000 (18:25 +0000)]
[ValueTracking] Move a temporary APInt instead of copying it.
llvm-svn: 300233
Marshall Clow [Thu, 13 Apr 2017 18:25:32 +0000 (18:25 +0000)]
Remove the binders from C++17. Reviewed as https://reviews.llvm.org/D31769
llvm-svn: 300232
Hans Wennborg [Thu, 13 Apr 2017 18:15:00 +0000 (18:15 +0000)]
Follow-up to r300225: update ClangFormat.csproj too
llvm-svn: 300231
Reid Kleckner [Thu, 13 Apr 2017 18:11:03 +0000 (18:11 +0000)]
[InstCombine] Simplify attribute code with new AttributeList::get NFC
llvm-svn: 300230
Reid Kleckner [Thu, 13 Apr 2017 18:10:30 +0000 (18:10 +0000)]
[ArgPromotion] Don't drop !prof metadata on promoted calls
Noticed by inspection while doing attribute work. DAE, InstCombineCalls,
and ArgPromotion have a fair amount of duplicated code for hacking on
call sites, and you can find bugs by comparing them.
Add a test case for this.
llvm-svn: 300229
Adrian Prantl [Thu, 13 Apr 2017 18:06:59 +0000 (18:06 +0000)]
Add a test for __block variables + asan.
llvm-svn: 300228
Stanislav Mekhanoshin [Thu, 13 Apr 2017 17:53:07 +0000 (17:53 +0000)]
[AMDGPU] Combine DS operations with offsets bigger than byte
In many cases ds operations can be combined even if offsets do not
fit into 8 bit encoding. What it takes is to adjust base address.
Differential Revision: https://reviews.llvm.org/D31993
llvm-svn: 300227
Hans Wennborg [Thu, 13 Apr 2017 17:47:47 +0000 (17:47 +0000)]
Follow-up to r300225: update ClangFormat.sln to VS2017
This got lost in the previous patch somehow.
llvm-svn: 300226
Hans Wennborg [Thu, 13 Apr 2017 17:42:45 +0000 (17:42 +0000)]
Warning-free clang-format plugin install for VS 15.0
With the new release of VS, it's required that all plugins migrate to
the new VSIX manifest format. The new format is backwards compatible
with all versions newer that Visual Studio 2012, so this migration
effectively drops support for older versions of the IDE.
It's also required that these new extensions are built with Visual
Studio 2017, so unfortunately it was necessary to migrate the project
and solution. Also removed COM references to EnvDTE and
Microsoft.VisualStudio.TextManager.Interop from the csproj, as they seem
to both be unnecessary and would trigger build warnings because of
changes to GAC.
Patch by Hugo Puhlmann!
Differential Revision: https://reviews.llvm.org/D31740
llvm-svn: 300225
Craig Topper [Thu, 13 Apr 2017 17:39:46 +0000 (17:39 +0000)]
[APSInt] Remove named And/Or/Xor methods.
No one uses them and I may improve the operator&, operator|, and operator^ to better reuse memory allocations like APInt.
llvm-svn: 300224
Hans Wennborg [Thu, 13 Apr 2017 17:37:17 +0000 (17:37 +0000)]
clang-format-vs: Use a separate license.txt copy
The regular file used to display very poorly in the VSIX installer due
to long lines, wrapping etc.
llvm-svn: 300223
Sanjay Patel [Thu, 13 Apr 2017 17:36:24 +0000 (17:36 +0000)]
[InstCombine] use similar ops for related folds; NFCI
It's less efficient to produce 'ule' than 'ult' since we know we're going to
canonicalize to 'ult', but we shouldn't have duplicated code for these folds.
As a trade-off, this was a pretty terrible way to make a '2'. :)
if (LHSC == SubOne(RHSC))
AddC = ConstantExpr::getSub(AddOne(RHSC), LHSC);
The next steps are to share the code to fix PR32524 and add the missing 'and'
fold that was left out when PR14708 was fixed:
https://bugs.llvm.org/show_bug.cgi?id=14708
llvm-svn: 300222
Francis Ricci [Thu, 13 Apr 2017 17:28:52 +0000 (17:28 +0000)]
Don't assume PTHREAD_CREATE_JOINABLE is 0 on all systems
Summary:
Lsan was using PTHREAD_CREATE_JOINABLE/PTHREAD_CREATE_DETACHED
as truthy values, which works on Linux, where the values are 0 and 1,
but this fails on OS X, where the values are 1 and 2.
Set PTHREAD_CREATE_DETACHED to the correct value for a given system.
Reviewers: kcc, glider, kubamracek, alekseyshl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31883
llvm-svn: 300221
Andrey Churbanov [Thu, 13 Apr 2017 17:15:07 +0000 (17:15 +0000)]
KMP_HW_SUBSET extended with NUMA support when HWLOC enabled
Differential Revision: https://reviews.llvm.org/D31600
llvm-svn: 300220
Craig Topper [Thu, 13 Apr 2017 17:12:00 +0000 (17:12 +0000)]
[APInt] Fix the returns description for the postfix increment/decrement operators. NFC
llvm-svn: 300219
Marshall Clow [Thu, 13 Apr 2017 16:57:42 +0000 (16:57 +0000)]
Implement LWG#2855 - made easy by previous refactoring
llvm-svn: 300218
Craig Topper [Thu, 13 Apr 2017 16:54:25 +0000 (16:54 +0000)]
Revert r300213 "[APSInt] Add a static_assert to ensure APSInt is packed well with APInt after r300171"
MSVC doesn't pack derived classes the same way clang/gcc do.
llvm-svn: 300217
Alex Shlyapnikov [Thu, 13 Apr 2017 16:49:16 +0000 (16:49 +0000)]
Cache size per class size in SizeClassAllocatorXLocalCache.
Summary:
Allocator::ClassIdToSize() is not free and calling it in every
Allocate/Deallocate has noticeable impact on perf.
Reapplying D31991 with the appropriate fixes.
Reviewers: cryptoad
Subscribers: kubamracek, llvm-commits
Differential Revision: https://reviews.llvm.org/D32024
llvm-svn: 300216
Brian Gesiak [Thu, 13 Apr 2017 16:44:25 +0000 (16:44 +0000)]
[Analysis] Support bitreverse in -demanded-bits pass
Summary:
* Add a bitreverse case in the demanded bits analysis pass.
* Add tests for the bitreverse (and bswap) intrinsic in the
demanded bits pass.
* Add a test case to the BDCE tests: that manipulations to
high-order bits are eliminated once the bits are reversed
and then right-shifted.
Reviewers: mkuper, jmolloy, hfinkel, trentxintong
Reviewed By: jmolloy
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31857
llvm-svn: 300215
Reid Kleckner [Thu, 13 Apr 2017 16:36:28 +0000 (16:36 +0000)]
Use the clang-cl recognized spelling of --target=
This fixes a warning. The test was passing without this change.
llvm-svn: 300214
Craig Topper [Thu, 13 Apr 2017 16:34:49 +0000 (16:34 +0000)]
[APSInt] Add a static_assert to ensure APSInt is packed well with APInt after r300171.
llvm-svn: 300213