OSDN Git Service
Andrea Di Biagio [Wed, 14 Sep 2016 14:18:21 +0000 (14:18 +0000)]
[InstCombine] Merged two test files and regenerated checks using update_test_checks.py. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281478
91177308-0d34-0410-b5e6-
96231b3b80d8
Silviu Baranga [Wed, 14 Sep 2016 14:09:43 +0000 (14:09 +0000)]
[StackProtector] Use INITIALIZE_TM_PASS instead of INITIALIZE_PASS
in order to make sure that its TargetMachine constructor is
registered.
This allows us to run the PEI machine pass with MIR input
(see PR30324).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281474
91177308-0d34-0410-b5e6-
96231b3b80d8
Nemanja Ivanovic [Wed, 14 Sep 2016 14:09:39 +0000 (14:09 +0000)]
Adding missing directive for Power9.
There is currently no codegen for Power9 that depends on the directive
so this is NFC for now but will be important in the future. This was
missed in r268950 so I'm adding it now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281473
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 14 Sep 2016 14:08:18 +0000 (14:08 +0000)]
[X86][SSE] Don't blend vector shifts with MOVSS/MOVSD directly, lower from generic shuffle
Shuffle lowering will correctly lower to MOVSS/MOVSD/PBLEND, improving commutation opportunities
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281471
91177308-0d34-0410-b5e6-
96231b3b80d8
Kuba Brecka [Wed, 14 Sep 2016 14:06:33 +0000 (14:06 +0000)]
[asan] Enable -asan-use-private-alias on Darwin/Mach-O, add test for ODR false positive with LTO (llvm part)
The '-asan-use-private-alias’ option (disabled by default) option is currently only enabled for Linux and ELF, but it also works on Darwin and Mach-O. This option also fixes a known problem with LTO on Darwin (https://github.com/google/sanitizers/issues/647). This patch enables the support for Darwin (but still keeps it off by default) and adds the LTO test case.
Differential Revision: https://reviews.llvm.org/D24292
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281470
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Wed, 14 Sep 2016 09:45:28 +0000 (09:45 +0000)]
Revert "[Thumb] Teach ISel how to lower compares of AND bitmasks efficiently"
This reverts commit r281323. It caused chromium test failures and a selfhost failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281451
91177308-0d34-0410-b5e6-
96231b3b80d8
Vassil Vassilev [Wed, 14 Sep 2016 08:55:18 +0000 (08:55 +0000)]
Missing includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281450
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Wed, 14 Sep 2016 08:28:54 +0000 (08:28 +0000)]
GlobalISel: mark pointer stores as legal on AArch64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281448
91177308-0d34-0410-b5e6-
96231b3b80d8
Sjoerd Meijer [Wed, 14 Sep 2016 08:20:03 +0000 (08:20 +0000)]
This reapplies r281304. The issue was that I had missed
to copy the new isAdd field in the tablegen data structure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281447
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Wed, 14 Sep 2016 08:06:54 +0000 (08:06 +0000)]
AVX-512: Fixed a bug in kortest.z intrinsic
Lowering was wrong - X86ISD::SETCC node should return i8 type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281446
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Breger [Wed, 14 Sep 2016 08:04:28 +0000 (08:04 +0000)]
[AVX512BW] Change truncStore action (v16i16->v16i18). It can be legal only with AVX512VL.
Differential Revision: http://reviews.llvm.org/D24547
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281445
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 14 Sep 2016 06:27:46 +0000 (06:27 +0000)]
[X86] Remove the VCVTSI2SD32 with rounding intrinsic. It's not used by clang and not needed since 32-bit integer to double is always exact.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281442
91177308-0d34-0410-b5e6-
96231b3b80d8
Wei Mi [Wed, 14 Sep 2016 04:39:50 +0000 (04:39 +0000)]
Create a getelementptr instead of sub expr for ValueOffsetPair if the
value is a pointer.
This patch is to fix PR30213. When expanding an expr based on ValueOffsetPair,
if the value is of pointer type, we can only create a getelementptr instead
of sub expr.
Differential Revision: https://reviews.llvm.org/D24088
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281439
91177308-0d34-0410-b5e6-
96231b3b80d8
Tobias Grosser [Wed, 14 Sep 2016 03:09:48 +0000 (03:09 +0000)]
Ensure Polly linking works without BUILD_SHARED_LIBS
This change ensures all necessary symbols are resolved correctly. Before this
change on some systems, the linker may have eliminated some symbols not directly
used in bugpoint, but used in Polly.
Suggested-by: Michael Kruse <lvm@meinersbur.de>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281438
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Wed, 14 Sep 2016 02:55:16 +0000 (02:55 +0000)]
gold: Simplify. Do not unnecessarily enumerate Obj's symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281437
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Wed, 14 Sep 2016 02:13:06 +0000 (02:13 +0000)]
[libFuzzer] start using trace-pc-guard as an alternative source of coverage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281435
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Wed, 14 Sep 2016 01:39:35 +0000 (01:39 +0000)]
[sanitizer-coverage] add yet another flavour of coverage instrumentation: trace-pc-guard. The intent is to eventually replace all of {bool coverage, 8bit-counters, trace-pc} with just this one. LLVM part
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281431
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Tue, 13 Sep 2016 23:53:43 +0000 (23:53 +0000)]
Address Pete's review comment and define OrigArg on its own line.
This is a follow-up to r281419.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281421
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Tue, 13 Sep 2016 23:43:11 +0000 (23:43 +0000)]
[ObjCARC] Traverse chain downwards to replace uses of argument passed to
ObjC library call with call return.
ARC contraction tries to replace uses of an argument passed to an
objective-c library call with the call return value. For example, in the
following IR, it replaces uses of argument %9 and uses of the values
discovered traversing the chain upwards (%7 and %8) with the call return
%10, if they are dominated by the call to @objc_autoreleaseReturnValue.
This transformation enables code-gen to tail-call the call to
@objc_autoreleaseReturnValue, which is necessary to enable auto release
return value optimization.
%7 = tail call i8* @objc_loadWeakRetained(i8** %6)
%8 = bitcast i8* %7 to %0*
%9 = bitcast %0* %8 to i8*
%10 = tail call i8* @objc_autoreleaseReturnValue(i8* %9)
ret %0* %8
Since r276727, llvm started removing redundant bitcasts and as a result
started feeding the following IR to ARC contraction:
%7 = tail call i8* @objc_loadWeakRetained(i8** %6)
%8 = bitcast i8* %7 to %0*
%9 = tail call i8* @objc_autoreleaseReturnValue(i8* %7)
ret %0* %8
ARC contraction no longer does the optimization described above since it
only traverses the chain upwards and fails to recognize that the
function return can be replaced by the call return. This commit changes
ARC contraction to traverse the chain downwards too and replace uses of
bitcasts with the call return.
rdar://problem/
28011339
Differential Revision: https://reviews.llvm.org/D24523
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281419
91177308-0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Tue, 13 Sep 2016 23:00:13 +0000 (23:00 +0000)]
[llvm-cov] Just emit the version number in the index file
Having the version information in every view is distracting, especially
if there are several sub-views.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281414
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Tue, 13 Sep 2016 22:16:40 +0000 (22:16 +0000)]
[AArch64] Simplify patchpoint/stackmap size test (r281301). NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281407
91177308-0d34-0410-b5e6-
96231b3b80d8
Pawel Bylica [Tue, 13 Sep 2016 21:55:41 +0000 (21:55 +0000)]
[CodeGen] Fix invalid shift in mul expansion
Summary: When expanding mul in type legalization make sure the type for shift amount can actually fit the value. This fixes PR30354 https://llvm.org/bugs/show_bug.cgi?id=30354.
Reviewers: hfinkel, majnemer, RKSimon
Subscribers: RKSimon, llvm-commits
Differential Revision: https://reviews.llvm.org/D24478
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281403
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Tue, 13 Sep 2016 21:53:32 +0000 (21:53 +0000)]
[DAG] Allow build-to-shuffle combine to combine builds from two wide vectors.
This allows us to, in some cases, create a vector_shuffle out of a build_vector, when
the inputs to the build are extract_elements from two different vectors, at least one
of which is wider than the output. (E.g. a <8 x i16> being constructed out of
elements from a <16 x i16> and a <8 x i16>).
Differential Revision: https://reviews.llvm.org/D24491
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281402
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Tue, 13 Sep 2016 21:42:28 +0000 (21:42 +0000)]
Next set of additional error checks for invalid Mach-O files for bad load commands
that use the Mach::dyld_info_command type for the load commands that are
currently use in the MachOObjectFile constructor.
This contains the missing checks for LC_DYLD_INFO and
LC_DYLD_INFO_ONLY load commands and the fields for the
Mach::dyld_info_command type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281400
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Tue, 13 Sep 2016 21:16:07 +0000 (21:16 +0000)]
[Hexagon] Better handling of HVX vector lowering
- Expand SELECT_CC and BR_CC for vector types.
- Implement TLI::isShuffleMaskLegal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281397
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 13 Sep 2016 20:36:13 +0000 (20:36 +0000)]
add tests for PR28672
I'm not sure if we actually want to transform all of these in InstCombine yet,
so I'm not labeling these with FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281386
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 13 Sep 2016 19:43:57 +0000 (19:43 +0000)]
Reapply "InstCombine: Reduce trunc (shl x, K) width."
This reapplies r272987 with a fix for infinitely looping
when the truncated value is another shift of a constant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281379
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Tue, 13 Sep 2016 19:27:38 +0000 (19:27 +0000)]
AArch64: Cleanup tailcall CC check, enable swiftcc.
Cleanup/change the code that checks for possible tailcall conventions to
look the same as the one in the X86 target. This makes the distinction
between calling conventions that can guarnatee tailcalls and the ones
that may tailcall more obvious.
- Add Swift to the mayTailCall list
- PreserveMost seemed to be incorrectly part of the guarnteed tail call
list, move it to the mayTailCall list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281376
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 13 Sep 2016 19:15:25 +0000 (19:15 +0000)]
AMDGPU: Remove code I think is dead
As far as I can tell, resolveFrameIndex is supposed to be
called with a legal offset, so inserting an add shouldn't be
necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281372
91177308-0d34-0410-b5e6-
96231b3b80d8
Mike Aizatsky [Tue, 13 Sep 2016 19:04:26 +0000 (19:04 +0000)]
.clang-tidy: correct style name is 'camelBack' not 'lowerCase'.
Summary: clang-tidy doesn't like to complain.
Differential Revision: https://reviews.llvm.org/D24413
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281370
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 13 Sep 2016 19:03:12 +0000 (19:03 +0000)]
AMDGPU: Support commuting a FrameIndex operand
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281369
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthew Simpson [Tue, 13 Sep 2016 19:01:45 +0000 (19:01 +0000)]
[LV] Clean up uniform induction variable analysis (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281368
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Tue, 13 Sep 2016 18:45:13 +0000 (18:45 +0000)]
[LTO] Don't pass SF_Undefined symbols to the IRmover.
This should fix PR 30363.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281366
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 13 Sep 2016 18:40:04 +0000 (18:40 +0000)]
Fix MSVC 2013 build by using our <thread> wrapper header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281365
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 13 Sep 2016 18:33:29 +0000 (18:33 +0000)]
[DAGCombiner] Use APInt directly in (shl (zext (srl x, C)), C) combine range test
To avoid assertion, we must ensure that the inner shift constant is within range before calling ConstantSDNode::getZExtValue(). We already know that the outer shift constant is in range.
Followup to D23007
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281362
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Tue, 13 Sep 2016 18:17:00 +0000 (18:17 +0000)]
Revert r281336 (and r281337), it caused PR30372.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281361
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Katzman [Tue, 13 Sep 2016 17:51:41 +0000 (17:51 +0000)]
[Myriad]: set LeonCASA processor feature
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281359
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 13 Sep 2016 17:34:56 +0000 (17:34 +0000)]
[X86][SSE] Added AVX512F and additional vector truncate test cases
trunc16i16_16i8 is currently commented out due to PR25684
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281356
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 13 Sep 2016 17:15:28 +0000 (17:15 +0000)]
[DAGCombiner] Use APInt directly in (shl (ext (shl x, c1)), c2) combine
Fix failure to detect out of range shift constants leading to assert in ConstantSDNode::getZExtValue()
Followup to D23007
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281354
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 13 Sep 2016 16:39:43 +0000 (16:39 +0000)]
Fix misleading comment for getOrEnforceKnownAlignment
It does not return 0 to indicate failure, and returns the known
alignment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281350
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Tue, 13 Sep 2016 14:50:47 +0000 (14:50 +0000)]
[ConstantFold] Improve the bitcast folding logic for constant vectors.
The constant folder didn't know how to always fold bitcasts of constant integer
vectors. In particular, it was unable to handle the case where a constant vector
had some undef elements, and the resulting (i.e. bitcasted) vector type had more
elements than the original vector type.
Example:
%cast = bitcast <2 x i64><i64 undef, i64 2> to <4 x i32>
On a little endian target, %cast could have been folded to:
<4 x i32><i32 undef, i32 undef, i32 2, i32 0>
This patch improves the folding logic by teaching how to correctly propagate
undef elements in the folded vector.
Differential Revision: https://reviews.llvm.org/D24301
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281343
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 13 Sep 2016 14:41:39 +0000 (14:41 +0000)]
[X86] Regenerated shift combine tests.
Added x86_64 tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281341
91177308-0d34-0410-b5e6-
96231b3b80d8
Vassil Vassilev [Tue, 13 Sep 2016 14:41:35 +0000 (14:41 +0000)]
[modules] Re-enable some previously excluded files.
Our modules support seems to be able to handle them nowadays.
Patch by Cristina Cristescu!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281340
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Tue, 13 Sep 2016 14:36:55 +0000 (14:36 +0000)]
[Hexagon] Clear the flow queue after visiting a single instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281339
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Tue, 13 Sep 2016 13:57:16 +0000 (13:57 +0000)]
Apply Clang-format to MCAsmParser.cpp NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281337
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Tue, 13 Sep 2016 13:55:06 +0000 (13:55 +0000)]
Defer asm errors to post-statement failure
Recommitting after fixing AsmParser Initialization.
Allow errors to be deferred and emitted as part of clean up to simplify
and shorten Assembly parser code. This will allow error messages to be
emitted in helper functions and be modified by the caller which has
better context.
As part of this many minor cleanups to the Parser:
* Unify parser cleanup on error
* Add Workaround for incorrect return values in ParseDirective instances
* Tighten checks on error-signifying return values for parser functions
and fix in-tree TargetParsers to be more consistent with the changes.
* Fix AArch64 test cases checking for spurious error messages that are
now fixed.
These changes should be backwards compatible with current Target Parsers
so long as the error status are correctly returned in appropriate
functions.
Reviewers: rnk, majnemer
Subscribers: aemerson, jyknight, llvm-commits
Differential Revision: https://reviews.llvm.org/D24047
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281336
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 13 Sep 2016 13:30:30 +0000 (13:30 +0000)]
[LoopInterchange] Minor refactor. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281334
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Tue, 13 Sep 2016 13:17:42 +0000 (13:17 +0000)]
[InstSimplify] Add tests to show missed bitcast folding opportunities.
InstSimplify doesn't always know how to fold a bitcast of a constant vector.
In particular, the logic in InstSimplify doesn't know how to handle the case
where the constant vector in input contains some undef elements, and the
number of elements is smaller than the number of elements of the bitcast
vector type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281332
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 13 Sep 2016 13:08:53 +0000 (13:08 +0000)]
Don't use else if after return. Tidy comments. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281331
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 13 Sep 2016 13:00:29 +0000 (13:00 +0000)]
Typo. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281330
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 13 Sep 2016 12:56:04 +0000 (12:56 +0000)]
[LoopInterchange] Tidy up and remove unnecessary dyn_casts. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281328
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Tue, 13 Sep 2016 12:45:51 +0000 (12:45 +0000)]
Revert "[ARM] Promote small global constants to constant pools"
This reverts commit r281314. Speculatively revert as it's possible this caused linker errors: http://lab.llvm.org:8011/builders/clang-native-arm-lnt/builds/19656
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281327
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Parker [Tue, 13 Sep 2016 12:33:06 +0000 (12:33 +0000)]
Remove InstCombine test file
My previous commit should of removed a test file but I missed it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281326
91177308-0d34-0410-b5e6-
96231b3b80d8
Pablo Barrio [Tue, 13 Sep 2016 12:18:15 +0000 (12:18 +0000)]
[ARM] Add ".code 32" to functions in the ARM instruction set
Before, only Thumb functions were marked as ".code 16". These
".code x" directives are effective until the next directive of its
kind is encountered. Therefore, in code with interleaved ARM and
Thumb functions, it was possible to declare a function as ARM and
end up with a Thumb function after assembly. A test has been added.
An existing test has also been fixed to take this change into
account.
Reviewers: aschwaighofer, t.p.northover, jmolloy, rengolin
Subscribers: aemerson, rengolin, llvm-commits
Differential Revision: https://reviews.llvm.org/D24337
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281324
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Tue, 13 Sep 2016 12:12:32 +0000 (12:12 +0000)]
[Thumb] Teach ISel how to lower compares of AND bitmasks efficiently
For the common pattern (CMPZ (AND x, #bitmask), #0), we can do some more efficient instruction selection if the bitmask is one consecutive sequence of set bits (32 - clz(bm) - ctz(bm) == popcount(bm)).
1) If the bitmask touches the LSB, then we can remove all the upper bits and set the flags by doing one LSLS.
2) If the bitmask touches the MSB, then we can remove all the lower bits and set the flags with one LSRS.
3) If the bitmask has popcount == 1 (only one set bit), we can shift that bit into the sign bit with one LSLS and change the condition query from NE/EQ to MI/PL (we could also implement this by shifting into the carry bit and branching on BCC/BCS).
4) Otherwise, we can emit a sequence of LSLS+LSRS to remove the upper and lower zero bits of the mask.
1-3 require only one 16-bit instruction and can elide the CMP. 4 requires two 16-bit instructions but can elide the CMP and doesn't require materializing a complex immediate, so is also a win.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281323
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Parker [Tue, 13 Sep 2016 12:10:14 +0000 (12:10 +0000)]
Enable simplify libcalls for ARM PCS
Teach SimplifyLibcalls that in can treat functions annotated with
apcs, aapcs or aapcs_vfp like normal C functions if they only take
and return integer or pointer values, and the target is not iOS.
Differential Revision: https://reviews.llvm.org/D24453
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281322
91177308-0d34-0410-b5e6-
96231b3b80d8
Ying Yi [Tue, 13 Sep 2016 11:28:31 +0000 (11:28 +0000)]
[llvm-cov] - Included footer "Generated by llvm-cov -- llvm version <version number>" in the coverage report.
The llvm-cov version information will be useful to the user when comparing the code coverage across different versions of llvm-cov. This patch provides the llvm-cov version information in the generated coverage report.
Differential Revision: https://reviews.llvm.org/D24457
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281321
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Smith [Tue, 13 Sep 2016 11:15:51 +0000 (11:15 +0000)]
[ARM] Support ldr.w in pseudo instruction ldr rd,=immediate
The changes made in r269352, r269353 and r269354 to support the
transformation of the ldr rd,=immediate to mov introduced a regression
from 3.8 (ldr.w rd, =immediate) not supported.
This change puts support back in for ldr.w by means of a t2InstAlias for
the .w form. The .w is ignored in ARM state and propagated to the ldr in
Thumb2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281319
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Tue, 13 Sep 2016 10:28:11 +0000 (10:28 +0000)]
[ARM] Promote small global constants to constant pools
If a constant is unamed_addr and is only used within one function, we can save
on the code size and runtime cost of an indirection by changing the global's storage
to inside the constant pool. For example, instead of:
ldr r0, .CPI0
bl printf
bx lr
.CPI0: &format_string
format_string: .asciz "hello, world!\n"
We can emit:
adr r0, .CPI0
bl printf
bx lr
.CPI0: .asciz "hello, world!\n"
This can cause significant code size savings when many small strings are used in one
function (4 bytes per string).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281314
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Liu [Tue, 13 Sep 2016 10:05:44 +0000 (10:05 +0000)]
[WebAssembly] Trying to fix broken tests in CodeGen/WebAssembly caused by r281285.
Reviewers: bkramer, ddcc, dschuff, sunfish
Subscribers: jfb, llvm-commits, dschuff
Differential Revision: https://reviews.llvm.org/D24497
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281312
91177308-0d34-0410-b5e6-
96231b3b80d8
Ayman Musa [Tue, 13 Sep 2016 09:12:45 +0000 (09:12 +0000)]
Remove MVT:i1 xor instruction before SELECT. (Performance improvement).
Differential Revision: https://reviews.llvm.org/D23764
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281308
91177308-0d34-0410-b5e6-
96231b3b80d8
Sjoerd Meijer [Tue, 13 Sep 2016 08:51:59 +0000 (08:51 +0000)]
Revert of r281304 as it is causing build bot failures in hexagon
hwloop regression tests. These tests pass locally; will be investigating
where these differences come from.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281306
91177308-0d34-0410-b5e6-
96231b3b80d8
Sjoerd Meijer [Tue, 13 Sep 2016 08:08:06 +0000 (08:08 +0000)]
This adds a new field isAdd to MCInstrDesc. The ARM and Hexagon instruction
descriptions now tag add instructions, and the Hexagon backend is using this to
identify loop induction statements.
Patch by Sam Parker and Sjoerd Meijer.
Differential Revision: https://reviews.llvm.org/D23601
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281304
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Tue, 13 Sep 2016 07:57:00 +0000 (07:57 +0000)]
AVX-512: Fix for PR28175 - Scalar code optimization.
Optimized (truncate (assertzext x) to i1) and anyext i1 to i8/16/32.
Optimization of this patterns is a one more step towards i1 optimization on AVX-512.
Differential Revision: https://reviews.llvm.org/D24456
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281302
91177308-0d34-0410-b5e6-
96231b3b80d8
Diana Picus [Tue, 13 Sep 2016 07:45:17 +0000 (07:45 +0000)]
[AArch64] Support stackmap/patchpoint in getInstSizeInBytes
We currently return 4 for stackmaps and patchpoints, which is very optimistic
and can in rare cases cause the branch relaxation pass to fail to relax certain
branches.
This patch causes getInstSizeInBytes to return a pessimistic estimate of the
size as the number of bytes requested in the stackmap/patchpoint. In the future,
we could provide a more accurate estimate by sharing some of the logic in
AArch64::LowerSTACKMAP/PATCHPOINT.
Fixes part of https://llvm.org/bugs/show_bug.cgi?id=28750
Differential Revision: https://reviews.llvm.org/D24073
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281301
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 13 Sep 2016 07:40:53 +0000 (07:40 +0000)]
[X86] Remove masked shufpd/shufps intrinsics and autoupgrade to native vector shuffles. They were removed from clang previously but accidentally left in the backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281300
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 13 Sep 2016 07:40:48 +0000 (07:40 +0000)]
[X86] Remove some dead intrinsics. They aren't implemented and clang doesn't reference them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281299
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Tue, 13 Sep 2016 06:31:37 +0000 (06:31 +0000)]
[Docs] Fix a broken link in the Kaleidoscope tutorial.
Patch by: Alfred Perlstein <alfred@FreeBSD.org>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281297
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Tue, 13 Sep 2016 06:29:17 +0000 (06:29 +0000)]
[LTO] Only expose the dataLayout string instead of the whole module.
Differential Revision: https://reviews.llvm.org/D24494
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281296
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Tue, 13 Sep 2016 04:11:57 +0000 (04:11 +0000)]
Revert "[Support][CommandLine] Add cl::getRegisteredSubcommands()"
This reverts r281290, as it breaks unit tests.
http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/303
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281292
91177308-0d34-0410-b5e6-
96231b3b80d8
Dean Michael Berris [Tue, 13 Sep 2016 02:35:00 +0000 (02:35 +0000)]
[Support][CommandLine] Add cl::getRegisteredSubcommands()
This should allow users of the library to get a range to iterate through
all the subcommands that are registered to the global parser. This
allows users to define subcommands in libraries that self-register to
have dispatch done at a different stage (like main). It allows for
writing code like the following:
for (auto *S : cl::getRegisteredSubcommands()) {
if (*S) {
// Dispatch on S->getName().
}
}
This change also contains tests that show this usage pattern.
Reviewers: zturner, dblaikie, echristo
Subscribers: llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D24489
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281290
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Tue, 13 Sep 2016 02:22:02 +0000 (02:22 +0000)]
[lib/LTO] Expose getModule() in lto::InputFile.
lld will use this to get the datalayout string and emit a
diagnostic if empty.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281289
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Tue, 13 Sep 2016 01:12:59 +0000 (01:12 +0000)]
DebugInfo: New metadata representation for global variables.
This patch reverses the edge from DIGlobalVariable to GlobalVariable.
This will allow us to more easily preserve debug info metadata when
manipulating global variables.
Fixes PR30362. A program for upgrading test cases is attached to that
bug.
Differential Revision: http://reviews.llvm.org/D20147
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281284
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Tue, 13 Sep 2016 00:57:43 +0000 (00:57 +0000)]
[DAG] Refactor BUILD_VECTOR combine to make it easier to extend. NFCI.
This should make it easier to add cases that we currently don't cover,
like supporting more kinds of type mismatches and more than 2 input vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281283
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Tue, 13 Sep 2016 00:21:32 +0000 (00:21 +0000)]
X86: Conditional tail calls should not have isBarrier = 1
That confuses e.g. machine basic block placement, which then doesn't
realize that control can fall through a block that ends with a conditional
tail call. Instead, isBranch=1 should be set.
Also, mark EFLAGS as used by these instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281281
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 13 Sep 2016 00:19:29 +0000 (00:19 +0000)]
Temporarily Revert "[MC] Defer asm errors to post-statement failure" as it's causing errors on the sanitizer bots.
This reverts commit r281249.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281280
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Mon, 12 Sep 2016 23:46:34 +0000 (23:46 +0000)]
[OptDiag] Add getHotness accessor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281274
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Mon, 12 Sep 2016 22:38:44 +0000 (22:38 +0000)]
[LVI] Complete the abstract of the cache layer [NFCI]
Convert the previous introduced is-a relationship between the LVICache and LVIImple clases into a has-a relationship and hide all the implementation details of the cache from the lazy query layer.
The only slightly concerning change here is removing the addition of a queried block into the SeenBlock set in LVIImpl::getBlockValue. As far as I can tell, this was effectively dead code. I think it *used* to be the case that getCachedValueInfo wasn't const and might end up inserting elements in the cache during lookup. That's no longer true and hasn't been for a while. I did fixup the const usage to make that more obvious.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281272
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 12 Sep 2016 22:28:29 +0000 (22:28 +0000)]
add more tests for PR30273
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281270
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 12 Sep 2016 22:05:14 +0000 (22:05 +0000)]
[ORC] Clang-format RPCSerialization.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281269
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 12 Sep 2016 22:05:12 +0000 (22:05 +0000)]
[ORC] Add some more documentation to RPCSerialization.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281268
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Mon, 12 Sep 2016 22:03:36 +0000 (22:03 +0000)]
[LVI] Sink a couple more cache manipulation routines into the cache itself [NFCI]
The only interesting bit here is the refactor of the handle callback and even that's pretty straight-forward.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281267
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Mon, 12 Sep 2016 21:46:58 +0000 (21:46 +0000)]
[LVI] Abstract out the actual cache logic [NFCI]
Seperate the caching logic from the implementation of the lazy analysis. For the moment, the lazy analysis impl has a is-a relationship with the cache; this will change to a has-a relationship shortly. This was done as two steps merely to keep the changes simple and the diff understandable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281266
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Mon, 12 Sep 2016 21:40:50 +0000 (21:40 +0000)]
Revert r281215, it caused PR30358.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281263
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Mon, 12 Sep 2016 21:15:44 +0000 (21:15 +0000)]
attempt to unbreak build after r281254
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281262
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 12 Sep 2016 20:45:01 +0000 (20:45 +0000)]
[ORC] Add missing <thread> header to RPCSerialization.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281257
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 12 Sep 2016 20:34:41 +0000 (20:34 +0000)]
[ORC] Replace the serialize/deserialize function pair with a SerializationTraits
class.
SerializationTraits provides serialize and deserialize methods corresponding to
the earlier functions, but also provides a name for the type. In future, this
name will be used to render function signatures as strings, which will in turn
be used to negotiate and verify API support between RPC clients and servers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281254
91177308-0d34-0410-b5e6-
96231b3b80d8
Dehao Chen [Mon, 12 Sep 2016 20:29:54 +0000 (20:29 +0000)]
Fix the bug introduced in r281252.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281253
91177308-0d34-0410-b5e6-
96231b3b80d8
Dehao Chen [Mon, 12 Sep 2016 20:23:28 +0000 (20:23 +0000)]
Lower consecutive select instructions correctly.
Summary: If consecutive select instructions are lowered separately in CGP, it will introduce redundant condition check and branches that cannot be removed by later optimization phases. This patch lowers all consecutive select instructions at the same to to avoid inefficent code as demonstrated in https://llvm.org/bugs/show_bug.cgi?id=29095
Reviewers: davidxl
Subscribers: vsk, llvm-commits
Differential Revision: https://reviews.llvm.org/D24147
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281252
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Mon, 12 Sep 2016 20:03:02 +0000 (20:03 +0000)]
[MC] Defer asm errors to post-statement failure
Allow errors to be deferred and emitted as part of clean up to simplify
and shorten Assembly parser code. This will allow error messages to be
emitted in helper functions and be modified by the caller which has
better context.
As part of this many minor cleanups to the Parser:
* Unify parser cleanup on error
* Add Workaround for incorrect return values in ParseDirective instances
* Tighten checks on error-signifying return values for parser functions
and fix in-tree TargetParsers to be more consistent with the changes.
* Fix AArch64 test cases checking for spurious error messages that are
now fixed.
These changes should be backwards compatible with current Target Parsers
so long as the error status are correctly returned in appropriate
functions.
Reviewers: rnk, majnemer
Subscribers: aemerson, jyknight, llvm-commits
Differential Revision: https://reviews.llvm.org/D24047
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281249
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 12 Sep 2016 19:50:08 +0000 (19:50 +0000)]
[InstCombine] add test for PR30327
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281248
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 12 Sep 2016 19:29:26 +0000 (19:29 +0000)]
[InstCombine] regenerate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281247
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Mon, 12 Sep 2016 19:03:21 +0000 (19:03 +0000)]
AVX-512: Added a test for -O0 mode. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281246
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Mon, 12 Sep 2016 18:50:47 +0000 (18:50 +0000)]
AVX-512: Simplified masked_gather_scatter test. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281244
91177308-0d34-0410-b5e6-
96231b3b80d8
Hemant Kulkarni [Mon, 12 Sep 2016 17:40:10 +0000 (17:40 +0000)]
Fix test failure in r281232
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281240
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 12 Sep 2016 17:19:24 +0000 (17:19 +0000)]
[MCJIT] Fix some inconsistent handling of name mangling inside MCJIT.
This patch moves symbol mangling from findSymbol to getSymbolAddress. The
findSymbol, findExistingSymbol and findModuleForSymbol methods now always take
a mangled name, allowing the 'demangle-and-retry' cruft to be removed from
findSymbol. See http://llvm.org/PR28699 for details.
Patch by James Holderness. Thanks very much James!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281238
91177308-0d34-0410-b5e6-
96231b3b80d8
Hemant Kulkarni [Mon, 12 Sep 2016 17:08:28 +0000 (17:08 +0000)]
llvm-size: Add --totals option
Differential Revision: https://reviews.llvm.org/D24308
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281233
91177308-0d34-0410-b5e6-
96231b3b80d8
Hemant Kulkarni [Mon, 12 Sep 2016 17:08:22 +0000 (17:08 +0000)]
llvm-objdump: Add --start-address and --stop-address options
Differential Revision: https://reviews.llvm.org/D24160
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281232
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 12 Sep 2016 16:25:41 +0000 (16:25 +0000)]
[InstCombine] use m_APInt to allow icmp X, C folds for splat constant vectors
isSignBitCheck could be changed to take a pointer param to avoid the 'UnusedBit' ugliness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281231
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Mon, 12 Sep 2016 16:25:20 +0000 (16:25 +0000)]
AMDGPU: Do not clobber SCC in SIWholeQuadMode
Reviewers: arsenm, tstellarAMD, mareko
Subscribers: arsenm, llvm-commits, kzhuravl
Differential Revision: http://reviews.llvm.org/D22198
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281230
91177308-0d34-0410-b5e6-
96231b3b80d8