Pavel Labath [Tue, 12 Jul 2016 15:07:18 +0000 (15:07 +0000)]
[test] Fix category-based skipping
Summary:
LLDBTestResult.hardMarkAsSkipped marked the whole class as skipped when the first class in the
test failed the category check. This meant that subsequent tests in the same class did not run
even if they were passing the category filter. Fix that.
Reviewers: tfiala
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D22213
llvm-svn: 275173
Saleem Abdulrasool [Tue, 12 Jul 2016 14:39:13 +0000 (14:39 +0000)]
Add option to disable __deallocate #warning
From r229162:
Visual Studio's SAL extension uses a macro named __deallocate. This
macro is used pervasively
Using -Werror when building for Windows can force the use of -Wno-#warnings
specifically because of this __deallocate #warning. Instead of forcing
builds to disable all #warnings, this option allows libc++ to be built
without this particular warning, while leaving other #warnings enabled.
Patch by Dave Lee!
llvm-svn: 275172
Marshall Clow [Tue, 12 Jul 2016 14:38:59 +0000 (14:38 +0000)]
Put the status in the right column
llvm-svn: 275171
Marshall Clow [Tue, 12 Jul 2016 14:37:39 +0000 (14:37 +0000)]
Mark P0067 as 'postponed', because it will be revised before the next meeting
llvm-svn: 275170
Michael Zuckerman [Tue, 12 Jul 2016 12:42:27 +0000 (12:42 +0000)]
[Clang][AVX512] Making cosmetic changes
llvm-svn: 275169
Nemanja Ivanovic [Tue, 12 Jul 2016 12:16:27 +0000 (12:16 +0000)]
[PowerPC] Cannonicalize applicable vector shift immediates as swaps
This patch corresponds to review:
http://reviews.llvm.org/D21358
Vector shifts that have the same semantics as a vector swap are cannonicalized
as such to provide additional opportunities for swap removal optimization to
remove unnecessary swaps.
llvm-svn: 275168
Amjad Aboud [Tue, 12 Jul 2016 12:06:34 +0000 (12:06 +0000)]
[codeview] Improved array type support.
Added support for:
1. Multi dimension array.
2. Array of structure type, which previously was declared incompletely.
3. Dynamic size array.
4. Array where element type is a typedef, volatile or constant (this should resolve PR28311).
Differential Revision: http://reviews.llvm.org/D21526
llvm-svn: 275167
George Rimar [Tue, 12 Jul 2016 09:49:43 +0000 (09:49 +0000)]
Recommit r275161 "[ELF] - Move section factory out from writer to make it reusable."
With fix:
* fixed compilation error under linux:
template <class ELFT> class OutputSectionFactory {
...
typedef typename SectionKey<ELFT::Is64Bits> Key;
changed to:
template <class ELFT> class OutputSectionFactory {
...
typedef typename elf::SectionKey<ELFT::Is64Bits> Key;
llvm-svn: 275166
Pavel Labath [Tue, 12 Jul 2016 09:37:55 +0000 (09:37 +0000)]
Fix a race on process exit
Summary:
Process::SetExitStatus was popping the process io handler and resetting m_process_input_reader
shared pointer, which is not a safe thing to do as the function is called asynchronously and
other threads may be accessing the member variable. (E.g. if the process terminates really
quickly, the private state thread might only be in the process of pushing the handler on the
stack. Sometimes, this leads to deadlock, as the shared pointer's state gets corrupted by the
concurrent access.
Since the IOHandler will be popped anyway in Process:HandleProcessStateChangedEvent when the
exited event gets processed, doing the same in SetExitStatus seems to be unnecessary.
Reviewers: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D22209
llvm-svn: 275165
Pavel Labath [Tue, 12 Jul 2016 09:26:30 +0000 (09:26 +0000)]
Dwarf parser: don't lookup void typedefs in the DWO
Summary:
void typedefs do not have a DW_AT_type attribute, so we end up with an empty encoding_uid
variable. These don't need to be looked up and trying to look that will assert in a debug build.
Reviewers: clayborg
Subscribers: lldb-commits, tberghammer
Differential Revision: http://reviews.llvm.org/D22218
llvm-svn: 275164
George Rimar [Tue, 12 Jul 2016 09:11:13 +0000 (09:11 +0000)]
Revert r275161 "[ELF] - Move section factory out from writer to make it reusable."
It broke build bot:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-debian-fast/builds/39652
llvm-svn: 275163
George Rimar [Tue, 12 Jul 2016 08:50:42 +0000 (08:50 +0000)]
[ELF] - Make few members of Writer to be global and export them for reuse
Creating sections on linkerscript side requires some methods
that can be reused if are exported from writer.
Patch implements that change.
Differential revision: http://reviews.llvm.org/D20104
llvm-svn: 275162
George Rimar [Tue, 12 Jul 2016 08:38:04 +0000 (08:38 +0000)]
[ELF] - Move section factory out from writer to make it reusable.
Since linkerscript should create sections by itself
(if SECTIONS command is present),
then we might want to reuse the OutputSectionFactory (D19976 already do that now),
so this patch moves it out from writer cpp file for that purpose.
Differential revision: http://reviews.llvm.org/D19977
llvm-svn: 275161
Nicolai Haehnle [Tue, 12 Jul 2016 08:12:16 +0000 (08:12 +0000)]
AMDGPU: Unify MOVRELSOffset and MOVRELDOffset
Summary:
Previously, constant index insertelements would be turned into SI_INDIRECT_DST,
which is bound to prevent some optimization opportunities. Worse, it mislead
the heuristic that decides whether immediates should be lowered to S_MOV_B32
or V_MOV_B32 in a way that resulted in unnecessary v_readfirstlanes.
Reviewers: arsenm, tstellarAMD
Subscribers: arsenm, kzhuravl, llvm-commits
Differential Revision: http://reviews.llvm.org/D22217
llvm-svn: 275160
George Rimar [Tue, 12 Jul 2016 07:44:40 +0000 (07:44 +0000)]
[ELF] - Add Id field to Version struct.
That helps to avoid expressions like I + 2 in code
that assigns version number to symbols.
Change was suggested by Rui Ueyama.
Differential revision: http://reviews.llvm.org/D22086
llvm-svn: 275159
Eugene Leviant [Tue, 12 Jul 2016 06:39:48 +0000 (06:39 +0000)]
[ELF] Support for symbol assignment in linker scripts within SECTIONS {} block
llvm-svn: 275158
Clement Courbet [Tue, 12 Jul 2016 06:36:00 +0000 (06:36 +0000)]
[ASTMatchers] isSignedInteger() and isUnsignedInteger()
Complementary to isInteger(), these match signed and unsigned integers
respectively.
Review: http://reviews.llvm.org/D21989
llvm-svn: 275157
Vitaly Buka [Tue, 12 Jul 2016 06:25:32 +0000 (06:25 +0000)]
Revert "New pass manager for LICM."
Summary: This reverts commit r275118.
Subscribers: sanjoy, mehdi_amini
Differential Revision: http://reviews.llvm.org/D22259
llvm-svn: 275156
Craig Topper [Tue, 12 Jul 2016 05:27:53 +0000 (05:27 +0000)]
[AVX512] Remove masked logic op intrinsics and autoupgrade them to native IR.
llvm-svn: 275155
David Majnemer [Tue, 12 Jul 2016 04:42:50 +0000 (04:42 +0000)]
[MS ABI] Support throwing/catching __unaligned types
We need to mark the appropriate bits in ThrowInfo and HandlerType so
that the personality routine can correctly handle qualification
conversions.
llvm-svn: 275154
Rui Ueyama [Tue, 12 Jul 2016 03:49:41 +0000 (03:49 +0000)]
Remove unused parameters.
llvm-svn: 275153
Rui Ueyama [Tue, 12 Jul 2016 03:33:48 +0000 (03:33 +0000)]
Dump enum unique names.
llvm-svn: 275152
Jason Molenda [Tue, 12 Jul 2016 03:25:22 +0000 (03:25 +0000)]
Add some safety checks to Platform::GetRemoteSharedModule so if it
is passed a ModuleSpec with a UUID, it won't accept a file it finds
with a matching FileSpec & ArchSpec, but with a different UUID.
<rdar://problem/
27258864>
llvm-svn: 275151
Rui Ueyama [Tue, 12 Jul 2016 03:25:03 +0000 (03:25 +0000)]
Re-enable TPI hash verification for enum records.
We didn't read unique names correctly. As a result, we computed
hashes on (non-)unique names instead of unique names.
llvm-svn: 275150
Duncan P. N. Exon Smith [Tue, 12 Jul 2016 03:18:50 +0000 (03:18 +0000)]
X86: Avoid implicit iterator conversions, NFC
Avoid implicit conversions from MachineInstrBundleIterator to
MachineInstr*, mainly by preferring MachineInstr& over MachineInstr* and
using range-based for loops.
llvm-svn: 275149
NAKAMURA Takumi [Tue, 12 Jul 2016 03:01:22 +0000 (03:01 +0000)]
Fix libdeps in r275125. LTO tools require BitReader.
llvm-svn: 275148
Ivan Krasin [Tue, 12 Jul 2016 02:38:37 +0000 (02:38 +0000)]
Print remarks from WholeProgramDevirt pass for each call site.
Summary:
It's useful to have some visibility about which call sites are devirtualized,
especially for debug purposes. Another use case is a regression test on the
application side (like, Chromium).
Reviewers: pcc
Differential Revision: http://reviews.llvm.org/D22252
llvm-svn: 275145
NAKAMURA Takumi [Tue, 12 Jul 2016 02:18:09 +0000 (02:18 +0000)]
llvm/test/CodeGen/AMDGPU/selected-stack-object.ll REQUIRES +Asserts, since it expects assertion failure.
llvm-svn: 275144
Haicheng Wu [Tue, 12 Jul 2016 02:04:01 +0000 (02:04 +0000)]
[Kryo] Enable ZCZeroing feature
This feature uses immediate #0 to zero a register.
Differential Revision: http://reviews.llvm.org/D19985
llvm-svn: 275143
Duncan P. N. Exon Smith [Tue, 12 Jul 2016 01:55:32 +0000 (01:55 +0000)]
Hexagon: Avoid implicit iterator conversions, NFC
Avoid implicit iterator conversions from MachineInstrBundleIterator to
MachineInstr* in the Hexagon backend, mostly by preferring MachineInstr&
over MachineInstr* and switching to range-based for loops.
There's a long tail of API cleanup here, but I'm planning to leave the
rest to the Hexagon maintainers. HexagonInstrInfo defines many of its
own predicates, and most of them still take MachineInstr*. Some of
those actually check for nullptr, so I didn't feel comfortable changing
them to MachineInstr& en masse.
llvm-svn: 275142
Duncan P. N. Exon Smith [Tue, 12 Jul 2016 01:47:02 +0000 (01:47 +0000)]
Mips: Avoid implicit iterator conversions, NFC
Avoid implicit conversions from MachineInstrBundleIterator to
MachineInstr* in the Mips backend, mainly by preferring MachineInstr&
over MachineInstr* when a pointer isn't nullable and using range-based
for loops.
llvm-svn: 275141
Stephane Sezer [Tue, 12 Jul 2016 01:44:58 +0000 (01:44 +0000)]
Add LLVM build config for BuildAndIntegration.
Reviewers: tfiala, clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D22234
llvm-svn: 275140
Stephane Sezer [Tue, 12 Jul 2016 01:43:46 +0000 (01:43 +0000)]
Make ThreadPlanStepInstruction's constructor public.
Summary:
Some thread plans have public contructors, some others have protected
constructors with friend classes. Not sure how these were determined,
but this thread plan is going to be required to implement trampoline
step-through on Windows.
Reviewers: clayborg, zturner
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D22230
llvm-svn: 275139
Craig Topper [Tue, 12 Jul 2016 01:42:33 +0000 (01:42 +0000)]
[X86,IR] Remove unnecessary or unused LLVMContext parameter from some of the X86 intrinsic upgrade functions.
llvm-svn: 275138
Duncan P. N. Exon Smith [Tue, 12 Jul 2016 01:39:01 +0000 (01:39 +0000)]
SystemZ: Avoid implicit iterator conversions, NFC
Avoid implicit conversions from MachineInstrBundleIterator to
MachineInstr* in the SystemZ backend, mainly by preferring MachineInstr&
over MachineInstr* and using range-based for loops.
llvm-svn: 275137
Etienne Bergeron [Tue, 12 Jul 2016 01:30:58 +0000 (01:30 +0000)]
fix incorrect constant (from reviews.llvm.org/D22111)
llvm-svn: 275136
Nico Weber [Tue, 12 Jul 2016 01:30:35 +0000 (01:30 +0000)]
Teach FastISel about thiscall (and, hence, about callee-pop).
http://reviews.llvm.org/D22115
llvm-svn: 275135
Stephane Sezer [Tue, 12 Jul 2016 01:28:59 +0000 (01:28 +0000)]
Apply local patches when building llvm on Mac.
Summary:
This is already done when building for linux with the CMake build
system. This functionality disappeared recently when some of the build
scripts used by the xcode build system changed.
Reviewers: tfiala, clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D22233
llvm-svn: 275134
Matt Arsenault [Tue, 12 Jul 2016 00:23:17 +0000 (00:23 +0000)]
AMDGPU: Cleanup pseudoinstructions
llvm-svn: 275133
Matt Arsenault [Tue, 12 Jul 2016 00:08:14 +0000 (00:08 +0000)]
AMDGPU: Fix missing scc def on control flow pseudos
These are all expanded to instructions that include an scc def.
llvm-svn: 275132
Matt Arsenault [Mon, 11 Jul 2016 23:56:30 +0000 (23:56 +0000)]
AMDGPU: Enable trackLivenessAfterRegAlloc
This has caught a number of bugs.
llvm-svn: 275131
Mehdi Amini [Mon, 11 Jul 2016 23:55:01 +0000 (23:55 +0000)]
Do not use bool in C header lto.h, use lto_bool_t instead
llvm-svn: 275130
Matt Arsenault [Mon, 11 Jul 2016 23:35:48 +0000 (23:35 +0000)]
AMDGPU: Remove superfluous string attributes from tests
Also fix v_mac.ll not testing right thing for fneg
llvm-svn: 275129
Wolfgang Pieb [Mon, 11 Jul 2016 23:27:19 +0000 (23:27 +0000)]
Correcting the previous fix for test submitted with r275115.
llvm-svn: 275128
Wolfgang Pieb [Mon, 11 Jul 2016 23:20:28 +0000 (23:20 +0000)]
Fix test submitted with r275115 (failed on ppc64 buildbots).
llvm-svn: 275127
George Burgess IV [Mon, 11 Jul 2016 23:18:32 +0000 (23:18 +0000)]
Attempt to make buildbots happy.
Woohoo, unused variable warnings in builds without asserts (as a result
of r275122).
llvm-svn: 275126
Mehdi Amini [Mon, 11 Jul 2016 23:10:18 +0000 (23:10 +0000)]
Add a libLTO API to query a memory buffer and check if it contains ObjC categories
The linker supports a feature to force load an object from a static
archive if it defines an Objective-C category.
This API supports this feature by looking at every section in the
module to find if a category is defined in the module.
llvm-svn: 275125
Etienne Bergeron [Mon, 11 Jul 2016 23:09:33 +0000 (23:09 +0000)]
missing modifications for reviews.llvm.org/D21952
llvm-svn: 275124
Etienne Bergeron [Mon, 11 Jul 2016 23:02:18 +0000 (23:02 +0000)]
[compiler-rt] Refactor the interception code on windows.
Summary:
This is a cleanup and refactoring of the interception code on windows
Enhancement:
* Adding the support for 64-bits code
* Adding several hooking technique:
* Detour
* JumpRedirect
* HotPatch
* Trampoline
* Adding a trampoline memory pool (64-bits) and release the allocated memory in unittests
Cleanup:
* Adding unittests for 64-bits hooking techniques
* Enhancing the RoundUpInstruction by sharing common decoder
Reviewers: rnk
Subscribers: llvm-commits, wang0109, chrisha
Differential Revision: http://reviews.llvm.org/D22111
llvm-svn: 275123
George Burgess IV [Mon, 11 Jul 2016 22:59:09 +0000 (22:59 +0000)]
[CFLAA] Simplify CFLGraphBuilder. NFC.
This patch simplifies the graph builder by encoding nodes as {Value,
Dereference Level} pairs. This lets us kill edge types, and allows us to
get rid of hacks in StratifiedSets (like addAttrsBelow/...). This
simplification also allows us to remove InstantiatedRelations and
InstantiatedAttrs.
Patch by Jia Chen.
Differential Revision: http://reviews.llvm.org/D22080
llvm-svn: 275122
Vedant Kumar [Mon, 11 Jul 2016 22:57:46 +0000 (22:57 +0000)]
[Coverage] Do not map regions from system headers
Do not assign source regions located within system headers file ID's,
and do not construct counter mapping regions out of them.
This makes coverage reports less cluttered and less mysterious. E.g
using the "assert" macro doesn't cause assert.h to appear in reports,
and it no longer shows the "assertion failed" branch as an uncovered
region.
It also makes coverage mapping sections a bit smaller (e.g a 1%
reduction in a stage2 build of bin/llvm-as).
llvm-svn: 275121
Vedant Kumar [Mon, 11 Jul 2016 22:57:44 +0000 (22:57 +0000)]
[Coverage] Move logic to skip decl's into a helper (NFC)
llvm-svn: 275120
Greg Clayton [Mon, 11 Jul 2016 22:50:18 +0000 (22:50 +0000)]
Fixed a threading race condition where we could crash after calling Debugger::Terminate().
The issue was we have two global variables: one that contains a DebuggerList pointer and one that contains a std::mutex pointer. These get initialized in Debugger::Initialize(), and everywhere that uses these does:
if (g_debugger_list_ptr && g_debugger_list_mutex_ptr)
{
std::lock_guard<std::recursive_mutex> guard(*g_debugger_list_mutex_ptr);
// do work while mutex is locked
}
Debugger::Terminate() was deleting and nulling out g_debugger_list_ptr which meant we had a race condition where someone might do the if statement and it evaluates to true, then another thread calls Debugger::Terminate() and deletes and nulls out g_debugger_list_ptr while holding the mutex, and another thread then locks the mutex and tries to use g_debugger_list_ptr. The fix is to just not delete and null out the g_debugger_list_ptr variable.
llvm-svn: 275119
Dehao Chen [Mon, 11 Jul 2016 22:45:24 +0000 (22:45 +0000)]
New pass manager for LICM.
Summary: Port LICM to the new pass manager.
Reviewers: davidxl, silvas
Subscribers: silvas, davide, sanjoy, llvm-commits, mehdi_amini
Differential Revision: http://reviews.llvm.org/D21772
llvm-svn: 275118
Alina Sbirlea [Mon, 11 Jul 2016 22:34:29 +0000 (22:34 +0000)]
Correct ordering of loads/stores.
Summary:
Aiming to correct the ordering of loads/stores. This patch changes the
insert point for loads to the position of the first load.
It updates the ordering method for loads to insert before, rather than after.
Before this patch the following sequence:
"load a[1], store a[1], store a[0], load a[2]"
Would incorrectly vectorize to "store a[0,1], load a[1,2]".
The correctness check was assuming the insertion point for loads is at
the position of the first load, when in practice it was at the last
load. An alternative fix would have been to invert the correctness check.
The current fix changes insert position but also requires reordering of
instructions before the vectorized load.
Updated testcases to reflect the changes.
Reviewers: tstellarAMD, llvm-commits, jlebar, arsenm
Subscribers: mzolotukhin
Differential Revision: http://reviews.llvm.org/D22071
llvm-svn: 275117
Tim Northover [Mon, 11 Jul 2016 22:29:37 +0000 (22:29 +0000)]
ARM: validate immediate branch targets in AsmParser.
Immediate branch targets aren't commonly used, but if they are we should make
sure they can actually be encoded. This means they must be divisible by 2 when
targeting Thumb mode, and by 4 when targeting ARM mode.
Also do a little naming cleanup while I was changing everything around anyway.
llvm-svn: 275116
Wolfgang Pieb [Mon, 11 Jul 2016 22:22:23 +0000 (22:22 +0000)]
Prevent the creation of empty (forwarding) blocks resulting from nested ifs.
Summary:
Nested if statements can generate empty BBs whose terminator branches
unconditionally to its successor. These branches are not eliminated
to help generate better line number information in some cases, but there
is no reason to keep the empty blocks that result from nested ifs.
Reviewers: mehdi_amini, dblaikie, echristo
Subscribers: mehdi_amini, cfe-commits
Differential review: http://reviews.llvm.org/D11360
llvm-svn: 275115
Eric Fiselier [Mon, 11 Jul 2016 22:02:02 +0000 (22:02 +0000)]
Don't compute modulus of hash if it is smaller than the bucket count.
This cleans up a previous optimization attempt in hash, and results in
additional performance improvements over that previous attempt. Additionally
this new optimization does not hinder the power of 2 bucket count optimization.
llvm-svn: 275114
Nicolai Haehnle [Mon, 11 Jul 2016 21:59:43 +0000 (21:59 +0000)]
AMDGPU: Treat texture gather instructions more like other MIMG instructions
Summary:
Setting MIMG to 0 has a bunch of unexpected side effects, including that
isVMEM returns false which leads to incorrect treatment in the hazard
recognizer. The reason I noticed it is that it also leads to incorrect
treatment in VGPR-to-SGPR copies, which is one cause of the referenced bug.
The only reason why MIMG was set to 0 is to signal the special handling of
dmasks, but that can be checked differently.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96877
Reviewers: arsenm, tstellarAMD
Subscribers: arsenm, kzhuravl, llvm-commits
Differential Revision: http://reviews.llvm.org/D22210
llvm-svn: 275113
Etienne Bergeron [Mon, 11 Jul 2016 21:57:11 +0000 (21:57 +0000)]
remove empty lines
llvm-svn: 275112
Etienne Bergeron [Mon, 11 Jul 2016 21:51:56 +0000 (21:51 +0000)]
[compiler-rt] Fix VisualStudio virtual folders layout
Summary:
This patch is a refactoring of the way cmake 'targets' are grouped.
It won't affect non-UI cmake-generators.
Clang/LLVM are using a structured way to group targets which ease
navigation through Visual Studio UI. The Compiler-RT projects
differ from the way Clang/LLVM are grouping targets.
This patch doesn't contain behavior changes.
Reviewers: kubabrecka, rnk
Subscribers: wang0109, llvm-commits, kubabrecka, chrisha
Differential Revision: http://reviews.llvm.org/D21952
llvm-svn: 275111
Zachary Turner [Mon, 11 Jul 2016 21:45:26 +0000 (21:45 +0000)]
Refactor the PDB writing to use a builder approach
llvm-svn: 275110
Zachary Turner [Mon, 11 Jul 2016 21:45:09 +0000 (21:45 +0000)]
[pdb] Add a pdb2yaml option to not dump file headers.
This will be useful once we start adding the ability to dump type
records and symbol records, since it will allow us to generate
mergeable information instead of information that specifies an
entire file.
llvm-svn: 275109
Nicolai Haehnle [Mon, 11 Jul 2016 21:44:40 +0000 (21:44 +0000)]
AMDGPU: fix local stack slot allocation bugs
Summary:
The main bug fix here is using the 32-bit encoding of V_ADD_I32 in
materializeFrameBaseRegister and resolveFrameIndex, so that arbitrary
immediates work.
The second part is that we may now require the SegmentWaveByteOffset
even when there are initially no stack objects and VGPR spilling isn't
enabled, for stack slots that are allocated later. This means that some
bits become effectively dead and can be cleaned up.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96602
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewers: arsenm, tstellarAMD
Subscribers: arsenm, llvm-commits, kzhuravl
Differential Revision: http://reviews.llvm.org/D21551
llvm-svn: 275108
Etienne Bergeron [Mon, 11 Jul 2016 21:40:59 +0000 (21:40 +0000)]
[asan] Add exception handler to map memory on demand on Win64.
Memory will be committed on demand when exception happens while accessing
shadow memeory region.
Patch by: Wei Wang
Differential Revision: http://reviews.llvm.org/D21942
llvm-svn: 275107
Michael Kuperstein [Mon, 11 Jul 2016 21:39:44 +0000 (21:39 +0000)]
[X86] Make some cast costs more precise
Make some AVX and AVX512 cast costs more precise.
Based on part of a patch by Elena Demikhovsky (D15604).
Differential Revision: http://reviews.llvm.org/D22064
llvm-svn: 275106
Marshall Clow [Mon, 11 Jul 2016 21:38:08 +0000 (21:38 +0000)]
Always use the allocator to construct/destruct elements of a deque/vector. Fixes PR#28412. Thanks to Jonathan Wakely for the report.
llvm-svn: 275105
Kyle Butt [Mon, 11 Jul 2016 21:37:03 +0000 (21:37 +0000)]
Codegen: Fix comment in BranchFolding.cpp
Blocks to be tail-merged may share more than one successor. Correct the
comment to state that they share a specific successor, SuccBB, rather
than a single successor, which is not true.
llvm-svn: 275104
Quentin Colombet [Mon, 11 Jul 2016 21:03:03 +0000 (21:03 +0000)]
[X86] Fix tailcall return address clobber bug.
This bug (llvm.org/PR28124) was introduced by r237977, which refactored
the tail call sequence to be generated in two passes instead of one.
Unfortunately, the stack adjustment produced by the first pass was not
recognized by X86FrameLowering::mergeSPUpdates() in all cases, causing
code such as the following, which clobbers the return address, to be
generated:
popl %edi
popl %edi
pushl %eax
jmp tailcallee # TAILCALL
To fix the problem, the entire stack adjustment is performed in
X86ExpandPseudo::ExpandMI() for tail calls.
Patch by Magnus Lång <margnus1@gmail.com>
Differential Revision: http://reviews.llvm.org/D21325
llvm-svn: 275103
Sanjay Patel [Mon, 11 Jul 2016 20:50:39 +0000 (20:50 +0000)]
fix documentation comments; NFC
llvm-svn: 275101
Alina Sbirlea [Mon, 11 Jul 2016 20:46:17 +0000 (20:46 +0000)]
Add TLI.allowsMisalignedMemoryAccesses to LoadStoreVectorizer
Summary: Extend TTI to access TLI.allowsMisalignedMemoryAccesses(). Check condition when vectorizing load and store chains.
Add additional parameters: AddressSpace, Alignment, Fast.
Reviewers: llvm-commits, jlebar
Subscribers: arsenm, mzolotukhin
Differential Revision: http://reviews.llvm.org/D21935
llvm-svn: 275100
Michael Kuperstein [Mon, 11 Jul 2016 20:40:44 +0000 (20:40 +0000)]
[X86] Disable FixupSetCC for CodeGenOpt::None
It is an optimization pass, and should not run at -O0. Especially since Fast RA
will not do the required register coalescing anyway, so it's a loss even from
the optimization standpoint.
This also works around (but doesn't quite fix) PR28489.
llvm-svn: 275099
Etienne Bergeron [Mon, 11 Jul 2016 20:37:12 +0000 (20:37 +0000)]
[compiler-rt] Refactor the interception code on windows.
[asan] Fix unittest Asan-x86_64-inline-Test crashing on Windows64
REAL(memcpy) was used in several places in Asan, while REAL(memmove) was not used.
This CL chooses to patch memcpy() first, solving the crash for unittest.
The crash looks like this:
projects\compiler-rt\lib\asan\tests\default\Asan-x86_64-inline-Test.exe
=================================================================
==22680==ERROR: AddressSanitizer: access-violation on unknown address 0x000000000000 (pc 0x000000000000 bp 0x0029d555f590 sp 0x0029d555f438 T0)
==22680==Hint: pc points to the zero page.
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: access-violation (<unknown module>)
==22680==ABORTING
Patch by: Wei Wang
Differential Revision: http://reviews.llvm.org/D22232
llvm-svn: 275098
Erik Pilkington [Mon, 11 Jul 2016 20:00:48 +0000 (20:00 +0000)]
[NFC] Reorder fields of VersionTuple to reduce size
Differential revision: http://reviews.llvm.org/D19934
llvm-svn: 275095
Eric Fiselier [Mon, 11 Jul 2016 19:57:13 +0000 (19:57 +0000)]
Allow is_swappable to SFINAE on deleted/ambiguous swap functions
llvm-svn: 275094
Eric Fiselier [Mon, 11 Jul 2016 19:22:09 +0000 (19:22 +0000)]
Hide some internal symbols for memory resource.
llvm-svn: 275089
Chad Rosier [Mon, 11 Jul 2016 18:45:49 +0000 (18:45 +0000)]
[IPRA] Properly compute register usage at call sites.
Differential Revision: http://reviews.llvm.org/D21395
Patch by Vivek Pandya.
PR28144
llvm-svn: 275087
Zhan Jun Liau [Mon, 11 Jul 2016 18:45:03 +0000 (18:45 +0000)]
[SystemZ] Recognize Load On Condition Immediate (LOCHI/LOGHI) opportunities
Summary: Add support for the z13 instructions LOCHI and LOCGHI which
conditionally load immediate values. Add target instruction info hooks so
that if conversion will allow predication of LHI/LGHI.
Author: RolandF
Reviewers: uweigand
Subscribers: zhanjunl
Commiting on behalf of Roland.
Differential Revision: http://reviews.llvm.org/D22117
llvm-svn: 275086
Weiming Zhao [Mon, 11 Jul 2016 18:27:52 +0000 (18:27 +0000)]
Fix a build warning of unhandled enum in switch
Summary: LLVM adds a new value FMRB_DoesNotReadMemory in the enumeration.
Reviewers: andrew.w.kaylor, chrisj, zinob, grosser, jdoerfert
Subscribers: Meinersbur, pollydev
Differential Revision: http://reviews.llvm.org/D22109
llvm-svn: 275085
Davide Italiano [Mon, 11 Jul 2016 18:21:29 +0000 (18:21 +0000)]
[SCCP] Try to follow the DRY principle, use `OpSt`.
Thanks to Eli Friedman for pointing out in his post-commit review!
llvm-svn: 275084
Jingyue Wu [Mon, 11 Jul 2016 18:13:28 +0000 (18:13 +0000)]
[SLSR] Call getPointerSizeInBits with the correct address space.
llvm-svn: 275083
Davide Italiano [Mon, 11 Jul 2016 18:10:06 +0000 (18:10 +0000)]
[PM/IPO] Port LowerTypeTests to the new PassManager.
There's a little bit of churn in this patch because the initialization
mechanism is now shared between the old and the new PM. Other than
that, it's just a pretty mechanical translation.
llvm-svn: 275082
Jacques Pienaar [Mon, 11 Jul 2016 17:58:16 +0000 (17:58 +0000)]
[lanai] Add more tests for assembly of conditional ALU ops
llvm-svn: 275081
Enrico Granata [Mon, 11 Jul 2016 17:36:55 +0000 (17:36 +0000)]
Fix an issue where one could not define a Python command with the same name as an existing alias (or rather, one could but the results of invoking the command were far from satisfactory)
llvm-svn: 275080
Dehao Chen [Mon, 11 Jul 2016 17:36:02 +0000 (17:36 +0000)]
Fix the assertion failure caused by reviews.llvm.org/D22118
Summary: http://reviews.llvm.org/D22118 uses metadata to store the call count, which makes it possible to have branch weight to have only one elements. Also fix the assertion failure in inliner when checking the instruction type to include "invoke" instruction.
Reviewers: mkuper, dnovillo
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D22228
llvm-svn: 275079
David Majnemer [Mon, 11 Jul 2016 17:09:56 +0000 (17:09 +0000)]
[Sema] Don't artificially forbid BuiltinTemplateDecls in CheckTemplateArgument
After thinking about it, we don't really need to forbid
BuiltinTemplateDecls explicitly. The restriction doesn't really buy us
anything.
llvm-svn: 275078
David Majnemer [Mon, 11 Jul 2016 17:09:06 +0000 (17:09 +0000)]
[IR] Stop a -Wsign-compare warning from firing
llvm-svn: 275077
Adrian Prantl [Mon, 11 Jul 2016 17:03:16 +0000 (17:03 +0000)]
[man page] Document -gline-tables-only in the clang man page.
llvm-svn: 275076
Adrian Prantl [Mon, 11 Jul 2016 17:03:13 +0000 (17:03 +0000)]
[man page] Fix two sphinx build errors.
These options were referenced by other paragraphs, but never specified.
llvm-svn: 275075
Davide Italiano [Mon, 11 Jul 2016 17:00:31 +0000 (17:00 +0000)]
[LowerTypeTests] Don't rely on doInitialization().
In preparation for porting this pass to the new PM (which has no
doInitialization()).
Differential Revision: http://reviews.llvm.org/D22223
llvm-svn: 275074
Dehao Chen [Mon, 11 Jul 2016 16:48:54 +0000 (16:48 +0000)]
Implement callsite-hotness based inline cost for Sample-based PGO
Summary:
For sample-based PGO, using BFI to calculate callsite count is sometime not accurate. This is because with sampling based approach, if a callsite resides in a hot loop deeply nested in a bunch of cold branches, the callsite's BFI frequency would be inaccurately calculated due to lack of samples in the cold branch.
E.g.
if (A1 && A2 && A3 && ..... && A10) {
for (i=0; i <
100000000; i++) {
callsite();
}
}
Assume that A1 to A100 are all 100% taken, and callsite has 1000 samples and thus is considerred hot. Because the loop's trip count is huge, it's normal that all branches outside the loop has no sample at all. As a result, we can only use static branch probability to derive the the frequency of the loop header. Assuming that static heuristic thinks each branch is 50% taken, then the count calculated from BFI will be 1/(2^10) of the actual value.
In order to get more accurate callsite count, we directly annotate the weight on the call instruction, and directly use it when checking callsite hotness.
Note that this mechanism can also be shared by instrumentation based callsite hotness analysis. The side benefit is that it breaks the dependency from Inliner to BFI as call count is embedded in the IR.
Reviewers: davidxl, eraman, dnovillo
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D22118
llvm-svn: 275073
Dehao Chen [Mon, 11 Jul 2016 16:40:17 +0000 (16:40 +0000)]
Tune the weight propagation algorithm for sample profile.
Summary: Handle the case when there is only one incoming/outgoing edge for a visited basic block: use the block weight to adjust edge weight even when the edge has been visited before. This can help reduce inaccuracies introduced by incorrect basic block profile, as shown in the updated unittest.
Reviewers: davidxl, dnovillo
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D22180
llvm-svn: 275072
Kuba Brecka [Mon, 11 Jul 2016 15:57:50 +0000 (15:57 +0000)]
[tsan] Add support for GCD IO channels on Darwin
This patch adds interceptors for dispatch_io_*, dispatch_read and dispatch_write functions. This avoids false positives when using GCD IO. Adding several test cases.
Differential Revision: http://reviews.llvm.org/D21889
llvm-svn: 275071
Sanjay Patel [Mon, 11 Jul 2016 15:08:37 +0000 (15:08 +0000)]
[x86] make some of the tests 256-bit for testing diversity
llvm-svn: 275070
Nirav Dave [Mon, 11 Jul 2016 14:32:57 +0000 (14:32 +0000)]
Add missing include from previous commit
llvm-svn: 275069
Nirav Dave [Mon, 11 Jul 2016 14:23:53 +0000 (14:23 +0000)]
Fix branch relaxation in 16-bit mode.
Thread through MCSubtargetInfo to relaxInstruction function allowing relaxation
to generate jumps with 16-bit sized immediates in 16-bit mode.
This fixes PR22097.
Reviewers: dwmw2, tstellarAMD, craig.topper, jyknight
Subscribers: jfb, arsenm, jyknight, llvm-commits, dsanders
Differential Revision: http://reviews.llvm.org/D20830
llvm-svn: 275068
Sanjay Patel [Mon, 11 Jul 2016 14:17:54 +0000 (14:17 +0000)]
[x86] specify triple to avoid bot failures
llvm-svn: 275067
Nicolai Haehnle [Mon, 11 Jul 2016 14:11:51 +0000 (14:11 +0000)]
[Sink] Don't move calls to readonly functions across stores
Summary:
Reviewers: hfinkel, majnemer, tstellarAMD, sunfish
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D17279
llvm-svn: 275066
Nicolai Haehnle [Mon, 11 Jul 2016 14:11:45 +0000 (14:11 +0000)]
AliasAnalysis: unify getModRefInfo(I, CS) semantics with other overloads
This subtle change to getModRefInfo(Instruction, ImmutableCallSite) is to
ensure that the semantics are equal to that of getModRefInfo(CS1, CS2) when
the Instruction is a call-site.
This is now more in line with getModRefInfo generally: it returns Mod when
I modifies a memory location that is accessed (read or written) by CS and
Ref when I reads a memory location that is written by CS.
From a grep of the code, the only uses of this particular getModRefInfo
overload are in MemorySSA and MemCpyOptimizer, and they only care about
where the result is MR_NoModRef or not. Therefore, this change should have
no visible effect.
Separated out from D17279 upon request.
llvm-svn: 275065
Sanjay Patel [Mon, 11 Jul 2016 14:07:31 +0000 (14:07 +0000)]
[x86] update checks
llvm-svn: 275064