OSDN Git Service
Sam Parker [Fri, 13 Jan 2017 11:04:21 +0000 (11:04 +0000)]
[ARM] Enable objdump to construct triple for ARM
Now that The ARMAttributeParser has been moved into the library,
it has been modified so that it can parse the attributes without
printing them and stores them in a map. ELFObjectFile now queries
the attributes to fill out the architecture details of a provided
triple for 'arm' and 'thumb' targets. llvm-objdump uses this new
functionality.
Differential Revision: https://reviews.llvm.org/D28281
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291898
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 13 Jan 2017 10:53:57 +0000 (10:53 +0000)]
[aarch64][globalisel] Move data into <Target>GenRegisterBankInfo. NFC.
Summary: Depends on D27809
Reviewers: t.p.northover, rovka, qcolombet, ab
Subscribers: aditya_nandakumar, aemerson, rengolin, vkalintiris, dberris, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D27976
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291897
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Parker [Fri, 13 Jan 2017 10:50:01 +0000 (10:50 +0000)]
[ARM] Moved ARMAttributeParser to Support
Moved ARMAttributeParser out of llvm-readobj and into the support
library.
Differential Revision: https://reviews.llvm.org/D28227
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291896
91177308-0d34-0410-b5e6-
96231b3b80d8
Diana Picus [Fri, 13 Jan 2017 10:37:37 +0000 (10:37 +0000)]
[ARM] CodeGen: Replace AddDefaultT1CC and AddNoT1CC. NFC
For AddDefaultT1CC, we add a new helper t1CondCodeOp, which creates the
appropriate register operand. For AddNoT1CC, we use the existing condCodeOp
helper - we only had two uses of AddNoT1CC, so at this point it's probably not
worth having yet another helper just for them.
Differential Revision: https://reviews.llvm.org/D28603
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291894
91177308-0d34-0410-b5e6-
96231b3b80d8
Diana Picus [Fri, 13 Jan 2017 10:18:01 +0000 (10:18 +0000)]
[ARM] CodeGen: Remove AddDefaultCC. NFC.
Replace all uses of AddDefaultCC with add(condCodeOp()).
The transformation has been done automatically with a custom tool based on Clang
AST Matchers + RefactoringTool.
Differential Revision: https://reviews.llvm.org/D28557
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291893
91177308-0d34-0410-b5e6-
96231b3b80d8
Diana Picus [Fri, 13 Jan 2017 09:58:52 +0000 (09:58 +0000)]
[CodeGen] Rename MachineInstrBuilder::addOperand. NFC
Rename from addOperand to just add, to match the other method that has been
added to MachineInstrBuilder for adding more than just 1 operand.
See https://reviews.llvm.org/D28057 for the whole discussion.
Differential Revision: https://reviews.llvm.org/D28556
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291891
91177308-0d34-0410-b5e6-
96231b3b80d8
Diana Picus [Fri, 13 Jan 2017 09:37:56 +0000 (09:37 +0000)]
[ARM] CodeGen: Remove AddDefaultPred. NFC.
Replace all uses of AddDefaultPred with MachineInstrBuilder::add(predOps()).
This makes the code building MachineInstrs more readable, because it allows us
to write code like:
MIB.addSomeOperand(blah)
.add(predOps())
.addAnotherOperand(blahblah)
instead of
AddDefaultPred(MIB.addSomeOperand(blah))
.addAnotherOperand(blahblah)
This commit also adds the predOps helper in the ARM backend, as well as the add
method taking a variable number of operands to the MachineInstrBuilder.
The transformation has been done mostly automatically with a custom tool based
on Clang AST Matchers + RefactoringTool.
Differential Revision: https://reviews.llvm.org/D28555
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291890
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zuckerman [Fri, 13 Jan 2017 09:06:00 +0000 (09:06 +0000)]
[X86][AVX512] Adding missing shuffle lowering to blend mask instructions
Some shuffles can be lowered to blend mask instruction (VPBLENDMB/VPBLENDMW/VPBLENDMD/VPBLENDMQ) .
In this patch, I added new pattern match for this case.
Reviewers:
1. craig.topper
2. guyblank
3. RKSimon
4. igorb
Differential Revision: https://reviews.llvm.org/D28483
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291888
91177308-0d34-0410-b5e6-
96231b3b80d8
Tobias Grosser [Fri, 13 Jan 2017 09:00:17 +0000 (09:00 +0000)]
RegionPass: Set isExecuted flag correctly
This was forgotten in r291882. Without this fix, the Polly build bots are
broken.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291887
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 13 Jan 2017 08:20:18 +0000 (08:20 +0000)]
DWARFDie.h: Move a class declaration out of the method description since r291861. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291886
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 13 Jan 2017 07:28:56 +0000 (07:28 +0000)]
[AVX-512] Remove unmasked BLENDM instructions from the wrong load folding table. The unmasked versions read memory from operand 2, but were in the operand 3 table.
These aren't the most interesting set of blendm instructions as the unmasked version isn't useful. We were also missing the B and W forms. I'll add the masked versions of all sizes in a future patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291885
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 13 Jan 2017 07:28:53 +0000 (07:28 +0000)]
[X86] Move some entries in the load folding tables to move appropriate grouping. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291884
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 13 Jan 2017 06:26:18 +0000 (06:26 +0000)]
[IR] Don't call assertModuleIsMaterialized in release builds
Summary:
To fix a release vs debug build linking error, r259695 made the body of assertModuleIsMaterialized empty if Value.cpp gets compiled in a release build. This way any code compiled as a debug build can still link against a release version of the function.
This patch takes this a step farther and removes all calls to it from Value.h in any code that includes it in a relase build.
This shrinks the opt binary on my macbook build by 17240 bytes.
Reviewers: rafael
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D28191
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291883
91177308-0d34-0410-b5e6-
96231b3b80d8
Serge Pavlov [Fri, 13 Jan 2017 06:09:54 +0000 (06:09 +0000)]
Track validity of pass results
Running tests with expensive checks enabled exhibits some problems with
verification of pass results.
First, the pass verification may require results of analysis that are not
available. For instance, verification of loop info requires results of dominator
tree analysis. A pass may be marked as conserving loop info but does not need to
be dependent on DominatorTreePass. When a pass manager tries to verify that loop
info is valid, it needs dominator tree, but corresponding analysis may be
already destroyed as no user of it remained.
Another case is a pass that is skipped. For instance, entities with linkage
available_externally do not need code generation and such passes are skipped for
them. In this case result verification must also be skipped.
To solve these problems this change introduces a special flag to the Pass
structure to mark passes that have valid results. If this flag is reset,
verifications dependent on the pass result are skipped.
Differential Revision: https://reviews.llvm.org/D27190
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291882
91177308-0d34-0410-b5e6-
96231b3b80d8
Easwaran Raman [Fri, 13 Jan 2017 01:34:00 +0000 (01:34 +0000)]
ProfileSummaryInfo improvements.
* Add is{Hot|Cold}CallSite methods
* Fix a bug in isHotBB where it was looking for MD_prof on a return instruction
* Use MD_prof data only if sample profiling was used to collect profiles.
* Add an unit test to ProfileSummaryInfo
Differential Revision: https://reviews.llvm.org/D28584
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291878
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 13 Jan 2017 01:13:10 +0000 (01:13 +0000)]
Revert r291503, "Lift the 10-type limit for AlignedCharArrayUnion", and followings.
r291503, "Lift the 10-type limit for AlignedCharArrayUnion"
r291514, "Fix MSVC build of AlignedCharArrayUnion"
r291515, "Revert the attempt to optimize the constexpr functions. MSVC does not handle this yet"
r291519, "Try once again to fix the MSVC build of AlignedCharArrayUnion"
They has been failing on i686-linux.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291875
91177308-0d34-0410-b5e6-
96231b3b80d8
Eugene Zelenko [Fri, 13 Jan 2017 00:58:58 +0000 (00:58 +0000)]
[PowerPC] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291872
91177308-0d34-0410-b5e6-
96231b3b80d8
Greg Clayton [Fri, 13 Jan 2017 00:23:59 +0000 (00:23 +0000)]
Fix buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291864
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 13 Jan 2017 00:17:15 +0000 (00:17 +0000)]
xray-account: Avoid std::errc::bad_message to appease mingw.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291863
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Fri, 13 Jan 2017 00:16:23 +0000 (00:16 +0000)]
Move test of lazy BFI with ORE to a generic directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291862
91177308-0d34-0410-b5e6-
96231b3b80d8
Greg Clayton [Fri, 13 Jan 2017 00:13:42 +0000 (00:13 +0000)]
Add the ability to iterate across all attributes in a DIE.
Differential Revision: https://reviews.llvm.org/D28386
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291861
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Thu, 12 Jan 2017 23:26:20 +0000 (23:26 +0000)]
[asan] Don't overalign global metadata.
Other than on COFF with incremental linking, global metadata should
not need any extra alignment.
Differential Revision: https://reviews.llvm.org/D28628
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291859
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Thu, 12 Jan 2017 23:03:03 +0000 (23:03 +0000)]
[asan] Refactor instrumentation of globals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291858
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 12 Jan 2017 22:28:15 +0000 (22:28 +0000)]
[llvm-pdbdump] Add a compact dump mode.
Differential Revision: https://reviews.llvm.org/D28545
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291849
91177308-0d34-0410-b5e6-
96231b3b80d8
Teresa Johnson [Thu, 12 Jan 2017 22:04:45 +0000 (22:04 +0000)]
[ThinLTO] Import static functions from the same module as caller
Summary:
We can sometimes end up with multiple copies of a local function that
have the same GUID in the index. This happens when there are local
functions with the same name that are in different source files with the
same name (but in different directories), and they were compiled in
their own directory so had the same path at compile time.
In this case make sure we import the copy in the caller's module. While
it isn't a correctness problem (the renamed reference which is based on the
module IR hash will be unique since the module must have had an
externally visible function that was imported), importing the wrong copy
will result in lost performance opportunity since it won't be referenced
and inlined.
Reviewers: mehdi_amini
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D28440
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291841
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Thu, 12 Jan 2017 21:50:22 +0000 (21:50 +0000)]
Clear the release notes for 5.0.0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291836
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Thu, 12 Jan 2017 21:35:21 +0000 (21:35 +0000)]
[ObjectYAML] Pull yaml2dwarf out of yaml2obj for reuse
This patch pulls the yaml2dwarf code out of yaml2obj into a new set of DWARF emitter functions in the DWARFYAML namespace. This will enable the YAML->DWARF code to be used inside DWARF tests by populating the DWARFYAML structs and calling the Emitter functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291828
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Thu, 12 Jan 2017 21:22:36 +0000 (21:22 +0000)]
Bump trunk version to 5.0.0svn
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291815
91177308-0d34-0410-b5e6-
96231b3b80d8
Robert Lougher [Thu, 12 Jan 2017 21:11:09 +0000 (21:11 +0000)]
[DebugInfo] Remove redundant check in SimplifyCFG; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291813
91177308-0d34-0410-b5e6-
96231b3b80d8
Robert Lougher [Thu, 12 Jan 2017 20:34:35 +0000 (20:34 +0000)]
[DebugInfo] Handle same locations in DILocation::getMergedLocation
Revision 289661 introduced the function DILocation::getMergedLocation for
merging of debug locations. At the time is was simply a stub which always
returned no location. This patch modifies getMergedLocation to handle the
case where the two locations are the same or can't be discriminated.
Differential Revision: https://reviews.llvm.org/D28521
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291809
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Thu, 12 Jan 2017 20:21:00 +0000 (20:21 +0000)]
[SCEV] Simplify SolveLinEquationWithOverflow a bit.
Cleanup in preparation for generalizing it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291808
91177308-0d34-0410-b5e6-
96231b3b80d8
Nikolai Bozhenov [Thu, 12 Jan 2017 19:54:27 +0000 (19:54 +0000)]
[X86] Replace AND+IMM64 with SRL/SHL
Emit SHRQ/SHLQ instead of ANDQ with a 64 bit constant mask if the result
is unused and the mask has only higher/lower bits set. For example, with
this patch LLVM emits
shrq $41, %rdi
je
instead of
movabsq $0xFFFFFE0000000000, %rcx
testq %rcx, %rdi
je
This reduces number of instructions, code size and register pressure.
The transformation is applied only for cases where the mask cannot be
encoded as an immediate value within TESTQ instruction.
Differential Revision: https://reviews.llvm.org/D28198
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291806
91177308-0d34-0410-b5e6-
96231b3b80d8
Nikolai Bozhenov [Thu, 12 Jan 2017 19:48:01 +0000 (19:48 +0000)]
[X86] Modify BypassSlowDivision tests to match their new names (NFC)
- bypass-slow-division-32.ll:
tests verifying correctness of divl-to-divb bypassing
- bypass-slow-division-64.ll:
tests verifying correctness of divq-to-divl bypassing
- bypass-slow-division-tune.ll:
tests verifying that bypassing is enabled only when appropriate
Differential Revision: https://reviews.llvm.org/D28551
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291804
91177308-0d34-0410-b5e6-
96231b3b80d8
Marcello Maggioni [Thu, 12 Jan 2017 19:47:38 +0000 (19:47 +0000)]
[llvm-config] Fix obviously wrong code in parsing DyLib components.
The code parsing the string was using the offset returned from
StringRef::find() wrong, assuming it was relative to the staring
offset that is passed to the function, but the returned offset
is always relative to the beginning of the line.
This causes odd behaviour while parsing the component string.
Spotted thanks to the newly added test:
tools/llvm-config/booleans.test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291803
91177308-0d34-0410-b5e6-
96231b3b80d8
Nikolai Bozhenov [Thu, 12 Jan 2017 19:41:27 +0000 (19:41 +0000)]
[X86] Rename tests for bypassing slow division (NFC)
For tests on bypassing slow division there's no need to be
Atom-specific. The patch renames all tests on division bypassing
and makes their names more consistent:
atom-bypass-slow-division.ll -> bypass-slow-division-32.ll
(tests verifying correctness of divl-to-divb bypassing)
atom-bypass-slow-division-64.ll -> bypass-slow-division-64.ll
(tests verifying correctness of divq-to-divl bypassing)
slow-div.ll -> bypass-slow-division-tune.ll
(tests verifying that bypassing is enabled only when appropriate)
Differential Revision: https://reviews.llvm.org/D28197
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291802
91177308-0d34-0410-b5e6-
96231b3b80d8
Nikolai Bozhenov [Thu, 12 Jan 2017 19:34:15 +0000 (19:34 +0000)]
[X86] Tune bypassing of slow division for Intel CPUs
64-bit integer division in Intel CPUs is extremely slow, much slower
than 32-bit division. On the other hand, 8-bit and 16-bit divisions
aren't any faster. The only important exception is Atom where DIV8
is fastest. Because of that, the patch
1) Enables bypassing of 64-bit division for Atom, Silvermont and
all big cores.
2) Modifies 64-bit bypassing to use 32-bit division instead of
16-bit one. This doesn't make the shorter division slower but
increases chances of taking it. Moreover, it's much more likely
to prove at compile-time that a value fits 32 bits and doesn't
require a run-time check (e.g. zext i32 to i64).
Differential Revision: https://reviews.llvm.org/D28196
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291800
91177308-0d34-0410-b5e6-
96231b3b80d8
Nikolai Bozhenov [Thu, 12 Jan 2017 19:29:18 +0000 (19:29 +0000)]
[X86] Update LLC tests for slow division bypassing (NFC)
Run update_llc_test_checks.py on
CodeGen/X86/atom-bypass-slow-division.ll
CodeGen/X86/atom-bypass-slow-division-64.ll
CodeGen/X86/slow-div.ll
Differential Revision: https://reviews.llvm.org/D28469
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291799
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 12 Jan 2017 18:58:15 +0000 (18:58 +0000)]
AMDGPU: Skip fneg/select combine if it can fold into other
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291792
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 12 Jan 2017 18:48:09 +0000 (18:48 +0000)]
AMDGPU: Fold free fneg into sin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291790
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Thu, 12 Jan 2017 18:46:11 +0000 (18:46 +0000)]
ARM: slightly more table driven libcall setup
Switch some additional library call setup to be table driven. This
makes it more immediately obvious what the library call looks like.
This is important for ARM since the calling conventions for the builtins
change based on the target/libcall name. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291789
91177308-0d34-0410-b5e6-
96231b3b80d8
Robert Lougher [Thu, 12 Jan 2017 18:33:49 +0000 (18:33 +0000)]
[DebugInfo] DILocation variable declaration should be const; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291787
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Thu, 12 Jan 2017 18:33:14 +0000 (18:33 +0000)]
Avoid std::errc::protocol_* to appease mingw
Like r291636 and r285261.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291786
91177308-0d34-0410-b5e6-
96231b3b80d8
Robert Lougher [Thu, 12 Jan 2017 18:29:28 +0000 (18:29 +0000)]
[DebugInfo] Add const to DILocation variable declaration; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291785
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 12 Jan 2017 18:26:30 +0000 (18:26 +0000)]
AMDGPU: Fold fneg into fmul_legacy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291784
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Thu, 12 Jan 2017 18:02:42 +0000 (18:02 +0000)]
Bump year to 2017 in LICENSE.txt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291782
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 12 Jan 2017 17:46:35 +0000 (17:46 +0000)]
AMDGPU: Fold fneg into rcp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291779
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 12 Jan 2017 17:46:33 +0000 (17:46 +0000)]
AMDGPU: Fold fneg into fp_round
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291778
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 12 Jan 2017 17:46:28 +0000 (17:46 +0000)]
AMDGPU: Fold fneg into fp_extend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291777
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 12 Jan 2017 17:44:32 +0000 (17:44 +0000)]
Fix some -Wsign-compare warnings by making some integer literals explicitly unsigned
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291776
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Thu, 12 Jan 2017 16:15:10 +0000 (16:15 +0000)]
TTI: Add comment clarifying the meaning of MemIntrinsicInfo::PtrVal.
Patch by Tom Stellard.
Differential Revision: https://reviews.llvm.org/D27563
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291772
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Thu, 12 Jan 2017 16:11:23 +0000 (16:11 +0000)]
[globalisel] Move as much RegisterBank initialization to the constructor as possible
Summary:
The register bank is now entirely initialized in the constructor. However,
we still have the hardcoded number of register classes which will be
dealt with in the TableGen patch (D27338) since we do not have access
to this information to resolve this at this stage. The number of register
classes is known to the TRI and to TableGen but the RegisterBank
constructor is too early for the former and too late for the latter.
This will be fixed when the data is tablegen-erated.
Reviewers: t.p.northover, ab, rovka, qcolombet
Subscribers: aditya_nandakumar, kristof.beyls, vkalintiris, llvm-commits, dberris
Differential Revision: https://reviews.llvm.org/D27809
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291770
91177308-0d34-0410-b5e6-
96231b3b80d8
Amjad Aboud [Thu, 12 Jan 2017 15:49:46 +0000 (15:49 +0000)]
[DebugInfo] Added DI macro creation API to DIBuilder.
Differential Revision: https://reviews.llvm.org/D16077
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291769
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Thu, 12 Jan 2017 15:32:10 +0000 (15:32 +0000)]
[globalisel] Initialize RegisterBanks with static data.
Summary:
Refactor the RegisterBank initialization to use static data. This requires
GlobalISel implementations to rewrite calls to createRegisterBank() and
addRegBankCoverage() into a call to setRegBankData().
Out of tree targets can use diff 4 of D27807
(https://reviews.llvm.org/D27807?id=84117) to have addRegBankCoverage() dump
the register classes and other data that needs to be provided to
setRegBankData(). This is the method that was used to generate the static data
in this patch.
Tablegen-eration of this static data will follow after some refactoring.
Reviewers: t.p.northover, ab, rovka, qcolombet
Subscribers: aditya_nandakumar, kristof.beyls, vkalintiris, llvm-commits, dberris
Differential Revision: https://reviews.llvm.org/D27807
Differential Revision: https://reviews.llvm.org/D27808
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291768
91177308-0d34-0410-b5e6-
96231b3b80d8
Piotr Padlewski [Thu, 12 Jan 2017 11:33:58 +0000 (11:33 +0000)]
[Devirtualization] MemDep returns non-local !invariant.group dependencies
Summary:
Memory Dependence Analysis was limited to return only local dependencies
for invariant.group handling. Now it returns NonLocal when it finds it
and then by asking getNonLocalPointerDependency we get found dep.
Thanks to this we are able to devirtualize loops!
void indirect(A &a, int n) {
for (int i = 0 ; i < n; i++)
a.foo();
}
void test(int n) {
A a;
indirect(a);
}
After inlining a.foo() will be changed to direct call, even if foo and A::A()
is external (but only if vtable definition is be available).
Reviewers: nlewycky, dberlin, chandlerc, rsmith
Subscribers: mehdi_amini, davide, llvm-commits
Differential Revision: https://reviews.llvm.org/D28137
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291762
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 12 Jan 2017 11:21:56 +0000 (11:21 +0000)]
Wdocumentation fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291761
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 12 Jan 2017 11:13:51 +0000 (11:13 +0000)]
Fix windows buildbots building llvm-xray
2 issues:
1 - replaced unix-style pid_t with cross-platform llvm::sys::ProcessInfo::ProcessId
2 - fixed shadow variable warning in lambda expression
Reviewed by @filcab
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291760
91177308-0d34-0410-b5e6-
96231b3b80d8
Dean Michael Berris [Thu, 12 Jan 2017 07:43:54 +0000 (07:43 +0000)]
[XRay] Include <numeric> for std::accumulate.
Fix-up following D24377.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291750
91177308-0d34-0410-b5e6-
96231b3b80d8
Dean Michael Berris [Thu, 12 Jan 2017 07:38:13 +0000 (07:38 +0000)]
[XRay] Implement the `llvm-xray account` subcommand
Summary:
This is the third of a multi-part change to implement subcommands for
the `llvm-xray` tool.
Here we define the `account` subcommand which does simple function call
accounting, generating basic statistics on function calls we find in an
XRay log/trace. We support text output and csv output for this
subcommand.
This change also supports sorting, summing, and filtering the top N
results.
Part of this tool will later be turned into a library that could be used
for basic function call accounting.
Depends on D24376.
Reviewers: dblaikie, echristo
Subscribers: mehdi_amini, dberris, beanz, llvm-commits
Differential Revision: https://reviews.llvm.org/D24377
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291749
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 12 Jan 2017 07:17:28 +0000 (07:17 +0000)]
AMDGPU: Fix sub_oneuse being marked commutative
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291748
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 12 Jan 2017 06:49:12 +0000 (06:49 +0000)]
[AVX-512] Improve lowering of zero_extend of v4i1 to v4i32 and v2i1 to v2i64 with VLX, but no DQ or BW support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291747
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 12 Jan 2017 06:49:08 +0000 (06:49 +0000)]
[AVX-512] Improve lowering of sign_extend of v4i1 to v4i32 and v2i1 to v2i64 when avx512vl is available, but not avx512dq.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291746
91177308-0d34-0410-b5e6-
96231b3b80d8
Elad Cohen [Thu, 12 Jan 2017 06:49:03 +0000 (06:49 +0000)]
[X86][AVX512] Fix PR31515 - Do not flip vselect condition if it's not a vXi1 mask
r289653 added a case where `vselect <cond> <vector1> <all-zeros>`
is transformed to:
`vselect xor(cond, DAG.getConstant(1, DL, CondVT) <all-zeros> <vector1>`
This was not aimed to catch cases where Cond is not a vXi1
mask but it does. Moreover, when Cond type is VxiN (N > 1)
then xor(cond, DAG.getConstant(1, DL, CondVT) != NOT(cond).
This patch changes the above to xor with allones, and avoids
entering the case for non-mask Conds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291745
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 12 Jan 2017 06:49:03 +0000 (06:49 +0000)]
[AVX-512] Add more varied avx512 feature command lines to the avx512-cvt.ll test to show some poor codegen examples.
We're definitely doing bad things when avx512vl is enabled without avx512dq. It looks like avx512vl/dq without avx512bw may also have some issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291744
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 12 Jan 2017 03:49:07 +0000 (03:49 +0000)]
Make a test actually test what it set out to test.
This test seems to have largely been relying on asserts being tripped.
It had a very specific and somewhat uninteresting grep of the output,
but it never really did anything to cause SCEV to be preserved across
loop simplify, certainly not explicitly. And a later addition to it
actually added CHECK lines despite the test never running FileCheck.
Now we actually print SCEV before and after loop simplify to make sure
it is *changing* and being *updated*. Which seems to be much more likely
the point of the test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291740
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 12 Jan 2017 00:32:16 +0000 (00:32 +0000)]
AMDGPU: Fold fneg into fma or fmad
Patch mostly by Fiona Glaser
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291733
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 12 Jan 2017 00:23:20 +0000 (00:23 +0000)]
AMDGPU: Fold fneg into fmul
Patch mostly by Fiona Glaser
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291732
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 12 Jan 2017 00:09:34 +0000 (00:09 +0000)]
AMDGPU: Fold fneg into fadd
Patch mostly by Fiona Glaser
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291731
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 11 Jan 2017 23:57:38 +0000 (23:57 +0000)]
AMDGPU: Pull fneg/fabs out of a select
Allows better source modifier usage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291729
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Wed, 11 Jan 2017 23:41:24 +0000 (23:41 +0000)]
[NewGVN] Fixup store count for the `initial` congruency class.
It was always zero. When we move a store from `initial` to its
own congruency class, we end up with a negative store count, which
is obviously wrong.
Also, while here, change StoreCount to be signed so that the assertions
actually fire.
Ack'ed by Daniel Berlin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291725
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Wed, 11 Jan 2017 23:24:22 +0000 (23:24 +0000)]
[CodeView] Finish decoupling TypeDatabase from TypeDumper.
Previously the type dumper itself was passed around to a lot of different
places and manipulated in ways that were more appropriate on the type
database. For example, the entire TypeDumper was passed into the symbol
dumper, when all the symbol dumper wanted to do was lookup the name of a
TypeIndex so it could print it. That's what the TypeDatabase is for --
mapping type indices to names.
Another example is how if the user runs llvm-pdbdump with the option to
dump symbols but not types, we still have to visit all types so that we
can print minimal information about the type of a symbol, but just without
dumping full symbol records. The way we did this before is by hacking it
up so that we run everything through the type dumper with a null printer,
so that the output goes to /dev/null. But really, we don't need to dump
anything, all we want to do is build the type database. Since
TypeDatabaseVisitor now exists independently of TypeDumper, we can do
this. We just build a custom visitor callback pipeline that includes a
database visitor but not a dumper.
All the hackery around printers etc goes away. After this patch, we could
probably even delete the entire CVTypeDumper class since really all it is
at this point is a thin wrapper that hides the details of how to build a
useful visitation pipeline. It's not a priority though, so CVTypeDumper
remains for now.
After this patch we will be able to easily plug in a different style of
type dumper by only implementing the proper visitation methods to dump
one-line output and then sticking it on the pipeline.
Differential Revision: https://reviews.llvm.org/D28524
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291724
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Wed, 11 Jan 2017 23:00:28 +0000 (23:00 +0000)]
X86: Remove dead code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291721
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 11 Jan 2017 22:58:12 +0000 (22:58 +0000)]
AMDGPU: Fix shrinking of addc/subb.
To shrink to VOP2 the input carry must also be VCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291720
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Wed, 11 Jan 2017 22:55:35 +0000 (22:55 +0000)]
Add -Wl,-color-diagnostics if a linker supports the option.
Differential Revision: https://reviews.llvm.org/D28046
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291719
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 11 Jan 2017 22:35:22 +0000 (22:35 +0000)]
AMDGPU: Fix sext_inreg for i1 in i16
This produces worse code when i16 is legal, mostly
due to combines getting confused by conversions inserted
for uniform 16-bit operations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291717
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 11 Jan 2017 22:35:17 +0000 (22:35 +0000)]
AMDGPU: Fix breaking VOP3 v_add_i32s
This was shrinking the instruction even though the carry output
register was a virtual register, not known VCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291716
91177308-0d34-0410-b5e6-
96231b3b80d8
Kuba Mracek [Wed, 11 Jan 2017 22:26:10 +0000 (22:26 +0000)]
[asan] Set alignment of __asan_global_* globals to sizeof(GlobalStruct)
When using profiling and ASan together (-fprofile-instr-generate -fcoverage-mapping -fsanitize=address), at least on Darwin, the section of globals that ASan emits (__asan_globals) is misaligned and starts at an odd offset. This really doesn't have anything to do with profiling, but it triggers the issue because profiling emits a string section, which can have arbitrary size. This patch changes the alignment to sizeof(GlobalStruct).
Differential Revision: https://reviews.llvm.org/D28573
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291715
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Wed, 11 Jan 2017 22:02:51 +0000 (22:02 +0000)]
Use EXPECT_EQ instead of ASSERT_EQ in a unit test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291713
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Wed, 11 Jan 2017 22:00:29 +0000 (22:00 +0000)]
Revert "[NewGVN] Strengthen a couple of assertions."
It's breaking some bots. Will investigate and recommit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291712
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 11 Jan 2017 22:00:02 +0000 (22:00 +0000)]
AMDGPU: Fix folding immediates into mac src2
Whether it is legal or not needs to check for the instruction
it will be replaced with.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291711
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Wed, 11 Jan 2017 21:58:42 +0000 (21:58 +0000)]
[NewGVN] Parenthesise assertion condition (-Wparenthesis).
Format an assertion message while I'm here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291710
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Wed, 11 Jan 2017 21:49:00 +0000 (21:49 +0000)]
[NewGVN] Strengthen a couple of assertions.
StoreCount >= 0 on `unsigned` is always true, otherwise.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291709
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Wed, 11 Jan 2017 21:42:51 +0000 (21:42 +0000)]
Add test that verifies we don't peel loops in optsize functions. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291708
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Wed, 11 Jan 2017 21:32:10 +0000 (21:32 +0000)]
LowerTypeTests: Represent the memory region size with the constant size-1.
This means that we can use a shorter instruction sequence in the case where
the size is a power of two and on the boundary between two representations.
Differential Revision: https://reviews.llvm.org/D28421
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291706
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Wed, 11 Jan 2017 21:07:15 +0000 (21:07 +0000)]
[SCEV] Make howFarToZero max backedge-taken count check for precondition.
Refines max backedge-taken count if a loop like
"for (int i = 0; i != n; ++i) { /* body */ }" is rotated.
Differential Revision: https://reviews.llvm.org/D28536
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291704
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Wed, 11 Jan 2017 20:55:48 +0000 (20:55 +0000)]
[SCEV] Make howFarToZero use a simpler formula for max backedge-taken count.
This is both easier to understand, and produces a tighter bound in certain
cases.
Differential Revision: https://reviews.llvm.org/D28393
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291701
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Wed, 11 Jan 2017 20:28:46 +0000 (20:28 +0000)]
Re-apply r291205, "LowerTypeTests: Split the pass in two: a resolution phase and a lowering phase.", with a fix for an off-by-one error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291699
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Wed, 11 Jan 2017 20:22:36 +0000 (20:22 +0000)]
NewGVN: Fix PR31594, by tracking the store count of congruence
classes, and updating checking to allow for equivalence through
reachability.
(Sadly, the checking here is not perfect, and can't be made perfect,
so we'll have to disable it after we are satisfied with correctness.
Right now it is just "very unlikely" to happen.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291698
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Wed, 11 Jan 2017 20:22:05 +0000 (20:22 +0000)]
NewGVN: Refactor performCongruenceFinding and split out congruence class moving
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291697
91177308-0d34-0410-b5e6-
96231b3b80d8
Rong Xu [Wed, 11 Jan 2017 20:19:41 +0000 (20:19 +0000)]
Resubmit "[PGO] Turn off comdat renaming in IR PGO by default"
This patch resubmits the changes in r291588.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291696
91177308-0d34-0410-b5e6-
96231b3b80d8
Kyle Butt [Wed, 11 Jan 2017 19:55:19 +0000 (19:55 +0000)]
Revert "CodeGen: Allow small copyable blocks to "break" the CFG."
This reverts commit
ada6595a526d71df04988eb0a4b4fe84df398ded.
This needs a simple probability check because there are some cases where it is
not profitable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291695
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 11 Jan 2017 19:47:16 +0000 (19:47 +0000)]
Make some operator bools explicit for sanity/safety.
There are a couple left in bool-like containers (BitVector, etc) where
the implicit conversions seem more suitable - though it might be worth
considering explicitifying those too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291694
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Wed, 11 Jan 2017 19:33:38 +0000 (19:33 +0000)]
[ARM] More aggressive matching for vpadd and vpaddl.
The new matchers work after legalization to make them simpler, and to avoid
blocking other optimizations.
Differential Revision: https://reviews.llvm.org/D27779
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291693
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Wed, 11 Jan 2017 19:23:57 +0000 (19:23 +0000)]
[SLP] Remove bogus assert.
The removed assert seems bogus - it's perfectly legal for the roots of the
vectorized subtrees to be equal even if the original scalar values aren't,
if the original scalars happen to be equivalent.
This fixes PR31599.
Differential Revision: https://reviews.llvm.org/D28539
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291692
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Wed, 11 Jan 2017 19:05:27 +0000 (19:05 +0000)]
[lib/Object] Unbreak build with -Werror (unused variable). NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291691
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 11 Jan 2017 18:48:00 +0000 (18:48 +0000)]
[X86][XOP] Add vpermil2ps target shuffle -> insertps combine test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291690
91177308-0d34-0410-b5e6-
96231b3b80d8
Greg Clayton [Wed, 11 Jan 2017 17:43:37 +0000 (17:43 +0000)]
Remove all variants of DWARFDie::getAttributeValueAs...() that had parameters that specified default values.
Now we only support returning Optional<> values and have changed all clients over to use Optional::getValueOr().
Differential Revision: https://reviews.llvm.org/D28569
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291686
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Wed, 11 Jan 2017 17:33:37 +0000 (17:33 +0000)]
GlobalISel: only print debug info with -debug. NFC.
Turns out DEBUG(...) has uses even inside NDEBUG checks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291685
91177308-0d34-0410-b5e6-
96231b3b80d8
Ivan Krasin [Wed, 11 Jan 2017 16:54:04 +0000 (16:54 +0000)]
Revert rL291205 because it breaks Chrome tests under CFI.
Summary:
Revert LowerTypeTests: Split the pass in two: a resolution phase and a lowering phase.
This change separates how type identifiers are resolved from how intrinsic
calls are lowered. All information required to lower an intrinsic call
is stored in a new TypeIdLowering data structure. The idea is that this
data structure can either be initialized using the module itself during
regular LTO, or using the module summary in ThinLTO backends.
Original URL: https://reviews.llvm.org/D28341
Reviewers: pcc
Subscribers: mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D28532
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291684
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 11 Jan 2017 16:42:31 +0000 (16:42 +0000)]
build_llvm_package.bat: Add note about what SWIG version to use
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291682
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 11 Jan 2017 16:38:20 +0000 (16:38 +0000)]
Remove trailing whitespace. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291680
91177308-0d34-0410-b5e6-
96231b3b80d8