Francis Ricci [Tue, 16 Aug 2016 02:15:51 +0000 (02:15 +0000)]
[compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration
Summary: This will allow for the sanitizers to be used when c++ abi is unavailable.
Reviewers: samsonov, beanz, pcc, rnk
Subscribers: llvm-commits, kubabrecka, compnerd, dberris
Differential Revision: https://reviews.llvm.org/D23376
llvm-svn: 278772
Petr Hosek [Tue, 16 Aug 2016 01:11:16 +0000 (01:11 +0000)]
[ELF] Linkerscript: support hidden symbols assignments
This add support for HIDDEN command which can be used to define
a symbol that will be hidden and won't be exported.
Differential Revision: https://reviews.llvm.org/D23534
llvm-svn: 278770
Francis Ricci [Tue, 16 Aug 2016 01:11:07 +0000 (01:11 +0000)]
Revert "[compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration"
This reverts commit
9528d86531b1289600e18c407b8e992d7fedb94f.
llvm-svn: 278769
Sanjay Patel [Tue, 16 Aug 2016 00:48:38 +0000 (00:48 +0000)]
[InstCombine] add tests for missing vector icmp folds
llvm-svn: 278768
Justin Lebar [Tue, 16 Aug 2016 00:48:21 +0000 (00:48 +0000)]
[CUDA] Fix "declared here" note on deferred wrong-side errors.
Previously we weren't deferring these "declared here" notes, which is
obviously wrong.
llvm-svn: 278767
Mehdi Amini [Tue, 16 Aug 2016 00:44:46 +0000 (00:44 +0000)]
[LTO] Rename variables with meaningul names, i.e. more than one character (NFC)
llvm-svn: 278766
Sanjay Patel [Tue, 16 Aug 2016 00:27:12 +0000 (00:27 +0000)]
[InstCombine] add tests for missing vector icmp folds
llvm-svn: 278765
Francis Ricci [Tue, 16 Aug 2016 00:16:47 +0000 (00:16 +0000)]
[compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration
Summary: This will allow for the sanitizers to be used when c++ abi is unavailable.
Reviewers: samsonov, beanz, pcc, rnk
Subscribers: llvm-commits, kubabrecka, compnerd, dberris
Differential Revision: https://reviews.llvm.org/D23376
llvm-svn: 278764
Richard Smith [Tue, 16 Aug 2016 00:13:47 +0000 (00:13 +0000)]
PR28978: If we need overload resolution for the move constructor of an
anonymous union member of a class, we need overload resolution for the move
constructor of the class itself too; we can't rely on Sema to do the right
thing for us for anonymous union types.
llvm-svn: 278763
Reid Kleckner [Mon, 15 Aug 2016 23:54:44 +0000 (23:54 +0000)]
[AMDGPU] Give enum an explicit 64-bit type to fix MSVC 2013 failures
Recall that MSVC always gives enums the type 'int', nothing else. MSVC
2015 does not appear to have this problem anymore.
Clang-cl -Wmicrosoft-enum-value flags this, FWIW, so now I have a true
positive for my warning. :)
llvm-svn: 278762
Teresa Johnson [Mon, 15 Aug 2016 23:24:57 +0000 (23:24 +0000)]
[ThinLTO] Fix temp file dumping, enable via llvm-lto and test it
Summary:
Fixed a bug in ThinLTOCodeGenerator's temp file dumping. The Twine
needs to be passed directly as an argument, or a copy saved into a
std::string.
It doesn't seem there are any consumers of this, so I added a new option
to llvm-lto to enable saving of temp files during ThinLTO, and augmented
a test to use it to check post-import but pre-opt bitcode.
Reviewers: mehdi_amini
Subscribers: llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D23525
llvm-svn: 278761
Kirill Bobyrev [Mon, 15 Aug 2016 23:20:05 +0000 (23:20 +0000)]
[clang-rename] cleanup `auto` usages
As Alexander pointed out, LLVM Coding Standards are more conservative about
using auto, i.e. it should be used in the following situations:
* When the type is obvious, i.e. explicitly mentioned in the same expression.
For example `if (const clang::FieldDecl *FieldDecl = Initializer->getMember())`.
* When the type is totally non-obvious and one iterates over something. For
example
`for (const auto &CurrDecl : Context.getTranslationUnitDecl()->decls())`.
Otherwise the type should be explicitly stated.
Reviewers: alexfh
Differential Revision: https://reviews.llvm.org/D23397
llvm-svn: 278760
Justin Lebar [Mon, 15 Aug 2016 23:00:49 +0000 (23:00 +0000)]
[CUDA] Raise an error if a wrong-side call is codegen'ed.
Summary:
Some function calls in CUDA are allowed to appear in
semantically-correct programs but are an error if they're ever
codegen'ed. Specifically, a host+device function may call a host
function, but it's an error if such a function is ever codegen'ed in
device mode (and vice versa).
Previously, clang made no attempt to catch these errors. For the most
part, they would be caught by ptxas, and reported as "call to unknown
function 'foo'".
Now we catch these errors and report them the same as we report other
illegal calls (e.g. a call from a host function to a device function).
This has a small change in error-message behavior for calls that were
previously disallowed (e.g. calls from a host to a device function).
Previously, we'd catch disallowed calls fairly early, before doing
additional semantic checking e.g. of the call's arguments. Now we catch
these illegal calls at the very end of our semantic checks, so we'll
only emit a "illegal CUDA call" error if the call is otherwise
well-formed.
Reviewers: tra, rnk
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D23242
llvm-svn: 278759
Reid Kleckner [Mon, 15 Aug 2016 22:54:26 +0000 (22:54 +0000)]
Don't use %llc_dwarf with -mtriple, they don't combine
llvm-svn: 278758
Sanjay Patel [Mon, 15 Aug 2016 22:43:52 +0000 (22:43 +0000)]
[InstCombine] add tests for missing vector icmp folds
llvm-svn: 278757
Justin Bogner [Mon, 15 Aug 2016 22:41:42 +0000 (22:41 +0000)]
Linker: Avoid some ridiculous indentation by using a temporary. NFC
This was indented really awkwardly, and clang-format didn't seem to
know how to do any better. Avoid the issue with a temporary variable.
llvm-svn: 278756
Wolfgang Pieb [Mon, 15 Aug 2016 22:39:39 +0000 (22:39 +0000)]
Adding the triple for test comitted with r278703.
llvm-svn: 278755
Mike Aizatsky [Mon, 15 Aug 2016 22:30:37 +0000 (22:30 +0000)]
[sancov] extracting AArch64 test to a separate file.
llvm-svn: 278754
Tim Shen [Mon, 15 Aug 2016 22:07:30 +0000 (22:07 +0000)]
[ADT] Fix DepthFirstIterator's std::iterator base to have normal typedefs
Summary: This is similiar to r278752, where I found that the std::iterator<...> base can be normal.
Reviewers: dblaikie
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D23527
llvm-svn: 278753
Tim Shen [Mon, 15 Aug 2016 21:52:54 +0000 (21:52 +0000)]
[ADT] Change PostOrderIterator to use NodeRef. NFC.
Reviewers: dblaikie
Subscribers: mzolotukhin, llvm-commits
Differential Revision: https://reviews.llvm.org/D23522
llvm-svn: 278752
Sanjay Patel [Mon, 15 Aug 2016 21:47:50 +0000 (21:47 +0000)]
[InstCombine] add tests for missing vector icmp folds
llvm-svn: 278751
Eli Friedman [Mon, 15 Aug 2016 21:46:19 +0000 (21:46 +0000)]
Fix typo in lowering for fp128 ueq.
Regression from r259791.
Differential Revision: https://reviews.llvm.org/D23374
llvm-svn: 278750
Jan Vesely [Mon, 15 Aug 2016 21:38:30 +0000 (21:38 +0000)]
AMDGPU/R600: Convert buffer id to VTX_READ input
Use patterns instead of multiple instructions
Add buffer id to asm string
https://reviews.llvm.org/D22650
llvm-svn: 278749
Hemant Kulkarni [Mon, 15 Aug 2016 21:38:23 +0000 (21:38 +0000)]
Really fix the issue with
502957cc9cf805dc6093950e8cdcd0db4969d933. Windows %p and FileCheck limitations makes the test linux only
llvm-svn: 278748
Sanjay Patel [Mon, 15 Aug 2016 21:37:24 +0000 (21:37 +0000)]
[InstCombine] add tests for missing vector icmp folds
llvm-svn: 278747
Tim Shen [Mon, 15 Aug 2016 21:27:56 +0000 (21:27 +0000)]
[ADT] Change PostOrderIterator to use NodeRef. NFC.
Summary: Corresponding LLVM change: D23522
Reviewers: dblaikie
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D23523
llvm-svn: 278746
Adhemerval Zanella [Mon, 15 Aug 2016 21:24:50 +0000 (21:24 +0000)]
libcxx: Fix path.compare.pass expected result
The expected 'filesystem::path::compare' result states that for different
path only result sign contains the information about passed arguments
(not its integer value). This is due it uses the output of other compare
functions (basic_string_view and char_traits) without further handling and
char_traits uses memcmp for final buffer comparison.
However for GLIBC on AArch64 the code:
int ret = memcmp ("b/a/c", "a/b/c", 1);
Results in '64' where for x86_64 it results in '1'.
This patch fixes the expected 'filesystem::path::compare' by normalizing
all the results before assert comparison.
llvm-svn: 278745
Tim Northover [Mon, 15 Aug 2016 21:13:17 +0000 (21:13 +0000)]
GlobalISel: support loads and stores of strange types.
Before we mischaracterized structs and i1 types as a scalar with size 0 in
various ways.
llvm-svn: 278744
Teresa Johnson [Mon, 15 Aug 2016 21:07:57 +0000 (21:07 +0000)]
Remove unnecessary flag from new test
Remove -disable-inlining flag that snuck into the test I added for r278739.
It doesn't have an effect in ThinLTO mode (something that should be fixed),
but in any case the checks depend on inlining currently.
llvm-svn: 278743
Manman Ren [Mon, 15 Aug 2016 21:05:00 +0000 (21:05 +0000)]
Objective-C diagnostics: isObjCNSObjectType should check through AttributedType.
For the following example:
typedef __attribute__((NSObject)) CGColorRef ColorAttrRef;
@property (strong, nullable) ColorAttrRef color;
The property type should be ObjC NSObject type and the compiler should not emit
error: property with 'retain (or strong)' attribute must be of object type
rdar://problem/
27747154
llvm-svn: 278742
Sanjay Patel [Mon, 15 Aug 2016 21:02:25 +0000 (21:02 +0000)]
update tests to use FileCheck and exact checking
llvm-svn: 278741
Sanjoy Das [Mon, 15 Aug 2016 21:01:31 +0000 (21:01 +0000)]
Revert "[ValueTracking] Improve ValueTracking on left shift with nsw flag"
This reverts commit r278172. It causes PR28946.
llvm-svn: 278740
Teresa Johnson [Mon, 15 Aug 2016 21:00:04 +0000 (21:00 +0000)]
[ThinLTO] Remove functions resolved to available_externally from comdats
Summary:
thinLTOResolveWeakForLinkerModule needs to drop any preempted weak symbols
that were converted to available_externally from comdats, otherwise we
will get a verification failure (since available_externally is a
declaration for the linker, and no declarations can be in a comdat).
Reviewers: mehdi_amini
Subscribers: llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D23015
llvm-svn: 278739
Tobias Grosser [Mon, 15 Aug 2016 20:59:30 +0000 (20:59 +0000)]
[ScopDetect] Do not assert in case of AddRecs with non-constant start expression
llvm-svn: 278738
Sanjay Patel [Mon, 15 Aug 2016 20:56:11 +0000 (20:56 +0000)]
[InstCombine] add tests for missing vector icmp folds
llvm-svn: 278737
Eric Fiselier [Mon, 15 Aug 2016 20:50:01 +0000 (20:50 +0000)]
Fix new ASAN failures
llvm-svn: 278736
Justin Lebar [Mon, 15 Aug 2016 20:38:56 +0000 (20:38 +0000)]
Add the notion of deferred diagnostics.
Summary:
This patch lets you create diagnostics that are emitted if and only if a
particular FunctionDecl is codegen'ed.
This is necessary for CUDA, where some constructs -- e.g. calls from
host+device functions to host functions when compiling for device -- are
allowed to appear in semantically-correct programs, but only if they're
never codegen'ed.
Reviewers: rnk
Subscribers: cfe-commits, tra
Differential Revision: https://reviews.llvm.org/D23241
llvm-svn: 278735
Justin Lebar [Mon, 15 Aug 2016 20:38:52 +0000 (20:38 +0000)]
[CUDA] Include CUDA headers before anything else.
Summary:
There's no point to --cuda-path if we then go and include /usr/include
first. And if you install the right packages, Ubuntu will install (very
old) CUDA headers there.
Reviewers: tra
Subscribers: cfe-commits, Prazek
Differential Revision: https://reviews.llvm.org/D23341
llvm-svn: 278734
Justin Lebar [Mon, 15 Aug 2016 20:38:48 +0000 (20:38 +0000)]
[CUDA] Fix CUDA install version parsing.
Summary:
getAsInteger returns true on error. Oops.
No test because the behavior at the moment is identical with or without
this change.
Reviewers: tra
Subscribers: cfe-commits, Prazek
Differential Revision: https://reviews.llvm.org/D23340
llvm-svn: 278733
Hemant Kulkarni [Mon, 15 Aug 2016 20:36:16 +0000 (20:36 +0000)]
Fix a test that failed due to:
https://llvm.org/svn/llvm-project/llvm/trunk@278725
91177308-0d34-0410-b5e6-
96231b3b80d8
llvm-svn: 278732
David L Kreitzer [Mon, 15 Aug 2016 20:21:41 +0000 (20:21 +0000)]
Enhance SCEV to compute the trip count for some loops with unknown stride.
Patch by Pankaj Chawla
Differential Revision: https://reviews.llvm.org/D22377
llvm-svn: 278731
Saleem Abdulrasool [Mon, 15 Aug 2016 20:16:13 +0000 (20:16 +0000)]
StaticAnalyzer: Report found fields order in PaddingChecker
Report the found fields order in PaddingChecker.
Patch by Alexander Shaposhnikov!
llvm-svn: 278730
Chris Bieneman [Mon, 15 Aug 2016 20:15:22 +0000 (20:15 +0000)]
[CMake] Apple stage1 doesn't need to set libcxx options
LibCXX settings are configured in stage2 so we don't need them here.
llvm-svn: 278729
Chris Bieneman [Mon, 15 Aug 2016 20:12:43 +0000 (20:12 +0000)]
[CMake] Renaming test variable to be consistent
Based on post-commit review by compnerd.
llvm-svn: 278728
Sanjay Patel [Mon, 15 Aug 2016 20:02:40 +0000 (20:02 +0000)]
[InstCombine] add test for missing vector icmp fold
llvm-svn: 278727
Sanjay Patel [Mon, 15 Aug 2016 19:58:21 +0000 (19:58 +0000)]
[InstCombine] add tests for vector icmp folds
llvm-svn: 278726
Hemant Kulkarni [Mon, 15 Aug 2016 19:49:24 +0000 (19:49 +0000)]
llvm-objdump: Implement source[line numbers] interleaving
Differential Revsion: https://reviews.llvm.org/D22932
llvm-svn: 278725
Kostya Serebryany [Mon, 15 Aug 2016 19:44:04 +0000 (19:44 +0000)]
[libFuzzer] print a verbose message after executing inputs in non-fuzzing mode
llvm-svn: 278724
Eric Fiselier [Mon, 15 Aug 2016 19:37:20 +0000 (19:37 +0000)]
Use -O1 when testing with ASAN and MSAN to prevent Clang OOM errors.
Currently certain tests get killed when compiled with ASAN at -O0 because
they eat all of the systems memory. This doesn't happen at -O1, so enable that
to work around the issue.
llvm-svn: 278722
Kostya Serebryany [Mon, 15 Aug 2016 19:36:13 +0000 (19:36 +0000)]
[libFuzzer] fix the bot
llvm-svn: 278721
Filipe Cabecinhas [Mon, 15 Aug 2016 19:30:21 +0000 (19:30 +0000)]
Split DescribeAddressIfShadow between a function that gets all the information, and one that prints it.
Summary:
Replacement for part of D23518
This is the first patch to start reifying information about errors. It deals only with reifying shadow address-related information.
It will allow us to generate structures with all the relevant information for a given error so a debugger can get to them or they can be included in a core dump.
Reviewers: kcc, samsonov
Subscribers: kubabrecka, llvm-commits
Differential Revision: https://reviews.llvm.org/D23519
llvm-svn: 278718
Sanjay Patel [Mon, 15 Aug 2016 19:16:33 +0000 (19:16 +0000)]
[InstCombine] add tests for missing vector icmp folds
llvm-svn: 278717
Eric Fiselier [Mon, 15 Aug 2016 18:58:57 +0000 (18:58 +0000)]
Fix PR28506. Re-enable missing math.h C++11 decls on SunOS. Patch from Michal Gorny.
llvm-svn: 278716
Daniel Sanders [Mon, 15 Aug 2016 18:56:54 +0000 (18:56 +0000)]
[msan] Correct @LINE expression in obstack.cc
Summary:
[[@LINE-30]] only worked because the resulting 3 matches the first character of
30. With the additional blank lines the resulting 5 no longer matches 30.
Reviewers: eugenis
Subscribers: eugenis, llvm-commits
Differential Revision: https://reviews.llvm.org/D23515
llvm-svn: 278715
Sanjay Patel [Mon, 15 Aug 2016 18:56:10 +0000 (18:56 +0000)]
update test to use FileCheck and autogenerated checks
llvm-svn: 278714
Reid Kleckner [Mon, 15 Aug 2016 18:51:42 +0000 (18:51 +0000)]
Fix WAsm test after LSR change in r278658
Now the increment is done in a different location
llvm-svn: 278713
Daniel Sanders [Mon, 15 Aug 2016 18:50:36 +0000 (18:50 +0000)]
[msan] Fix line number sensitivity in chained_origin.cc and chained_origin_memcpy.cc
Reviewers: eugenis
Subscribers: eugenis, llvm-commits
Differential Revision: https://reviews.llvm.org/D23512
llvm-svn: 278712
Matthias Braun [Mon, 15 Aug 2016 18:50:13 +0000 (18:50 +0000)]
Revert "[Thumb] Validate branch target for CBZ/CBNZ instructions."
This currently breaks the greendragon clang-stage1-configure-RA/ and
brotli. It is probably just uncovering a pre-existing problem. Reverting
temporarily to get the buildbots green again. A reduced testcase will
follow shortly.
This reverts commit r278659.
llvm-svn: 278711
Paul Robinson [Mon, 15 Aug 2016 18:45:52 +0000 (18:45 +0000)]
Replace an obsolete company name.
llvm-svn: 278710
Sanjay Patel [Mon, 15 Aug 2016 18:45:10 +0000 (18:45 +0000)]
[InstCombine] add tests for missing vector icmp folds
llvm-svn: 278709
Sanjay Patel [Mon, 15 Aug 2016 18:39:54 +0000 (18:39 +0000)]
[InstCombine] add test for missing vector icmp fold
llvm-svn: 278708
Sanjay Patel [Mon, 15 Aug 2016 18:35:44 +0000 (18:35 +0000)]
minimize test
llvm-svn: 278707
Evgeniy Stepanov [Mon, 15 Aug 2016 18:35:40 +0000 (18:35 +0000)]
[ubsan] Initialize Android logging.
This adds standalone ubsan output to "adb logcat", the same as ASan does.
llvm-svn: 278706
Sanjay Patel [Mon, 15 Aug 2016 18:32:50 +0000 (18:32 +0000)]
remove unnecessary IR comments about uses
llvm-svn: 278705
Sanjay Patel [Mon, 15 Aug 2016 18:26:56 +0000 (18:26 +0000)]
[InstCombine] add tests for missing vector icmp folds
llvm-svn: 278704
Wolfgang Pieb [Mon, 15 Aug 2016 18:18:26 +0000 (18:18 +0000)]
Local variables whose address is taken and passed on to a call are described
in debug info using their stack slots instead of as an indirection of param reg + 0
offset. This is done by detecting FrameIndexSDNodes in SelectionDAG and generating
FrameIndexDbgValues for them. This ultimately generates DBG_VALUEs with stack
location operands.
Differential Revision: http://reviews.llvm.org/D23283
llvm-svn: 278703
Sanjay Patel [Mon, 15 Aug 2016 17:55:39 +0000 (17:55 +0000)]
[InstCombine] add tests for missing vector icmp folds
llvm-svn: 278689
Kostya Serebryany [Mon, 15 Aug 2016 17:48:28 +0000 (17:48 +0000)]
[libFuzzer] add InsertRepeatedBytes and EraseBytes.
New mutation: InsertRepeatedBytes.
Updated mutation: EraseByte => EraseBytes.
This helps https://github.com/google/sanitizers/issues/710
where libFuzzer was not able to find a known bug.
Now it finds it in minutes.
Hopefully, the change is general enough to help other targets.
llvm-svn: 278687
Eugene Zelenko [Mon, 15 Aug 2016 17:44:29 +0000 (17:44 +0000)]
[Documentation] Improve checks groups descriptions in clang-tidy/index.rst
Use table to avoid tautology. List all existing checks groups. Use alphabetical order.
Differential revision: https://reviews.llvm.org/D23471
llvm-svn: 278686
Sanjay Patel [Mon, 15 Aug 2016 17:19:07 +0000 (17:19 +0000)]
[InstCombine] auto-generate exact checks
Note that several of these tests belong in InstSimplify rather than
InstCombine because they return existing operands or constants.
llvm-svn: 278684
Sanjay Patel [Mon, 15 Aug 2016 17:10:35 +0000 (17:10 +0000)]
[InstCombine] add tests for missing vector icmp folds
llvm-svn: 278683
Yaxun Liu [Mon, 15 Aug 2016 16:54:25 +0000 (16:54 +0000)]
AMDGPU: Update AMDGPURuntimeMetadata.h for enums of address space qualifiers
llvm-svn: 278682
Tobias Grosser [Mon, 15 Aug 2016 16:43:36 +0000 (16:43 +0000)]
Disable invariant load hoisting temporarily
With invariant load hoisting enabled the LLVM buildbots currently show some
miscompiles, which are possibly caused by invariant load hosting itself.
Confirming and fixing this requires a more in-depth analysis. To meanwhile get
back green buildbots that allow us to observe other regressions, we disable
invariant code hoisting temporarily. The relevant bug is tracked at:
http://llvm.org/PR28985
llvm-svn: 278681
Tobias Grosser [Mon, 15 Aug 2016 16:43:33 +0000 (16:43 +0000)]
[test] Force invariant load hoisting one last time
Without invariant load hoisting an (unrelated) bug is exposed in this test
case: http://llvm.org/PR28984
llvm-svn: 278680
Matt Arsenault [Mon, 15 Aug 2016 16:18:36 +0000 (16:18 +0000)]
AMDGPU: Don't fold subregister extracts into tied operands
llvm-svn: 278676
Tobias Grosser [Mon, 15 Aug 2016 15:56:24 +0000 (15:56 +0000)]
[tests] Force invariant load hoisting for test cases that need it -- III
llvm-svn: 278673
Reid Kleckner [Mon, 15 Aug 2016 15:42:31 +0000 (15:42 +0000)]
Revert "[SimplifyCFG] Rewrite SinkThenElseCodeToEnd"
This reverts commit r278660.
It causes downstream assertion failure in InstCombine on shuffle
instructions. Comes up in __mm_swizzle_epi32.
llvm-svn: 278672
Daniel Sanders [Mon, 15 Aug 2016 15:14:08 +0000 (15:14 +0000)]
[mips] XFAIL mips64el tests that fail on clang-cmake-mipsel
These tests were recently enabled and have never worked on this builder.
Three tests were sensitive to line number changes:
test/msan/Linux/obstack.cc
test/msan/chained_origin.cc
test/msan/chained_origin_memcpy.cc
and this sensitivity will be addressed in a follow-up patch. Of these,
obstack.cc's sensitivity to line numbers is unexplained since it already uses
[[@LINE]].
llvm-svn: 278671
Pavel Labath [Mon, 15 Aug 2016 14:32:32 +0000 (14:32 +0000)]
Fix expression evaluation with operator new
Summary:
referencing a user-defined operator new was triggering an assert in clang because we were
registering the function name as string "operator new", instead of using the special operator
enum, which clang has for this purpose. Method operators already had code to handle this, and now
I extend this to cover free standing operator functions as well. Test included.
Reviewers: spyffe
Subscribers: sivachandra, paulherman, lldb-commits
Differential Revision: http://reviews.llvm.org/D17856
llvm-svn: 278670
Tobias Grosser [Mon, 15 Aug 2016 13:58:16 +0000 (13:58 +0000)]
[tests] Force invariant load hoisting for test cases that need it II
llvm-svn: 278669
Tobias Grosser [Mon, 15 Aug 2016 13:58:04 +0000 (13:58 +0000)]
[test] Correct spelling in test case
and explicitly enable invariant load hoisting for this test case.
llvm-svn: 278668
Tobias Grosser [Mon, 15 Aug 2016 13:27:49 +0000 (13:27 +0000)]
[tests] Force invariant load hoisting for test cases that need it
This will make it easier to switch the default of Polly's invariant load
hoisting strategy and also makes it very clear that these test cases
indeed require invariant code hoisting to work.
llvm-svn: 278667
Roman Gareev [Mon, 15 Aug 2016 12:22:54 +0000 (12:22 +0000)]
Perform replacement of access relations and creation of new arrays according to the packing transformation
This is the third patch to apply the BLIS matmul optimization pattern on matmul
kernels (http://www.cs.utexas.edu/users/flame/pubs/TOMS-BLIS-Analytical.pdf).
BLIS implements gemm as three nested loops around a macro-kernel, plus two
packing routines. The macro-kernel is implemented in terms of two additional
loops around a micro-kernel. The micro-kernel is a loop around a rank-1
(i.e., outer product) update. In this change we perform replacement of
the access relations and create empty arrays, which are steps to implement
the packing transformation. In subsequent changes we will implement copying
to created arrays.
Reviewed-by: Tobias Grosser <tobias@grosser.es>
Differential Revision: http://reviews.llvm.org/D22187
llvm-svn: 278666
Valery Pykhtin [Mon, 15 Aug 2016 10:56:48 +0000 (10:56 +0000)]
[AMDGPU] fix failure on printing of non-existing instruction operands.
Differential revision: https://reviews.llvm.org/D23323
llvm-svn: 278665
Pavel Labath [Mon, 15 Aug 2016 09:53:08 +0000 (09:53 +0000)]
Fix a race in Broadcaster/Listener interaction
Summary:
The following problem was occuring:
- broadcaster B had two listeners: L1 and L2 (thread T1)
- (T1) B has started to broadcast an event, it has locked a shared_ptr to L1 (in
ListenerIterator())
- on another thread T2 the penultimate reference to L1 was destroyed (the transient object in B is
now the last reference)
- (T2) the last reference to L2 was destroyed as well
- (T1) B has finished broadcasting the event to L1 and destroyed the last shared_ptr
- (T1) this triggered the destructor, which called into B->RemoveListener()
- (T1) all pointers in the m_listeners list were now stale, so RemoveListener emptied the list
- (T1) Eventually control returned to the ListenerIterator() for doing broadcasting, which was
still in the middle of iterating through the list
- (T1) Only now, it was holding onto a dangling iterator. BOOM.
I fix this issue by making sure nothing can interfere with the
iterate-and-remove-expired-pointers loop, by moving this logic into a single function, which
first locks (or clears) the whole list and then returns the list of valid and locked Listeners
for further processing. Instead of std::list I use an llvm::SmallVector which should hopefully
offset the fact that we create a copy of the list for the common case where we have only a few
listeners (no heap allocations).
A slight difference in behaviour is that now RemoveListener does not remove an element from the
list -- it only sets it's mask to 0, which means it will be removed during the next iteration of
GetListeners(). This is purely an implementation detail and it should not be externally
noticable.
I was not able to reproduce this bug reliably without inserting sleep statements into the code,
so I do not add a test for it. Instead, I add some unit tests for the functions that I do modify.
Reviewers: clayborg, jingham
Subscribers: tberghammer, lldb-commits
Differential Revision: https://reviews.llvm.org/D23406
llvm-svn: 278664
Eugene Leviant [Mon, 15 Aug 2016 09:19:51 +0000 (09:19 +0000)]
[ELF] Linkerscript: fix bug in assignOffsets (check Sym for non-null)
llvm-svn: 278663
Pavel Labath [Mon, 15 Aug 2016 09:17:13 +0000 (09:17 +0000)]
Fixup r278524 for non-apple targets
The commit started passing a nullptr port into GDBRemoteCommunication::StartDebugserverProcess.
The function was mostly handling the null value correctly, but it one case it did not check it's
value before assigning to it. Fix that.
llvm-svn: 278662
Sjoerd Meijer [Mon, 15 Aug 2016 08:22:42 +0000 (08:22 +0000)]
MachineLoop: add methods findLoopControlBlock and findLoopPreheader
This adds two new utility functions findLoopControlBlock and findLoopPreheader
to MachineLoop and MachineLoopInfo. These functions are refactored and taken
from the Hexagon target as they are target independent; thus this is intendend to
be a non-functional change.
Differential Revision: https://reviews.llvm.org/D22959
llvm-svn: 278661
James Molloy [Mon, 15 Aug 2016 08:04:56 +0000 (08:04 +0000)]
[SimplifyCFG] Rewrite SinkThenElseCodeToEnd
The new version has several advantages:
1) IMSHO it's more readable and neater
2) It handles loads and stores properly
3) It can handle any number of incoming blocks rather than just two. I'll be taking advantage of this in a followup patch.
With this change we can now finally sink load-modify-store idioms such as:
if (a)
return *b += 3;
else
return *b += 4;
=>
%z = load i32, i32* %y
%.sink = select i1 %a, i32 5, i32 7
%b = add i32 %z, %.sink
store i32 %b, i32* %y
ret i32 %b
When this works for switches it'll be even more powerful.
llvm-svn: 278660
Prakhar Bahuguna [Mon, 15 Aug 2016 07:57:44 +0000 (07:57 +0000)]
[Thumb] Validate branch target for CBZ/CBNZ instructions.
Summary:
The assembler currently does not check the branch target for CBZ/CBNZ
instructions, which only permit branching forwards with a positive offset. This
adds validation for the branch target to ensure negative PC-relative offsets are
not encoded into the instruction, whether specified as a literal or as an
assembler symbol.
Reviewers: rengolin, t.p.northover
Subscribers: llvm-commits, rengolin
Differential Revision: https://reviews.llvm.org/D23312
llvm-svn: 278659
James Molloy [Mon, 15 Aug 2016 07:53:03 +0000 (07:53 +0000)]
[LSR] Don't try and create post-inc expressions on non-rotated loops
If a loop is not rotated (for example when optimizing for size), the latch is not the backedge. If we promote an expression to post-inc form, we not only increase register pressure and add a COPY for that IV expression but for all IVs!
Motivating testcase:
void f(float *a, float *b, float *c, int n) {
while (n-- > 0)
*c++ = *a++ + *b++;
}
It's imperative that the pointer increments be located in the latch block and not the header block; if not, we cannot use post-increment loads and stores and we have to keep both the post-inc and pre-inc values around until the end of the latch which bloats register usage.
llvm-svn: 278658
Eugene Leviant [Mon, 15 Aug 2016 07:24:20 +0000 (07:24 +0000)]
[ELF] Do not add start and end symbols in case they are already defined
llvm-svn: 278657
David Majnemer [Mon, 15 Aug 2016 07:20:40 +0000 (07:20 +0000)]
[CodeGen] Ignore unnamed bitfields before handling vector fields
We processed unnamed bitfields after our logic for non-vector field
elements in records larger than 128 bits. The vector logic would
determine that the bit-field disqualifies the record from occupying a
register despite the unnamed bit-field not participating in the record
size nor its alignment.
N.B. This behavior matches GCC and ICC.
llvm-svn: 278656
David Majnemer [Mon, 15 Aug 2016 06:39:18 +0000 (06:39 +0000)]
[CodeGen] Correctly implement the AVX512 psABI rules
An __m512 vector type wrapped in a structure should be passed in a
vector register.
Our prior implementation was based on a draft version of the psABI.
This fixes PR28975.
N.B. The update to the ABI was made here:
https://github.com/hjl-tools/x86-psABI/commit/30f9c9
llvm-svn: 278655
Craig Topper [Mon, 15 Aug 2016 06:31:57 +0000 (06:31 +0000)]
[X86] PADDUSB/W instructions should be commutable.
llvm-svn: 278654
Craig Topper [Mon, 15 Aug 2016 04:47:30 +0000 (04:47 +0000)]
[X86] Mark some of the X86 SDNodes as commutative.
llvm-svn: 278653
Craig Topper [Mon, 15 Aug 2016 04:47:28 +0000 (04:47 +0000)]
[X86] X86ISD::FANDN is not commutative or associative.
llvm-svn: 278652
David Majnemer [Mon, 15 Aug 2016 03:56:06 +0000 (03:56 +0000)]
[ScopedNoAliasAA] collectMDInDomain should be a free function
collectMDInDomain doesn't use any class members, making it a free
function is not a functional change.
llvm-svn: 278651
Richard Smith [Mon, 15 Aug 2016 02:47:23 +0000 (02:47 +0000)]
cxx_status: update features implemented in clang 3.9 from "svn" to "Clang 3.9" now that svn trunk is 4.0.
llvm-svn: 278650
Richard Smith [Mon, 15 Aug 2016 02:37:43 +0000 (02:37 +0000)]
cxx_status: mark decomposition declarations as "partial": the implementation is
essentially complete, other than parts where design questions have been raised
(lambda capture, decomposition of arrays by copy).
llvm-svn: 278649