Akira Hatanaka [Wed, 27 Nov 2013 23:38:42 +0000 (23:38 +0000)]
[mips] Implement the following optimizations using dominance information to
make PIC calls a little more efficient:
1. Remove instructions setting up $gp if it is known that a function has been
called at least once.
2. Save the address of a called function in a register instead of loading
it from the GOT at every call site.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195892
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Wed, 27 Nov 2013 23:26:09 +0000 (23:26 +0000)]
Add IIC_ prefix to PPC instruction-class names
This adds the IIC_ prefix to the instruction itinerary class names, giving the
PPC backend a naming convention for itinerary classes that is more consistent
with that used by the X86 and ARM backends.
Instruction scheduling in the PPC backend needs a bunch of cleanup and
improvement (especially for the ooo cores). This is just a preliminary step.
No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195890
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 27 Nov 2013 21:57:54 +0000 (21:57 +0000)]
Don't set GlobalPrefix to the default value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195884
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 27 Nov 2013 21:52:37 +0000 (21:52 +0000)]
The R600 has its own asm printer which doesn't use GlobalPrefix. Drop it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195883
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 27 Nov 2013 21:23:39 +0000 (21:23 +0000)]
R600: Expand vector FABS
NOTE: This is a candidate for the 3.4 branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195881
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 27 Nov 2013 21:23:35 +0000 (21:23 +0000)]
R600/SI: Implement spilling of SGPRs v5
SGPRs are spilled into VGPRs using the {READ,WRITE}LANE_B32 instructions.
v2:
- Fix encoding of Lane Mask
- Use correct register flags, so we don't overwrite the low dword
when restoring multi-dword registers.
v3:
- Register spilling seems to hang the GPU, so replace all shaders
that need spilling with a dummy shader.
v4:
- Fix *LANE definitions
- Change destination reg class for 32-bit SMRD instructions
v5:
- Remove small optimization that was crashing Serious Sam 3.
https://bugs.freedesktop.org/show_bug.cgi?id=68224
https://bugs.freedesktop.org/show_bug.cgi?id=71285
NOTE: This is a candidate for the 3.4 branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195880
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 27 Nov 2013 21:23:29 +0000 (21:23 +0000)]
R600/SI: Use SGPR_32 register class for 32-bit SMRD outputs
Writing to the M0 register from an SMRD instruction hangs the GPU, so
we need to use the SGPR_32 register class, which does not include M0.
NOTE: This is a candidate for the 3.4 branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195879
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 27 Nov 2013 21:23:20 +0000 (21:23 +0000)]
R600: Add support for ISD::FROUND
NOTE: This is a candidate for the 3.4 branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195878
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Wed, 27 Nov 2013 20:10:16 +0000 (20:10 +0000)]
Show stackmap entry encodings in stackmap debug logs. This makes it easier to
cross-reference debug output with encoded stack-maps, and to create stackmap
test-cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195874
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 27 Nov 2013 19:22:14 +0000 (19:22 +0000)]
Use FileCheck and expand the test a bit.
In particular, check the name of the symbol we are putting in the constant pool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195865
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 27 Nov 2013 18:38:14 +0000 (18:38 +0000)]
Remove dead code.
MO_ExternalSymbol and MO_JumpTableIndex don't show up in inline asm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195861
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 27 Nov 2013 18:26:51 +0000 (18:26 +0000)]
Convert two if sequences to switches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195859
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 27 Nov 2013 18:18:24 +0000 (18:18 +0000)]
Use a switch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195857
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 27 Nov 2013 15:52:11 +0000 (15:52 +0000)]
Use the same tls section name as msvc.
We currently error in clang with:
"error: thread-local storage is unsupported for the current target", but we
can start to get the llvm level ready.
When compiling
template<typename T>
struct foo {
static __declspec(thread) int bar;
};
template<typename T>
__declspec(therad) int foo<T>::bar;
template struct foo<int>;
msvc produces
SECTION HEADER #3
.tls$ name
0 physical address
0 virtual address
4 size of raw data
12F file pointer to raw data (
0000012F to
00000132)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0301040 flags
Initialized Data
COMDAT; sym= "public: static int foo<int>::bar" (?bar@?$foo@H@@2HA)
4 byte align
Read Write
gcc produces a ".data$__emutls_v.<symbol>" for the testcase with
__declspec(thread) replaced with thread_local.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195849
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 27 Nov 2013 15:13:06 +0000 (15:13 +0000)]
Remove more dead code now that this is only used for inline asm.
MO_ConstantPoolIndex is handled in printLeaMemReference.
MO_JumpTableIndex and MO_ExternalSymbol don't show up in inline asm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195847
91177308-0d34-0410-b5e6-
96231b3b80d8
Jiangning Liu [Wed, 27 Nov 2013 14:02:25 +0000 (14:02 +0000)]
Fix the AArch64 NEON bug exposed by checking constant integer argument range of ACLE intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195843
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Wed, 27 Nov 2013 11:03:18 +0000 (11:03 +0000)]
[OCaml] Embed rpath into stub libraries and native executables
This commit embeds a set of linker flags with hardcoded paths to
the LLVM shared library on --enable-shared builds into .cmxa files
and stub dynamic libraries. This solution closely follows existing
rules for rpath in the LLVM tools, which had to be modified because
of differences in toolchain.
Without this patch, OCaml tests as well as opam bindings broke,
as neither of those updates LD_LIBRARY_PATH to include
the $prefix/lib directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195834
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 27 Nov 2013 07:34:09 +0000 (07:34 +0000)]
Convert more methods in static helpers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195826
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 27 Nov 2013 07:14:26 +0000 (07:14 +0000)]
Convert these methods into static functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195825
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 27 Nov 2013 06:53:13 +0000 (06:53 +0000)]
Cleanup and test X86AsmPrinter::printPCRelImm.
It is only used for asm printing.
On X86 we put basic block addresses on register before passing them to inline
asm, so the MO_MachineBasicBlock case was dead.
MO_ExternalSymbol was dead since any symbol being passed to inline asm
is represented as MO_GlobalAddress.
The MO_GlobalAddress and MO_Register cases were not tested.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195824
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Wed, 27 Nov 2013 04:55:23 +0000 (04:55 +0000)]
[docs] Mention gotcha regarding implicit BB numbering
Impetus for the clarification by Mikael Lyngvig.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195812
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Wed, 27 Nov 2013 03:12:56 +0000 (03:12 +0000)]
Fix comment in PPCA2Model
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195807
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 27 Nov 2013 02:25:20 +0000 (02:25 +0000)]
Remove dead argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195806
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 27 Nov 2013 01:45:58 +0000 (01:45 +0000)]
[AArch64] Add support for NEON scalar floating-point absolute difference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195803
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 27 Nov 2013 01:32:17 +0000 (01:32 +0000)]
[PM] Remove the underspecified 'getRoot' method from CallGraph. It's
only user was an ancient SCC printing bit of the opt tool which really
should be walking the call graph the same way the CGSCC pass manager
does.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195800
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 27 Nov 2013 01:18:37 +0000 (01:18 +0000)]
Use simple section names for COMDAT sections on COFF.
With this patch we use simple names for COMDAT sections (like .text or .bss).
This matches the MSVC behavior.
When merging it is the COMDAT symbol that is used to decide if two sections
should be merged, so there is no point in building a fancy name.
This survived a bootstrap on mingw32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195798
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 26 Nov 2013 22:36:41 +0000 (22:36 +0000)]
[PM] [cleanup] Replace a reserved identifier "_Self" with the injected
class name. I think we're no longer using any compilers with
sufficiently broken ICN for this use case, but I'll watch the bots and
introduce a typedef without a reserved name if any yell at me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195793
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Tue, 26 Nov 2013 22:24:25 +0000 (22:24 +0000)]
PR1860 - We can't save a list of ExtractElement instructions to CSE because some of these instructions
may be removed and optimized in future iterations. Instead we save a list of basic blocks that we need to CSE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195791
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 26 Nov 2013 22:23:27 +0000 (22:23 +0000)]
80-column fixups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195790
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 26 Nov 2013 22:17:37 +0000 (22:17 +0000)]
[AArch64] Add support for NEON scalar floating-point to integer convert
instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195788
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnold Schwaighofer [Tue, 26 Nov 2013 22:11:23 +0000 (22:11 +0000)]
LoopVectorizer: Truncate i64 trip counts of i32 phis if necessary
In signed arithmetic we could end up with an i64 trip count for an i32 phi.
Because it is signed arithmetic we know that this is only defined if the i32
does not wrap. It is therefore safe to truncate the i64 trip count to a i32
value.
Fixes PR18049.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195787
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 26 Nov 2013 20:55:11 +0000 (20:55 +0000)]
[PM] [cleanup] Run clang-format over this file. If fixes many
inconsistencies that I'll just need to fix myself as I edit things.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195784
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 26 Nov 2013 20:51:48 +0000 (20:51 +0000)]
[PM] [cleanup] Update doxygen comments to use the new style, add some
doxygen comments, make existing comments doxygen comments etc.
Also, switch commented-out debug helpers to #if-0-ed out debug helpers.
No functionality changed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195783
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Tue, 26 Nov 2013 20:40:34 +0000 (20:40 +0000)]
[OCaml] Embed the flags necessary for linking with libLLVM.so into .cmxa files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195782
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Tue, 26 Nov 2013 20:38:40 +0000 (20:38 +0000)]
Fix a bug related to constant islands for Mips16 and mips16/32 dual mode.
The determination of when we are doing constant pools was being made too
early in the asm printer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195781
91177308-0d34-0410-b5e6-
96231b3b80d8
Diego Novillo [Tue, 26 Nov 2013 20:37:33 +0000 (20:37 +0000)]
Refactor some code in SampleProfile.cpp
I'm adding new functionality in the sample profiler. This will
require more data to be kept around for each function, so I moved
the structure SampleProfile that we keep for each function into
a separate class.
There are no functional changes in this patch. It simply provides
a new home where to place all the new data that I need to propagate
weights through edges.
There are some other name and minor edits throughout.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195780
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Liao [Tue, 26 Nov 2013 20:31:31 +0000 (20:31 +0000)]
Fix PR18054
- Fix bug in (vsext (vzext x)) -> (vsext x) in SIGN_EXTEND_IN_REG
lowering where we need to check whether x is a vector type (in-reg
type) of i8, i16 or i32; otherwise, that optimization is not valid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195779
91177308-0d34-0410-b5e6-
96231b3b80d8
Diego Novillo [Tue, 26 Nov 2013 20:11:12 +0000 (20:11 +0000)]
Add PostDominatorTree::getDescendants.
This patch adds the counter-part to DominatorTree::getDescendants.
It also fixes a couple of comments I noticed out of date in the
DominatorTree class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195778
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 26 Nov 2013 19:14:34 +0000 (19:14 +0000)]
DwarfDebug: Include type units in accelerator tables.
Since type units aren't in the CUMap, use the DwarfUnits list to iterate
over units for tasks such as accelerator table building.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195776
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Tue, 26 Nov 2013 18:54:37 +0000 (18:54 +0000)]
Fix spurious return introduced by my earlier patch to DebugInfo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195775
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Tue, 26 Nov 2013 17:29:19 +0000 (17:29 +0000)]
PR18060 - When we RAUW values with ExtractElement instructions in some cases
we generate PHI nodes with multiple entries from the same basic block but
with different values. Enabling CSE on ExtractElement instructions make sure
that all of the RAUWed instructions are the same.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195773
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Tue, 26 Nov 2013 16:47:00 +0000 (16:47 +0000)]
Add return to DIType::Verify
Code scanner ran by Sylvestre Ledru got a no_return bug
in DebugInfo.cpp. Adding the return statements that
should be there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195772
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Tue, 26 Nov 2013 16:11:03 +0000 (16:11 +0000)]
PR17925 bugfix.
Short description.
This issue is about case of treating pointers as integers.
We treat pointers as different if they references different address space.
At the same time, we treat pointers equal to integers (with machine address
width). It was a point of false-positive. Consider next case on 32bit machine:
void foo0(i32 addrespace(1)* %p)
void foo1(i32 addrespace(2)* %p)
void foo2(i32 %p)
foo0 != foo1, while
foo1 == foo2 and foo0 == foo2.
As you can see it breaks transitivity. That means that result depends on order
of how functions are presented in module. Next order causes merging of foo0
and foo1: foo2, foo0, foo1
First foo0 will be merged with foo2, foo0 will be erased. Second foo1 will be
merged with foo2.
Depending on order, things could be merged we don't expect to.
The fix:
Forbid to treat any pointer as integer, except for those, who belong to address space 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195769
91177308-0d34-0410-b5e6-
96231b3b80d8
Timur Iskhodzhanov [Tue, 26 Nov 2013 13:34:55 +0000 (13:34 +0000)]
Rename DwarfException methods so the new names are consistent with DwarfDebug and the style guide
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195763
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Tue, 26 Nov 2013 12:45:05 +0000 (12:45 +0000)]
Darwin-ARM: use movw/movt for static relocations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195759
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 26 Nov 2013 12:00:58 +0000 (12:00 +0000)]
[PM] Fix a stale comment after my last refactoring spoted by Joey in
review!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195757
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 26 Nov 2013 11:31:06 +0000 (11:31 +0000)]
[PM] Remove four extraneous 'typename's that Clang (in C++11 mode) is
happy with but GCC complains about. I'm assuming both compilers are
correct and these are optional in C++11 because I'm too tired to read
the standard. ;]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195748
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 26 Nov 2013 11:24:37 +0000 (11:24 +0000)]
[PM] Factor the overwhelming majority of the interface boiler plate out
of the two analysis managers into a CRTP base class that can be shared
and re-used in building any analysis manager. This will in turn simplify
adding yet another analysis manager to the system.
The base class provides all of the interface sugar for the analysis
manager delegating the functionality back through DerivedT methods which
operate on simple pass IDs. It also provides the pass registration,
storage, and lookup system which is common across the various
formulations of analysis managers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195747
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Tue, 26 Nov 2013 10:53:16 +0000 (10:53 +0000)]
[SystemZ] Fix incorrect use of RISBG for a zero-extended right shift
We would wrongly transform the testcase into the equivalent of an AND with 1.
The problem was that, when testing whether the shifted-in bits of the right
shift were significant, we used the width of the final zero-extended result
rather than the width of the shifted value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195731
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnaud A. de Grandmaison [Tue, 26 Nov 2013 10:33:53 +0000 (10:33 +0000)]
CMake : optionaly enable LLVM to be compiled with -std=c++11 (default: off)
In some case, it may be required to build LLVM in C++11 mode, as some the subprojects (like lldb) requires it.
This mimics the autoconf behaviour.
However, given the discussions on the switch to C++11 of the codebase, this behaviour should evolve to default to C++11 with some checks of the compiler capabilities.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195727
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 26 Nov 2013 04:19:30 +0000 (04:19 +0000)]
[PM] Split the CallGraph out from the ModulePass which creates the
CallGraph.
This makes the CallGraph a totally generic analysis object that is the
container for the graph data structure and the primary interface for
querying and manipulating it. The pass logic is separated into its own
class. For compatibility reasons, the pass provides wrapper methods for
most of the methods on CallGraph -- they all just forward.
This will allow the new pass manager infrastructure to provide its own
analysis pass that constructs the same CallGraph object and makes it
available. The idea is that in the new pass manager, the analysis pass's
'run' method returns a concrete analysis 'result'. Here, that result is
a 'CallGraph'. The 'run' method will typically do only minimal work,
deferring much of the work into the implementation of the result object
in order to be lazy about computing things, but when (like DomTree)
there is *some* up-front computation, the analysis does it prior to
handing the result back to the querying pass.
I know some of this is fairly ugly. I'm happy to change it around if
folks can suggest a cleaner interim state, but there is going to be some
amount of unavoidable ugliness during the transition period. The good
thing is that this is very limited and will naturally go away when the
old pass infrastructure goes away. It won't hang around to bother us
later.
Next up is the initial new-PM-style call graph analysis. =]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195722
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 26 Nov 2013 03:45:26 +0000 (03:45 +0000)]
[PM] Reformat some code with clang-format as I'm going to be editting as
part of generalizing the call graph infrastructure for the new pass
manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195718
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 26 Nov 2013 03:43:52 +0000 (03:43 +0000)]
[PM] Add a really simple trait to the DOTGraphTraitsPass class templates
that lets the analysis and graph types be separate and the graph
computed from the analysis through some arbitrary user-supplied code.
This will allow a call graph to an independent entity from the pass
which creates it which is necessary for the new pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195717
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Qin [Tue, 26 Nov 2013 03:26:47 +0000 (03:26 +0000)]
Refactored the implementation of AArch64 NEON instruction ZIP, UZP
and TRN.
Fix a bug when mixed use of vget_high_u8() and vuzp_u8().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195716
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 26 Nov 2013 03:22:09 +0000 (03:22 +0000)]
[PM] Re-format this code with clang-format before making substantial
changes to it. No functionality changed.
You may wonder why on earth touching this code is involved in the pass
manager work as indicated by my lovely '[PM]' tag? Let me tell you
a story.
<redacted>
Yea, it's too long of a story. Let us say that there are yaks, many of
them. I am busy shaving them as fast as I can.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195715
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Qin [Tue, 26 Nov 2013 02:33:42 +0000 (02:33 +0000)]
[AArch64]Implement 128 bit register copy with NEON.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195713
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Tue, 26 Nov 2013 02:03:25 +0000 (02:03 +0000)]
StackMap: Implement support for DirectMemRefOp.
A Direct stack map location records the address of frame index. This
address is itself the value that the runtime requested. This differs
from IndirectMemRefOp locations, which refer to a stack locations from
which the requested values must be loaded. Direct locations can
directly communicate the address if an alloca, while IndirectMemRefOp
handle register spills.
For example:
entry:
%a = alloca i64...
llvm.experimental.stackmap(i32 <ID>, i32 <shadowBytes>, i64* %a)
Since both the alloca and stackmap intrinsic are in the entry block,
and the intrinsic takes the address of the alloca, the runtime can
assume that LLVM will not substitute alloca with any intervening
value. This must be verified by the runtime by checking that the stack
map's location is a Direct location type. The runtime can then
determine the alloca's relative location on the stack immediately after
compilation, or at any time thereafter. This differs from Register and
Indirect locations, because the runtime can only read the values in
those locations when execution reaches the instruction address of the
stack map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195712
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Tue, 26 Nov 2013 02:03:20 +0000 (02:03 +0000)]
whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195711
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 26 Nov 2013 01:27:20 +0000 (01:27 +0000)]
[PM] Make the (really awesome) file comment here available as part of
the Doxygen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195709
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 26 Nov 2013 01:25:07 +0000 (01:25 +0000)]
[PM] Reformat this file with clang-format. Mostly fixes inconsistent
spacing around the '*' in pointer types. Will let me use clang-format on
subsequent changes without introducing any noise. No functionality
changed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195708
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 26 Nov 2013 01:11:02 +0000 (01:11 +0000)]
DebugInfo: Update test case due to dumper improvements in r195698
The dumper was only dumping one pubtypes set and it was /always/ dumping
one pubtypes set even when there were zero sets. Now that the dumper
correctly dumps zero, one, or many sets, we can update this test case to
test for the absolute absence of a set rather than a bogus/accidental
zero-valued set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195706
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 26 Nov 2013 00:54:44 +0000 (00:54 +0000)]
Lift self-copy protection up to the header file and add self-move
protection to the same layer.
This is in line with Howard's advice on how best to handle self-move
assignment as he explained on SO[1]. It also ensures that implementing
swap with move assignment continues to work in the case of self-swap.
[1]: http://stackoverflow.com/questions/
9322174/move-assignment-operator-and-if-this-rhs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195705
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 26 Nov 2013 00:44:36 +0000 (00:44 +0000)]
Fix a self-memcpy which only breaks under Valgrind's memcpy
implementation. Silliness, but it'll be a trivial performance
optimization. This should clear up a failure on the vg_leak bot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195704
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 26 Nov 2013 00:37:27 +0000 (00:37 +0000)]
[PM] Sink a trailing comment to be a doxygen comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195702
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 26 Nov 2013 00:37:23 +0000 (00:37 +0000)]
[PM] Rename the 'Mod' member to the more idiomatic 'M'. No functionality
changed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195701
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 26 Nov 2013 00:35:04 +0000 (00:35 +0000)]
DebugInfo: Remove CompileUnit::constructTypeDIEImpl now that it's just a simple wrapper again.
r195698 moved the type unit checking up into getOrCreateTypeDIE so
remove the redundant check and fold the functions back together again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195700
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 26 Nov 2013 00:29:36 +0000 (00:29 +0000)]
[PM] Clean up a bunch of comments, modernize the doxygen, nuke some
whitespace, and a couple of argument name fixes before I start hacking
on this code. No functionality changed here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195699
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 26 Nov 2013 00:22:37 +0000 (00:22 +0000)]
DebugInfo: Avoid emitting pubtype entries for type DIEs that just indirect to a type unit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195698
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron McInally [Tue, 26 Nov 2013 00:20:43 +0000 (00:20 +0000)]
Add an intrinsic for the SSE2 PAUSE instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195697
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 26 Nov 2013 00:15:27 +0000 (00:15 +0000)]
DebugInfo: Pubtypes: Coelesce pubtype registration with accelerator type registration.
It might be possible to eventually use one data structure, but I haven't
looked at the exact criteria used for accelerator tables and pubtypes to
see if there's good reason for the differences between the two or not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195696
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 25 Nov 2013 22:24:27 +0000 (22:24 +0000)]
Add the test case that I missed when committing r195528. Doh!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195691
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 25 Nov 2013 20:50:03 +0000 (20:50 +0000)]
Do the string comparison in the constructor instead of once per nop.
Thanks to Roman Divacky for the suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195684
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 25 Nov 2013 20:46:18 +0000 (20:46 +0000)]
Use -triple to fix the test on non-ELF hosts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195682
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 25 Nov 2013 20:15:14 +0000 (20:15 +0000)]
Don't use nopl in cpus that don't support it.
Patch by Mikulas Patocka. I added the test. I checked that for cpu names that
gas knows about, it also doesn't generate nopl.
The modified cpus:
i686 - there are i686-class CPUs that don't have nopl: Via c3, Transmeta
Crusoe, Microsoft VirtualBox - see
https://bbs.archlinux.org/viewtopic.php?pid=775414
k6, k6-2, k6-3, winchip-c6, winchip2 - these are 586-class CPUs
via c3 c3-2 - see https://bugs.archlinux.org/task/19733 as a proof that
Via c3 and c3-Nehemiah don't have nopl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195679
91177308-0d34-0410-b5e6-
96231b3b80d8
David Peixotto [Mon, 25 Nov 2013 19:11:13 +0000 (19:11 +0000)]
ARM integrated assembler generates incorrect nop opcode
This patch fixes a bug in the assembler that was causing bad code to
be emitted. When switching modes in an assembly file (e.g. arm to
thumb mode) we would always emit the opcode from the original mode.
Consider this small example:
$ cat align.s
.code 16
foo:
add r0, r0
.align 3
add r0, r0
$ llvm-mc -triple armv7-none-linux align.s -filetype=obj -o t.o
$ llvm-objdump -triple thumbv7 -d t.o
Disassembly of section .text:
foo:
0: 00 44 add r0, r0
2: 00 f0 20 e3 blx #
4195904
6: 00 00 movs r0, r0
8: 00 44 add r0, r0
This shows that we have actually emitted an arm nop (
e320f000)
instead of a thumb nop. Unfortunately, this encodes to a thumb
branch which causes bad things to happen when compiling assembly
code with align directives.
The fix is to notify the ARMAsmBackend when we switch mode. The
MCMachOStreamer was already doing this correctly. This patch makes
the same change for the MCElfStreamer.
There is still a bug in the way nops are emitted for alignment
because the MCAlignment fragment does not store the correct mode.
The ARMAsmBackend will emit nops for the last mode it knew about. In
the example above, we still generate an arm nop if we add a `.code
32` to the end of the file.
PR18019
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195677
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Mon, 25 Nov 2013 18:05:22 +0000 (18:05 +0000)]
Unrevert r195599 with testcase fix.
I'm not sure how it was checking for the wrong values...
PR18023.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195670
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Mon, 25 Nov 2013 17:04:35 +0000 (17:04 +0000)]
Fix indentation typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195660
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Mon, 25 Nov 2013 16:24:52 +0000 (16:24 +0000)]
ARM: remove special cases for Darwin dynamic-no-pic mode.
These are handled almost identically to static mode (and ELF's global address
materialisation), except that a symbol may have "$non_lazy_ptr" appended. This
can be handled by passing appropriate flags along with the instruction instead
of using entirely separate pseudo-instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195655
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 25 Nov 2013 16:06:04 +0000 (16:06 +0000)]
Fix .comm and .lcomm on COFF.
These should not use COMDATs. GNU as uses .bss for .lcomm and section 0 for
.comm.
Given
static int a;
int b;
MSVC puts both in .bss. This patch then puts both .comm and .lcomm on .bss. With
this change we agree with gas on .lcomm, are much closer on .comm and clang-cl
matches msvc on the above example.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195654
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 25 Nov 2013 16:00:32 +0000 (16:00 +0000)]
Refactor to make the .bss, .data and .text sections available for other uses.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195653
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 25 Nov 2013 15:40:24 +0000 (15:40 +0000)]
Make helper function static.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195650
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Mon, 25 Nov 2013 14:40:57 +0000 (14:40 +0000)]
ARM: remove unused patterns.
There is no sane way for an LEApcrel (= single ADR) instruction to generate a
global address on any ARM target I know of. Fortunately, no-one was trying to
any more, but there were vestigial patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195644
91177308-0d34-0410-b5e6-
96231b3b80d8
Amara Emerson [Mon, 25 Nov 2013 13:17:15 +0000 (13:17 +0000)]
[ARM] Enable FeatureMP for Cortex-A5 by default.
Patch by Oliver Stannard.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195640
91177308-0d34-0410-b5e6-
96231b3b80d8
Amara Emerson [Mon, 25 Nov 2013 11:24:18 +0000 (11:24 +0000)]
Revert r195599 as it broke the builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195636
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 25 Nov 2013 11:14:43 +0000 (11:14 +0000)]
Fixed tryFoldToZero() for vector types that need expansion.
Summary:
Moved the requirement for SelectionDAG::getConstant() to return legally
typed nodes slightly earlier. There were two optional DAGCombine passes
that were missed out and were required to produce type-legal DAGs.
Simplified a code-path in tryFoldToZero() to use SelectionDAG::getConstant().
This provides support for both promoted and expanded vector types whereas the
previous code only supported promoted vector types.
Fixes a "Type for zero vector elements is not legal" assertion detected by
an llvm-stress generated test.
Reviewers: resistor
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2251
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195635
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Mon, 25 Nov 2013 09:52:59 +0000 (09:52 +0000)]
X86: enable AVX2 under Haswell native compilation
Patch by Adam Strzelecki
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195632
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Mon, 25 Nov 2013 05:01:21 +0000 (05:01 +0000)]
Don't look past volatile loads.
A volatile load should block us from trying to coalesce stores.
PR18023
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195599
91177308-0d34-0410-b5e6-
96231b3b80d8
Hao Liu [Mon, 25 Nov 2013 01:53:26 +0000 (01:53 +0000)]
Fixed a bug about disassembling AArch64 post-index load/store single element instructions.
ie. echo "0x00 0x04 0x80 0x0d" | ../bin/llvm-mc -triple=aarch64 -mattr=+neon -disassemble
echo "0x00 0x00 0x80 0x0d" | ../bin/llvm-mc -triple=aarch64 -mattr=+neon -disassemble
will be disassembled into the same instruction st1 {v0b}[0], [x0], x0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195591
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 25 Nov 2013 00:52:46 +0000 (00:52 +0000)]
SparcFrameLowering.cpp: Prune 'DL' [-Wunused-variable]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195590
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 25 Nov 2013 00:43:41 +0000 (00:43 +0000)]
Output a bit more information in the debug printing for MBP. This was
useful when analyzing parts of zlib's behavior here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195588
91177308-0d34-0410-b5e6-
96231b3b80d8
Venkatraman Govindaraju [Sun, 24 Nov 2013 20:23:25 +0000 (20:23 +0000)]
[Sparc] Emit large negative adjustments to SP/FP with sethi+xor instead of sethi+or. This generates correct code for both sparc32 and sparc64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195576
91177308-0d34-0410-b5e6-
96231b3b80d8
Venkatraman Govindaraju [Sun, 24 Nov 2013 20:07:35 +0000 (20:07 +0000)]
[Sparc]: Implement LEA pattern for sparcv9.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195575
91177308-0d34-0410-b5e6-
96231b3b80d8
Venkatraman Govindaraju [Sun, 24 Nov 2013 18:41:49 +0000 (18:41 +0000)]
[SparcV9]: Do not emit .register directives for global registers that are clobbered by calls but not used in the function itself.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195574
91177308-0d34-0410-b5e6-
96231b3b80d8
Venkatraman Govindaraju [Sun, 24 Nov 2013 17:41:41 +0000 (17:41 +0000)]
[SparcV9] Enable custom lowering of DYNAMIC_STACKALLOC in sparc64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195573
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Sun, 24 Nov 2013 06:18:50 +0000 (06:18 +0000)]
Make sure that for C++ emitting LwConstant32 pseudos, that it corresponds
to what is needed for constant islands. The prescan method for Mips16 constant
islands will eventually go away. It is only temporary and should be done
earlier when the instructions are first created or from the DAG. If we keep
it here we need to handle better the situation where constant islands
is called multiple times since don't want to prescan more than once.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195569
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sun, 24 Nov 2013 05:29:35 +0000 (05:29 +0000)]
Default to a better compression algorithm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195567
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Sun, 24 Nov 2013 03:37:56 +0000 (03:37 +0000)]
Update older test cases for latest patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195566
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Sun, 24 Nov 2013 02:53:09 +0000 (02:53 +0000)]
Fix a funny bug I introduced during conversion of ARM constant islands to Mips.
I had to move some code and I moved a declaration forward past it's first use
in the function but by nutty coincidence there was another variable of the same
name and type and with completely unrelated function that was declared globally
in the class so no compilation error ensued.
It required some unusual conditions for it to even matter. Caused test
case casts.c in test-suite to fail during compilation with a duplicate
symbol error. I would have noticed it during final code review for this port.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195565
91177308-0d34-0410-b5e6-
96231b3b80d8
Alp Toker [Sat, 23 Nov 2013 23:06:20 +0000 (23:06 +0000)]
Put an unused result attribute on SmallSet::empty()
This matches other empty() container functions in LLVM.
No actual usage problems discovered in this instance.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195562
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 23 Nov 2013 01:25:07 +0000 (01:25 +0000)]
[PM] Complete the cross-layer interfaces with a Module-to-Function
proxy. This lets a function pass query a module analysis manager.
However, the interface is const to indicate that only cached results can
be safely queried.
With this, I think the new pass manager is largely functionally complete
for modules and analyses. Still lots to test, and need to generalize to
SCCs and Loops, and need to build an adaptor layer to support the use of
existing Pass objects in the new managers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195538
91177308-0d34-0410-b5e6-
96231b3b80d8