Rui Ueyama [Thu, 10 Mar 2016 18:58:53 +0000 (18:58 +0000)]
Rename MaxAlignment -> Alignment.
We can argue about a maximum alignment of a group of symbols,
but for each symbol, there is only one alignment.
So it is a bit weird that each symbol has a "maximum alignment".
llvm-svn: 263151
George Rimar [Thu, 10 Mar 2016 18:57:17 +0000 (18:57 +0000)]
[ELF] - Fixed handling R_X86_64_DTPOFF64 relocation relaxation
R_X86_64_DTPOFF64 was not handled properly.
Next sample app was impossible to link before this patch:
~/pg/release/bin/clang -target x86_64-pc-linux testthread.cpp -c -g
~/pg/d+a/bin/ld.lld testthread.o
"Unknown TLS optimization" (value was 17)
__thread int x = 0;
void _start() {
}
It works fine now.
Differential revision: http://reviews.llvm.org/D18039
llvm-svn: 263150
Manman Ren [Thu, 10 Mar 2016 18:53:19 +0000 (18:53 +0000)]
Add TreatUnavailableAsInvalid for the verification-only mode in InitListChecker.
Given the following test case:
typedef struct {
const char *name;
id field;
} Test9;
extern void doSomething(Test9 arg);
void test9() {
Test9 foo2 = {0, 0};
doSomething(foo2);
}
With a release compiler, we don't emit any message and silently ignore the
variable "foo2". With an assert compiler, we get an assertion failure.
The root cause —————————————
Back in r140457 we gave InitListChecker a verification-only mode, and will use
CanUseDecl instead of DiagnoseUseOfDecl for verification-only mode.
These two functions handle unavailable issues differently:
In Sema::CanUseDecl, we say the decl is invalid when the Decl is unavailable and
the current context is available.
In Sema::DiagnoseUseOfDecl, we say the decl is usable by ignoring the return
code of DiagnoseAvailabilityOfDecl
So with an assert build, we will hit an assertion in diagnoseListInit
assert(DiagnoseInitList.HadError() &&
"Inconsistent init list check result.");
The fix -------------------
If we follow what is implemented in CanUseDecl and treat Decls with
unavailable issues as invalid, the variable decl of “foo2” will be marked as
invalid. Since unavailable checking is processed in delayed diagnostics
(r197627), we will silently ignore the diagnostics when we find out that
the variable decl is invalid.
We add a flag "TreatUnavailableAsInvalid" for the verification-only mode.
For overload resolution, we want to say decls with unavailable issues are
invalid; but for everything else, we should say they are valid and
emit diagnostics. Depending on the value of the flag, CanUseDecl
can return different values for unavailable issues.
rdar://
23557300
Differential Revision: http://reviews.llvm.org/D15314
llvm-svn: 263149
Nicolai Haehnle [Thu, 10 Mar 2016 18:51:58 +0000 (18:51 +0000)]
[TableGen] more helpful error message in MapTableEmitter
Differential Revision: http://reviews.llvm.org/D17275
llvm-svn: 263148
George Rimar [Thu, 10 Mar 2016 18:49:24 +0000 (18:49 +0000)]
[ELF] - Refactor of SymbolBody::compare()
That makes it a bit shorter.
Differential revision: http://reviews.llvm.org/D18004
llvm-svn: 263144
Teresa Johnson [Thu, 10 Mar 2016 18:47:03 +0000 (18:47 +0000)]
Materialize metadata in IRLinker before value mapping
Summary:
Unless we plan to do later postpass metadata linking (ThinLTO special mode),
always invoke metadata materialization at the start of IRLinker::run().
This avoids the need for clients who use lazy metadata loading to
explicitly invoke materializeMetadata before the IRMover, which in
turn invokes IRLinker::run and needs materialized metadata for mapping.
Came up in the context of an LLD issue (D17982).
Reviewers: rafael
Subscribers: silvas, llvm-commits
Differential Revision: http://reviews.llvm.org/D17992
llvm-svn: 263143
Filipe Cabecinhas [Thu, 10 Mar 2016 18:46:23 +0000 (18:46 +0000)]
[sanitizer_common tests] Make Darwin a Posix system and bring the stable-runtime definition from ASan tests.
Summary: This is an initial setup in order to move some additional tests from Linux onto Posix.
I also moved decorate_proc_maps onto the Linux directory
Finally added msan's definition for "stable-runtime".
Only a test requires it, and its commit message (r248014) seems to imply
that AArch64 is problematic with MSan.
Reviewers: samsonov, rengolin, t.p.northover, eugenis
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D17928
llvm-svn: 263142
Tim Northover [Thu, 10 Mar 2016 18:46:12 +0000 (18:46 +0000)]
AArch64: remove pseudo-instructions used only for their patterns.
There's no real reason for these pseudos to exist, we should be writing real
patterns even if it is slightly less convenient. NFC.
llvm-svn: 263141
Nicolai Haehnle [Thu, 10 Mar 2016 18:43:50 +0000 (18:43 +0000)]
AMDGPU/SI: add llvm.amdgcn.buffer.load/store.format intrinsics
Summary:
They correspond to BUFFER_LOAD/STORE_FORMAT_XYZW and will be used by Mesa
to implement the GL_ARB_shader_image_load_store extension.
The intention is that for llvm.amdgcn.buffer.load.format, LLVM will decide
whether one of the _X/_XY/_XYZ opcodes can be used (similar to image sampling
and loads). However, this is not currently implemented.
For llvm.amdgcn.buffer.store, LLVM cannot decide to use one of the "smaller"
opcodes and therefore the intrinsic is overloaded. Currently, only the v4f32
is actually implemented since GLSL also only has a vec4 variant of the store
instructions, although it's conceivable that Mesa will want to be smarter
about this in the future.
BUFFER_LOAD_FORMAT_XYZW is already exposed via llvm.SI.vs.load.input, which
has a legacy name, pretends not to access memory, and does not capture the
full flexibility of the instruction.
Reviewers: arsenm, tstellarAMD, mareko
Subscribers: arsenm, llvm-commits
Differential Revision: http://reviews.llvm.org/D17277
llvm-svn: 263140
Michael Kuperstein [Thu, 10 Mar 2016 18:43:21 +0000 (18:43 +0000)]
[X86] Correctly select registers to pop into for x86_64
When trying to replace an add to esp with pops, we need to choose dead
registers to pop into. Registers clobbered by the call and not imp-def'd
by it should be safe. Except that it's not enough to check the register
itself isn't defined, we also need to make sure no overlapping registers
are defined either.
This fixes PR26711.
Differential Revision: http://reviews.llvm.org/D18029
llvm-svn: 263139
Nico Weber [Thu, 10 Mar 2016 18:42:37 +0000 (18:42 +0000)]
Make remaining ImplicitFallthrough warning DefaultIgnore.
Follow-up to r262881, which caused this to fire more often.
llvm-svn: 263138
Kuba Brecka [Thu, 10 Mar 2016 18:09:57 +0000 (18:09 +0000)]
Follow-up fix for r263126. Apparently `printf("%p", NULL)` can output 0x0, (nil) or (null) on different platforms.
llvm-svn: 263137
Balaram Makam [Thu, 10 Mar 2016 17:54:55 +0000 (17:54 +0000)]
[AArch64] Optimize compare and branch sequence when the compare's constant operand is power of 2
Summary:
Peephole optimization that generates a single TBZ/TBNZ instruction
for test and branch sequences like in the example below. This handles
the cases that miss folding of AND into TBZ/TBNZ during ISelLowering of BR_CC
Examples:
and w8, w8, #0x400
cbnz w8, L1
to
tbnz w8, #10, L1
Reviewers: MatzeB, jmolloy, mcrosier, t.p.northover
Subscribers: aemerson, rengolin, mcrosier, llvm-commits
Differential Revision: http://reviews.llvm.org/D17942
llvm-svn: 263136
Sanjay Patel [Thu, 10 Mar 2016 17:52:19 +0000 (17:52 +0000)]
give regression test a meaningful name
llvm-svn: 263135
Aidan Dodds [Thu, 10 Mar 2016 17:50:01 +0000 (17:50 +0000)]
[Renderscript] Add stack argument reading code for Mipsel 3
Fix a problem raised with the previous patches being applied in the wrong order.
Committed on behalf of: Dean De Leo <dean@codeplay.com>
llvm-svn: 263134
George Rimar [Thu, 10 Mar 2016 17:38:49 +0000 (17:38 +0000)]
[ELF] - Do not call doInitSymbols for all ELFTs
It looks a bit wierd that we have to initialize symbols for all ELFT
types when we use only one ELFT for link. We can only init those
that we need. Patch fixes it.
Differential revision: http://reviews.llvm.org/D18047
llvm-svn: 263133
Alexandros Lamprineas [Thu, 10 Mar 2016 17:38:41 +0000 (17:38 +0000)]
[ARM] Cortex-R8 support
This patch adds Cortex-R8 to Target Parser and TableGen.
It also adds CodeGen tests for the build attributes.
Patch by Pablo Barrio.
Differential Revision: http://reviews.llvm.org/D17925
llvm-svn: 263132
Aidan Dodds [Thu, 10 Mar 2016 17:37:02 +0000 (17:37 +0000)]
[Renderscript] Add stack argument reading code for Mipsel 2
This commit implements the reading of stack spilled function arguments for little endian MIPS targets.
Committed on behalf of: Dean De Leo <dean@codeplay.com>
llvm-svn: 263131
Aidan Dodds [Thu, 10 Mar 2016 17:27:41 +0000 (17:27 +0000)]
[Renderscript] Add stack argument reading code for Mipsel
This commit implements the reading of stack spilled function arguments for little endian MIPS targets.
Committed on behalf of: Dean De Leo <dean@codeplay.com>
llvm-svn: 263130
Aidan Dodds [Thu, 10 Mar 2016 17:23:33 +0000 (17:23 +0000)]
[Renderscript] Explicitly set the language to evaluate allocations
Currently it is not specified, and since allocations are usually
requested once we hit a renderscript breakpoint, the language will be
inferred being as renderscript by the ExpressionParser.
Actually allocations attempt to invoke functions part of the RS runtime,
written in C/C++, so evaluating the calls in RenderScript could be
misleading.
In particular, in MIPS, the ABI between C/C++ (mips o32) and
renderscript (arm) might introduce subtle bugs when evaluating such
expressions.
This change explicitly sets the language used to evaluate the allocations
as C++.
Committed on behalf of: Dean De Leo <dean@codeplay.com>
llvm-svn: 263129
George Rimar [Thu, 10 Mar 2016 17:13:20 +0000 (17:13 +0000)]
Attemp to fix linux build bot fail after r263125
(http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/8662).
Test fails on linux only.
Original commit message:
[ELF] - Consistent spelling for error/warning messages
Previously error and warnings were not consistent in lld.
Some of them started from lowercase letter, others from
uppercase. Also there was one or two which had a dot at the end.
This patch changes all messages to start from uppercase letter if
they were not before.
Differential revision: http://reviews.llvm.org/D18045
llvm-svn: 263128
Mehdi Amini [Thu, 10 Mar 2016 17:06:52 +0000 (17:06 +0000)]
Rename -discard-value-names into -lto-discard-value-names in libLLVMLTO
This is avoiding a naming conflict with opt and llc.
While opt and llc don't link to LTO usually, users that are building a
monolithic libLLVM.dylib and linking the tools to it would have a
runtime error because of the duplicate cl::opt registration.
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 263127
Kuba Brecka [Thu, 10 Mar 2016 17:00:29 +0000 (17:00 +0000)]
[tsan] Add TSan debugger APIs
Currently, TSan only reports everything in a formatted textual form. The idea behind this patch is to provide a consistent API that can be used to query information contained in a TSan-produced report. User can use these APIs either in a debugger (via a script or directly), or they can use it directly from the process (e.g. in the __tsan_on_report callback). ASan already has a similar API, see http://reviews.llvm.org/D4466.
Differential Revision: http://reviews.llvm.org/D16191
llvm-svn: 263126
George Rimar [Thu, 10 Mar 2016 16:58:34 +0000 (16:58 +0000)]
[ELF] - Consistent spelling for error/warning messages
Previously error and warnings were not consistent in lld.
Some of them started from lowercase letter, others from
uppercase. Also there was one or two which had a dot at the end.
This patch changes all messages to start from uppercase letter if
they were not before.
Differential revision: http://reviews.llvm.org/D18045
llvm-svn: 263125
Changpeng Fang [Thu, 10 Mar 2016 16:47:15 +0000 (16:47 +0000)]
AMDGPU/SI: Define S_GETREG Intrinsic
Summary:
Define s_getreg intrinsic to generate s_getreg instruction to read
hardware registers.
Reviewers: tstellarAMD, arsenm
Subscribers: llvm-commits, arsenm
Differential Revision: http://reviews.llvm.org/D17892
llvm-svn: 263124
Saleem Abdulrasool [Thu, 10 Mar 2016 16:26:37 +0000 (16:26 +0000)]
ARM: follow up improvements for SVN r263118
The initial change was insufficiently complete for always getting the semantics
of __builtin_longjmp correct. The builtin is translated into a
`tInt_eh_sjlj_longjmp` DAG node. This node set R7 as clobbered. However, the
code would then follow up with a clobber of R11. I had failed to notice the
imp-def,kill on R7 in the isel. Unfortunately, it seems that it is not possible
to conditionalise the Defs list via an !if. Instead, construct a new parallel
WIN node and prefer that when targeting windows. This ensures that we now both
correctly model the __builtin_longjmp as well as construct the frame in a more
ABI conformant manner.
llvm-svn: 263123
Adrian McCarthy [Thu, 10 Mar 2016 15:41:11 +0000 (15:41 +0000)]
Eliminate the TestStarted-XXX and TestFinished-XXX files from check-lldb runs.
Nobody seems to know what purpose these files serve, yet they were accumulating by the thousands in the test traces directory. I'm proposing we delete them.
Creating these files accounted for about 2.5% of the time to run ninja check-lldb on my machine, which isn't a lot, but it's something.
llvm-svn: 263122
Chandler Carruth [Thu, 10 Mar 2016 15:31:17 +0000 (15:31 +0000)]
[SROA] Fix PR25873, which Andrea Di Biagio analyzed the daylights out
of, and I misdiagnosed for months and months.
Andrea has had a patch for this forever, but I just couldn't see how
it was fixing the root cause of the problem. It didn't make sense to me,
even though the patch was perfectly good and the analysis of the actual
failure event was *fantastic*.
Well, I came back to it today because the patch has sat for *far* too
long and needs attention and decided I wouldn't let it go until I really
understood what was going on. After quite some time in the debugger,
I finally realized that in fact I had just missed an important case with
my previous attempt to fix PR22093 in r225149. Not only do we need to
handle loads that won't be split, but stores-of-loads that we won't
split. We *do* actually have enough logic in the presplitting to form
new slices for split stores.... *unless* we decided not to split them!
I'm so sorry that it took me this long to come to the realization that
this is the issue. It seems so obvious in hind sight (of course).
Anyways, the fix becomes *much* smaller and more focused. The fact that
we're left doing integer smashing is related to the FIXME in my original
commit: fundamentally, we're not aggressive about pre-splitting for
loads and stores to the same alloca. If we want to get aggressive about
this, it'll need both what Andrea had put into the proposed fix, but
also a *lot* more logic to essentially iteratively pre-split the alloca
until we can't do any more. As I said in that commit log, its really
unclear that this is the right call. Instead, the integer blending and
letting targets lower this to narrower stores seems slightly better. But
we definitely shouldn't really go down that path just to fix this bug.
Again, tons of thanks are owed to Andrea and others at Sony for working
on this bug. I really should have seen what was going on here and
re-directed them sooner. =////
llvm-svn: 263121
David L Kreitzer [Thu, 10 Mar 2016 15:14:02 +0000 (15:14 +0000)]
Unified the handling of returns in the X87 stackifier so that the stackifier
runs successfully on routines containing IRETs. This fixes PR26410.
Differential Revision: http://reviews.llvm.org/D17643
llvm-svn: 263120
NAKAMURA Takumi [Thu, 10 Mar 2016 15:13:00 +0000 (15:13 +0000)]
Fixup for r263114. llvm::AnalysisBase<CallGraphAnalysis> should be declared as extern.
llvm-svn: 263119
Saleem Abdulrasool [Thu, 10 Mar 2016 15:11:09 +0000 (15:11 +0000)]
ARM: correct __builtin_longjmp on WoA
WoA uses r11 as the FP even though it is a pure thumb-2 environment in contrast
to AAPCS which states r7. This adjusts __builtin_longjmp to not clobber r7 and
to properly restore the frame pointer on execution.
llvm-svn: 263118
Simon Pilgrim [Thu, 10 Mar 2016 14:46:49 +0000 (14:46 +0000)]
Updated SSE3 builtin tests to more closely match the llvm fast-isel equivalent tests
llvm-svn: 263117
Simon Pilgrim [Thu, 10 Mar 2016 14:44:32 +0000 (14:44 +0000)]
Added note to SSE4a builtins about keeping in sync with llvm tests
llvm-svn: 263116
Simon Pilgrim [Thu, 10 Mar 2016 14:42:17 +0000 (14:42 +0000)]
Updated SSSE3 builtin tests to more closely match the llvm fast-isel equivalent tests
llvm-svn: 263115
Chandler Carruth [Thu, 10 Mar 2016 14:33:10 +0000 (14:33 +0000)]
[CG] Back out my pointless move ctor and add the explicit template
instantiation needed for the mingw dll build bot.
llvm-svn: 263114
Simon Pilgrim [Thu, 10 Mar 2016 14:16:36 +0000 (14:16 +0000)]
Minor Wdocumentation fix. NFCI.
llvm-svn: 263113
Chandler Carruth [Thu, 10 Mar 2016 14:16:18 +0000 (14:16 +0000)]
[SROA] Clean up some really weird code, no functionality changed.
We already have the instruction extracted into 'I', just cast that to
a store the way we do for loads. Also, we don't enter the if unless SI
is non-null, so don't test it again for null.
I'm pretty sure the entire test there can be nuked, but this is just the
trivial cleanup.
llvm-svn: 263112
Elena Demikhovsky [Thu, 10 Mar 2016 13:44:22 +0000 (13:44 +0000)]
AVX-512: Fixed a bug in i1 vector zero extending. (Skylake-avx512)
(failed on instruction selection phase)
Differential Revision: http://reviews.llvm.org/D17924
llvm-svn: 263111
Chandler Carruth [Thu, 10 Mar 2016 13:43:06 +0000 (13:43 +0000)]
[CG] Try adding an explicit move constructor to see if that helps the
one build bot that is crashing on this code.
llvm-svn: 263110
Aaron Ballman [Thu, 10 Mar 2016 13:08:22 +0000 (13:08 +0000)]
Correcting an attribute documentation generation error by giving the abi_tag attribute a documentation category.
llvm-svn: 263109
Valery Pykhtin [Thu, 10 Mar 2016 13:06:08 +0000 (13:06 +0000)]
[AMDGPU] Fix SMEM instructions encoding/operand namings
Differential Revision: http://reviews.llvm.org/D17651
llvm-svn: 263108
Ewan Crawford [Thu, 10 Mar 2016 12:38:55 +0000 (12:38 +0000)]
Revert "Track expression language from one place in ClangExpressionParser"
r263099 seems to have broken some OSX tests
llvm-svn: 263107
Filipe Cabecinhas [Thu, 10 Mar 2016 11:51:59 +0000 (11:51 +0000)]
[test/asan/closed-fds] Properly quote log_path for shell invocation.
llvm-svn: 263106
Simon Pilgrim [Thu, 10 Mar 2016 11:50:15 +0000 (11:50 +0000)]
[X86][AVX] Improve target shuffle combining of BLEND+zero
The BLEND+zero combine was failing to combine equivalent BLEND masks.
Follow up to D17483 and D17858
llvm-svn: 263105
Chandler Carruth [Thu, 10 Mar 2016 11:24:11 +0000 (11:24 +0000)]
[CG] Add a new pass manager printer pass for the old call graph and
actually finish wiring up the old call graph.
There were bugs in the old call graph that hadn't been caught because it
wasn't being tested. It wasn't being tested because it wasn't in the
pipeline system and we didn't have a printing pass to run in tests. This
fixes all of that.
As for why I'm still keeping the old call graph alive its so that I can
port GlobalsAA to the new pass manager with out forking it to work with
the lazy call graph. That's clearly the right eventual design, but it
seems pragmatic to defer that until its necessary. The old call graph
works just fine for GlobalsAA.
llvm-svn: 263104
Chandler Carruth [Thu, 10 Mar 2016 11:24:06 +0000 (11:24 +0000)]
[LCG] Spell the printing pass pipeline name for the lazy call graph
'lcg' instead of just 'cg'.
This makes it consistent with the analysis name of 'lcg'.
No functionality changed.
llvm-svn: 263103
Simon Pilgrim [Thu, 10 Mar 2016 11:23:51 +0000 (11:23 +0000)]
[X86][SSE] Basic combining of unary target shuffles of binary target shuffles.
This patch reorders the combining of target shuffle masks so that when a unary shuffle takes a binary shuffle as its input but only references one of its inputs it can correctly combine into a unary shuffle mask.
This is starting to encroach on the purpose of resolveTargetShuffleInputs, but I don't want to remove it until we definitely know we won't need it for full binary shuffle combining.
There is a lot more work before we can properly support binary target shuffle masks but this was an easy case to add support for.
Differential Revision: http://reviews.llvm.org/D17858
llvm-svn: 263102
Chandler Carruth [Thu, 10 Mar 2016 11:08:44 +0000 (11:08 +0000)]
[CG] Actually hoist up the generic CallGraphPrinter pass from a weird
location in the opt tool to live along side the analysis in LLVM's
libraries.
No functionality changed here, but this will allow me to port the
printer to the new pass manager as well.
llvm-svn: 263101
Chandler Carruth [Thu, 10 Mar 2016 11:04:40 +0000 (11:04 +0000)]
[CG] Rename the DOT printing pass to actually reference "DOT".
There is another pass by the generic name 'CallGraphPrinter' which is
actually just a call graph printer tucked away inside the opt tool. I'd
like to bring it out and make it follow the same patterns as the rest of
the CallGraph code, but doing so would end up conflicting with the name
of the DOT printing pass. So this makes the DOT printing pass name be
more precise.
No functionality changed here.
llvm-svn: 263100
Ewan Crawford [Thu, 10 Mar 2016 10:31:08 +0000 (10:31 +0000)]
Track expression language from one place in ClangExpressionParser
The current expression language is currently tracked in a few places within the ClangExpressionParser constructor.
This patch adds a private lldb::LanguageType attribute to the ClangExpressionParser class and tracks the expression language from that one place.
Author: Luke Drummond <luke.drummond@codeplay.com>
Differential Revision: http://reviews.llvm.org/D17719
llvm-svn: 263099
Ekaterina Romanova [Thu, 10 Mar 2016 09:37:04 +0000 (09:37 +0000)]
Add doxygen comments to xmmintrin.h's intrinsics.
Only half of the intrinsics in this file is documented here. The patch for the other half will be sent out later.
The doxygen comments are automatically generated based on Sony's intrinsics document.
I got an OK from Eric Christopher to commit doxygen comments without prior code review upstream.
llvm-svn: 263098
Elena Demikhovsky [Thu, 10 Mar 2016 08:32:09 +0000 (08:32 +0000)]
AVX-512: Fixed a bug in shuffle for v64i8 type
Operation SCALAR_TO_VECTOR for v64i8 and v32i16 should be lowered if BW feature is "on".
Differential Revision: http://reviews.llvm.org/D17994
llvm-svn: 263097
Vedant Kumar [Thu, 10 Mar 2016 06:58:53 +0000 (06:58 +0000)]
[opt] Fix description of the -disable-verify flag
llvm-svn: 263096
Mark Lacey [Thu, 10 Mar 2016 05:15:03 +0000 (05:15 +0000)]
Add an LLVM_BUILTIN_DEBUGTRAP macro.
Summary:
This provides a macro that expands to __builtin_debugtrap() for clang,
and __debugbreak() for MSVC.
It intentionally expands to nothing for compilers that do not support a
similar mechanism that halts the debugger without otherwise crashing the
process.
Differential Revision: http://reviews.llvm.org/D18002
llvm-svn: 263095
Sean Silva [Thu, 10 Mar 2016 04:58:52 +0000 (04:58 +0000)]
[lto] Initialize asmparsers.
Summary:
They are needed for inline asm during LTO.
In particular we hit the report_fatal_error on
llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp:138
LLVM ERROR: Inline asm not supported by this streamer because we don't have an asm parser for this target
Reviewers: ruiu, rafael
Subscribers: Bigcheese, llvm-commits, joker.eph
Differential Revision: http://reviews.llvm.org/D18027
llvm-svn: 263094
Tim Northover [Thu, 10 Mar 2016 04:39:45 +0000 (04:39 +0000)]
ARM: fix arm_neon_intrinsics.c and re-enable.
It turns out I'd never actually tested my recent change because it was
gated on long-tests. Failure ensued.
llvm-svn: 263093
Roman Levenstein [Thu, 10 Mar 2016 04:35:09 +0000 (04:35 +0000)]
Add support for a preserve_most calling convention to the AArch64 backend.
This change adds a support for a preserve_most calling convention to the AArch64 backend, similar to how it was done for X86-64.
There is also a subsequent patch on top of this one to add a tail-calls support for this calling convention.
Differential Revision: http://reviews.llvm.org/D18016
llvm-svn: 263092
Richard Trieu [Thu, 10 Mar 2016 04:04:12 +0000 (04:04 +0000)]
Disable failing test and fix RUN line.
See https://llvm.org/bugs/show_bug.cgi?id=26894 for details. This change
fixes the incorrect flags to Clang and the piping issue. It also disables
the FileCheck portion of the test, which is currently failing.
llvm-svn: 263091
Vedant Kumar [Thu, 10 Mar 2016 03:40:14 +0000 (03:40 +0000)]
[opt] Only create Verifier passes when requested
opt adds Verifier passes in AddOptimizationPasses even if
-disable-verify is on. Fix it so that the extra verification occurs
either when (1) -disable-verifier is off, or (2) -verify-each is on.
Thanks to David Jones for pointing out this behavior!
llvm-svn: 263090
Michael Zolotukhin [Thu, 10 Mar 2016 02:49:47 +0000 (02:49 +0000)]
[SLP] Add -slp-min-reg-size command line option.
MinVecRegSize is currently hardcoded to 128; this patch adds a cl::opt
to allow changing it. I tried not to change any existing behavior for the default
case.
Differential revision: http://reviews.llvm.org/D13278
llvm-svn: 263089
Mehdi Amini [Thu, 10 Mar 2016 02:18:17 +0000 (02:18 +0000)]
Add an entry in the Release Notes for LLVMContext::discardValueNames()
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 263088
Steven Wu [Thu, 10 Mar 2016 02:02:48 +0000 (02:02 +0000)]
Fix false positives for for-loop-analysis warning
Summary:
For PseudoObjectExpr, the DeclMatcher need to search only all the semantics
but also need to search pass OpaqueValueExpr for all potential uses for the
Decl.
Reviewers: thakis, rtrieu, rjmccall, doug.gregor
Subscribers: xazax.hun, rjmccall, doug.gregor, cfe-commits
Differential Revision: http://reviews.llvm.org/D17627
llvm-svn: 263087
Mehdi Amini [Thu, 10 Mar 2016 01:28:54 +0000 (01:28 +0000)]
Add a flag to the LLVMContext to disable name for Value other than GlobalValue
Summary:
This is intended to be a performance flag, on the same level as clang
cc1 option "--disable-free". LLVM will never initialize it by default,
it will be up to the client creating the LLVMContext to request this
behavior. Clang will do it by default in Release build (just like
--disable-free).
"opt" and "llc" can opt-in using -disable-named-value command line
option.
When performing LTO on llvm-tblgen, the initial merging of IR peaks
at 92MB without this patch, and 86MB after this patch,setNameImpl()
drops from 6.5MB to 0.5MB.
The total link time goes from ~29.5s to ~27.8s.
Compared to a compile-time flag (like the IRBuilder one), it performs
very close. I profiled on SROA and obtain these results:
420ms with IRBuilder that preserve name
372ms with IRBuilder that strip name
375ms with IRBuilder that preserve name, and a runtime flag to strip
Reviewers: chandlerc, dexonsmith, bogner
Subscribers: joker.eph, llvm-commits
Differential Revision: http://reviews.llvm.org/D17946
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 263086
Siva Chandra [Thu, 10 Mar 2016 01:15:17 +0000 (01:15 +0000)]
[DWARFASTParserClang] Start with member offset of 0 for members of union types.
Summary:
GCC does not emit DW_AT_data_member_location for members of a union.
Starting with a 0 value for member locations helps is reading union types
in such cases.
Reviewers: clayborg
Subscribers: ldrumm, lldb-commits
Differential Revision: http://reviews.llvm.org/D18008
llvm-svn: 263085
Chandler Carruth [Thu, 10 Mar 2016 00:58:20 +0000 (00:58 +0000)]
[gvn] Fix more indenting and formatting in regions of code that will
need to be changed for porting to the new pass manager.
Also sink the comment on the ValueTable class back to that class instead
of it dangling on an anonymous namespace.
No functionality changed.
llvm-svn: 263084
Chandler Carruth [Thu, 10 Mar 2016 00:58:18 +0000 (00:58 +0000)]
[gvn] Reformat a chunk of the GVN code that is strangely indented prior
to restructuring it for porting to the new pass manager.
No functionality changed.
llvm-svn: 263083
Chandler Carruth [Thu, 10 Mar 2016 00:55:30 +0000 (00:55 +0000)]
[PM] Port memdep to the new pass manager.
This is a fairly straightforward port to the new pass manager with one
exception. It removes a very questionable use of releaseMemory() in
the old pass to invalidate its caches between runs on a function.
I don't think this is really guaranteed to be safe. I've just used the
more direct port to the new PM to address this by nuking the results
object each time the pass runs. While this could cause some minor malloc
traffic increase, I don't expect the compile time performance hit to be
noticable, and it makes the correctness and other aspects of the pass
much easier to reason about. In some cases, it may make things faster by
making the sets and maps smaller with better locality. Indeed, the
measurements collected by Bruno (thanks!!!) show mostly compile time
improvements.
There is sadly very limited testing at this point as there are only two
tests of memdep, and both rely on GVN. I'll be porting GVN next and that
will exercise this heavily though.
Differential Revision: http://reviews.llvm.org/D17962
llvm-svn: 263082
Alexey Samsonov [Thu, 10 Mar 2016 00:20:37 +0000 (00:20 +0000)]
EmitCXXStructorCall -> EmitCXXDestructorCall. NFC.
This function is only used in Microsoft ABI and only to emit
destructors. Rename/simplify it accordingly.
llvm-svn: 263081
Alexey Samsonov [Thu, 10 Mar 2016 00:20:33 +0000 (00:20 +0000)]
Remove unused function arguments. NFC.
llvm-svn: 263080
Enrico Granata [Thu, 10 Mar 2016 00:14:29 +0000 (00:14 +0000)]
Certain hardware architectures have registers of 256 bits in size
This patch extends Scalar such that it can support data living in such registers (e.g. float values living in the XMM registers)
llvm-svn: 263079
Zachary Turner [Thu, 10 Mar 2016 00:06:26 +0000 (00:06 +0000)]
Fix SymbolFilePDB for discontiguous functions.
Previously line table parsing code assumed that the only gaps would
occur at the end of functions. In practice this isn't true, so this
patch makes the line table parsing more robust in the face of
functions with non-contiguous byte arrangements.
llvm-svn: 263078
Alexey Samsonov [Wed, 9 Mar 2016 23:39:40 +0000 (23:39 +0000)]
sanitizer: Fix endianness checks for gcc
Summary:
__BIG_ENDIAN__ and __LITTLE_ENDIAN__ are not supported by gcc, which
eg. for ubsan Value::getFloatValue will silently fall through to
the little endian branch, breaking display of float values by ubsan.
Use __BYTE_ORDER__ == __ORDER_BIG/LITTLE_ENDIAN__ as the condition
instead, which is supported by both clang and gcc.
Noticed while porting ubsan to s390x.
Patch by Marcin Kościelnicki!
Differential Revision: http://reviews.llvm.org/D17660
llvm-svn: 263077
Ben Langmuir [Wed, 9 Mar 2016 23:31:34 +0000 (23:31 +0000)]
[Modules] Add stdatomic to the list of builtin headers
Since it's provided by the compiler. This allows a system module map
file to declare a module for it.
No test change for cstd.m, since stdatomic.h doesn't function without a
relatively complete stdint.h and stddef.h, which tests using this module
don't provide.
rdar://problem/
24931246
llvm-svn: 263076
Philip Reames [Wed, 9 Mar 2016 23:19:56 +0000 (23:19 +0000)]
[BasicAA/MDA] Sink aliasing rules for malloc and calloc into BasicAA
MemoryDependenceAnalysis had a hard-coded exception to the general aliasing rules for malloc and calloc. The reasoning that applied there is equally valid in BasicAA and clarifies the remaining logic in MDA.
In principal, this can expose slightly more optimization opportunities, but since essentially all of our aliasing aware memory optimization passes go through MDA, this will likely be NFC in practice.
Differential Revision: http://reviews.llvm.org/D15912
llvm-svn: 263075
Philip Reames [Wed, 9 Mar 2016 23:13:12 +0000 (23:13 +0000)]
[CGP] Duplicate addressing computation in cold paths if required to sink addressing mode
This patch teaches CGP to duplicate addressing mode computations into cold paths (detected via explicit cold attribute on calls) if required to let addressing mode be safely sunk into the basic block containing each load and store.
In general, duplicating code into cold blocks may result in code growth, but should not effect performance. In this case, it's better to duplicate some code than to put extra pressure on the register allocator by making it keep the address through the entirely of the fast path.
This patch only handles addressing computations, but in principal, we could implement a more general cold cold scheduling heuristic which tries to reduce register pressure in the fast path by duplicating code into the cold path. Getting the profitability of the general case right seemed likely to be challenging, so I stuck to the existing case (addressing computation) we already had.
Differential Revision: http://reviews.llvm.org/D17652
llvm-svn: 263074
Philip Reames [Wed, 9 Mar 2016 23:07:53 +0000 (23:07 +0000)]
Fix the build
I screwed up rebasing 263072. This change fixes the build and passes all make check.
llvm-svn: 263073
Philip Reames [Wed, 9 Mar 2016 22:59:30 +0000 (22:59 +0000)]
[LICM] Store promotion when memory is thread local
This patch teaches LICM's implementation of store promotion to exploit the fact that the memory location being accessed might be provable thread local. The fact it's thread local weakens the requirements for where we can insert stores since no other thread can observe the write. This allows us perform store promotion even in cases where the store is not guaranteed to execute in the loop.
Two key assumption worth drawing out is that this assumes a) no-capture is strong enough to imply no-escape, and b) standard allocation functions like malloc, calloc, and operator new return values which can be assumed not to have previously escaped.
In future work, it would be nice to generalize this so that it works without directly seeing the allocation site. I believe that the nocapture return attribute should be suitable for this purpose, but haven't investigated carefully. It's also likely that we could support unescaped allocas with similar reasoning, but since SROA and Mem2Reg should destroy those, they're less interesting than they first might seem.
Differential Revision: http://reviews.llvm.org/D16783
llvm-svn: 263072
Sean Silva [Wed, 9 Mar 2016 22:30:09 +0000 (22:30 +0000)]
Use %t as the output file name to avoid repetition. NFC.
llvm-svn: 263071
Sean Silva [Wed, 9 Mar 2016 22:30:05 +0000 (22:30 +0000)]
[lto] Add saving the LTO .o file to -save-temps.
Summary:
This implements another part of -save-temps.
After this, the only remaining part is dumping the optimized bitcode. But
currently LLD's LTO doesn't have a non-intrusive place to put this.
Eventually we probably will and it will make sense to add it then.
Reviewers: ruiu, rafael
Subscribers: joker.eph, Bigcheese, llvm-commits
Differential Revision: http://reviews.llvm.org/D18009
llvm-svn: 263070
Sanjay Patel [Wed, 9 Mar 2016 22:23:33 +0000 (22:23 +0000)]
[x86] fix cost model inaccuracy for vector memory ops
The irony of this patch is that one CPU that is affected is AMD Jaguar, and Jaguar
has a completely double-pumped AVX implementation. But getting the cost model to
reflect that is a much bigger problem. The small goal here is simply to improve on
the lie that !AVX2 == SandyBridge.
Differential Revision: http://reviews.llvm.org/D18000
llvm-svn: 263069
Derek Schuff [Wed, 9 Mar 2016 22:14:33 +0000 (22:14 +0000)]
[WebAssembly] Update known gcc test failures
llvm-svn: 263068
Sanjay Patel [Wed, 9 Mar 2016 22:12:08 +0000 (22:12 +0000)]
[x86, AVX] optimize masked loads with constant masks
Instead of a variable-blend instruction, form a blend with immediate because those are always cheaper.
Differential Revision: http://reviews.llvm.org/D17899
llvm-svn: 263067
Ted Woodward [Wed, 9 Mar 2016 22:05:17 +0000 (22:05 +0000)]
Fix "ninja check-lldb" crash in IRExecutionUnit.cpp
Summary:
From Adrian McCarthy:
"Running ninja check-lldb now has one crash in a Python process, due to deferencing a null pointer in IRExecutionUnit.cpp: candidate_sc.symbol is null, which leads to a call with a null this pointer."
Reviewers: zturner, spyffe, amccarth
Subscribers: ted, jingham, lldb-commits
Differential Revision: http://reviews.llvm.org/D17860
llvm-svn: 263066
Xinliang David Li [Wed, 9 Mar 2016 21:45:37 +0000 (21:45 +0000)]
Fix test failure on darwin-i386
llvm-svn: 263065
Jan Vesely [Wed, 9 Mar 2016 21:38:04 +0000 (21:38 +0000)]
ELF: link with BitWriter module
Fixes build broken by r263055.
llvm-svn: 263064
Rafael Espindola [Wed, 9 Mar 2016 21:37:22 +0000 (21:37 +0000)]
ELF: Remove non-standard ELF features from AMDGPU target.
Patch by Tom Stellard!
llvm-svn: 263063
Philip Reames [Wed, 9 Mar 2016 21:31:47 +0000 (21:31 +0000)]
[ValueTracking] Extract isKnownPositive [NFCI]
Extract out a generic interface from a recently landed patch and document a TODO in case compile time becomes a problem.
llvm-svn: 263062
Rui Ueyama [Wed, 9 Mar 2016 21:15:17 +0000 (21:15 +0000)]
Simplify. NFC.
In this context, MBRef.getBufferIdentifier() == Path.
llvm-svn: 263061
Davide Italiano [Wed, 9 Mar 2016 21:09:51 +0000 (21:09 +0000)]
[modules] Simplify code logic. NFC.
llvm-svn: 263060
Philip Reames [Wed, 9 Mar 2016 21:05:07 +0000 (21:05 +0000)]
[InstCombine] (icmp sgt smin(PosA, B) 0) -> (icmp sgt B 0)
When checking whether an smin is positive, we can move the comparison to one of the inputs if the other is known positive. If the known positive one is the min, then the other can't be negative. If the other is the min, then we compute the min.
Differential Revision: http://reviews.llvm.org/D17873
llvm-svn: 263059
Adam Nemet [Wed, 9 Mar 2016 20:47:55 +0000 (20:47 +0000)]
[LLE] Add missing check for unit stride
I somehow missed this. The case in GCC (global_alloc) was similar to
the new testcase except it had an array of structs rather than a two
dimensional array.
Fixes RP26885.
llvm-svn: 263058
Sean Silva [Wed, 9 Mar 2016 20:06:24 +0000 (20:06 +0000)]
Update for Rui's comments on D18006
Somehow I missed them.
llvm-svn: 263057
Tim Northover [Wed, 9 Mar 2016 20:06:10 +0000 (20:06 +0000)]
ARM & AArch64: fix IR-converted tests.
My script was converting %a0 to [[A]]0 if it had seen %a defined before %a0.
Oops.
llvm-svn: 263056
Sean Silva [Wed, 9 Mar 2016 20:01:08 +0000 (20:01 +0000)]
[lto] Add beginning of -save-temps option.
Summary:
This is useful for debugging issues with LTO.
The option follows the analogous option in ld64 and the gold plugin (per
Rafael's suggestion).
For starters, this only dumps the combined bitcode file.
In a future patch I will add dumping for the .o file.
The naming of the output follows ld64's convention which is slightly more
consistent IMO (consistent `.lto.<extension>` for all the files).
Reviewers: rafael, ruiu
Subscribers: joker.eph, Bigcheese, llvm-commits
Differential Revision: http://reviews.llvm.org/D18006
llvm-svn: 263055
Evandro Menezes [Wed, 9 Mar 2016 19:56:38 +0000 (19:56 +0000)]
[AArch64] Minor reformatting (NFC).
llvm-svn: 263054
Dmitry Polukhin [Wed, 9 Mar 2016 19:39:16 +0000 (19:39 +0000)]
NFC fix documentation build by rL263015
This time I hope it will fix the build for real.
llvm-svn: 263052
Kit Barton [Wed, 9 Mar 2016 19:28:31 +0000 (19:28 +0000)]
[PPC] FE support for generating VSX [negated] absolute value instructions
Includes new built-in, conversion of built-in to target-independent intrinsic
and update in the header file. Tests are also updated. There is a second part in
the backend for which I will post a separate code-review. BACKEND PART SHOULD BE
COMMITTED FIRST.
Phabricator: http://reviews.llvm.org/D17816
llvm-svn: 263051
Hemant Kulkarni [Wed, 9 Mar 2016 19:16:13 +0000 (19:16 +0000)]
[llvm-readobj] Enable GNU style section group print
Differential Revision: http://reviews.llvm.org/D17822
llvm-svn: 263050
Jim Ingham [Wed, 9 Mar 2016 18:59:13 +0000 (18:59 +0000)]
Add an "offset" option to "break set -n" and "break set -f -l".
That way you can set offset breakpoints that will move as the function they are
contained in moves (which address breakpoints can't do...)
I don't align the new address to instruction boundaries yet, so you have to get
this right yourself for now.
<rdar://problem/
13365575>
llvm-svn: 263049
Tim Northover [Wed, 9 Mar 2016 18:54:42 +0000 (18:54 +0000)]
ARM & AArch64: convert asm tests to LLVM IR and restrict optimizations.
This is mostly a one-time autoconversion of tests that checked assembly after
"-Owhatever" compiles to only run "opt -mem2reg" and check the assembly. This
should make them much more stable to changes in LLVM so they won't break on
unrelated changes.
"opt -mem2reg" is a compromise designed to increase the readability of tests
that check dataflow, while minimizing dependency on LLVM. Hopefully mem2reg is
stable enough that no surpises will come along.
Should address http://llvm.org/PR26815.
llvm-svn: 263048