Simon Pilgrim [Thu, 11 Jun 2015 07:46:37 +0000 (07:46 +0000)]
[X86][SSE] Vectorized i8 and i16 shift operators
This patch ensures that SHL/SRL/SRA shifts for i8 and i16 vectors avoid scalarization. It builds on the existing i8 SHL vectorized implementation of moving the shift bits up to the sign bit position and separating the 4, 2 & 1 bit shifts with several improvements:
1 - SSE41 targets can use (v)pblendvb directly with the sign bit instead of performing a comparison to feed into a VSELECT node.
2 - pre-SSE41 targets were masking + comparing with an 0x80 constant - we avoid this by using the fact that a set sign bit means a negative integer which can be compared against zero to then feed into VSELECT, avoiding the need for a constant mask (zero generation is much cheaper).
3 - SRA i8 needs to be unpacked to the upper byte of a i16 so that the i16 psraw instruction can be correctly used for sign extension - we have to do more work than for SHL/SRL but perf tests indicate that this is still beneficial.
The i16 implementation is similar but simpler than for i8 - we have to do 8, 4, 2 & 1 bit shifts but less shift masking is involved. SSE41 use of (v)pblendvb requires that the i16 shift amount is splatted to both bytes however.
Tested on SSE2, SSE41 and AVX machines.
Differential Revision: http://reviews.llvm.org/D9474
llvm-svn: 239509
Arnaud A. de Grandmaison [Thu, 11 Jun 2015 07:45:05 +0000 (07:45 +0000)]
[PHIElim] Use ranges and const-ify, NFC.
llvm-svn: 239508
Nemanja Ivanovic [Thu, 11 Jun 2015 06:25:36 +0000 (06:25 +0000)]
Clang support for vector quad bit permute and gather instructions through builtins
This patch corresponds to review:
http://reviews.llvm.org/D10095
This is for just two instructions and related builtins:
vbpermq
vgbbd
llvm-svn: 239506
Nemanja Ivanovic [Thu, 11 Jun 2015 06:21:25 +0000 (06:21 +0000)]
LLVM support for vector quad bit permute and gather instructions through builtins
This patch corresponds to review:
http://reviews.llvm.org/D10096
This is the back end portion of the patch related to D10095.
The patch adds the instructions and back end intrinsics for:
vbpermq
vgbbd
llvm-svn: 239505
Richard Smith [Thu, 11 Jun 2015 03:05:39 +0000 (03:05 +0000)]
[modules] Fix a few places where merging wasn't performed if modules was disabled but local module visibilty was enabled.
llvm-svn: 239504
David Majnemer [Thu, 11 Jun 2015 02:38:06 +0000 (02:38 +0000)]
[MS Compatibility] Handle cleanups we create for a ctor closure
This fixes PR23801.
llvm-svn: 239503
Reid Kleckner [Thu, 11 Jun 2015 01:31:48 +0000 (01:31 +0000)]
Revert "Move dllimport name mangling to IR mangler."
This reverts commit r239437.
This broke clang-cl self-hosts. We'd end up calling the __imp_ symbol
directly instead of using it to do an indirect function call.
llvm-svn: 239502
Pete Cooper [Thu, 11 Jun 2015 01:04:56 +0000 (01:04 +0000)]
Remove MachineModuleInfo::UsedFunctions as it has no users.
It hasn't been used since r130964.
This also removes MachineModuleInfo::isUsedFunction and
MachineModuleInfo::AnalyzeModule, both of which were only
there to support UsedFunctions.
llvm-svn: 239501
David Majnemer [Thu, 11 Jun 2015 00:45:44 +0000 (00:45 +0000)]
[MS ABI] Allow fastcall member function pointers to get CodeGen'd
This restriction appears unnecessary and most likely came about during
early work for musttail.
llvm-svn: 239500
David Majnemer [Thu, 11 Jun 2015 00:20:57 +0000 (00:20 +0000)]
[MS ABI] Allow memfn pointers with unconvertible types to be formed
Remove the restriction which forbade forming pointers to member
functions which had parameter types or return types which were not
convertible.
llvm-svn: 239499
Chris Bieneman [Wed, 10 Jun 2015 23:55:07 +0000 (23:55 +0000)]
[CMake] Cleanup add_compiler_rt_object_library to be platform-agnostic
Summary:
This change takes darwin-specific goop that was scattered around CMakeLists files and spread between add_compiler_rt_object_library and add_compiler_rt_darwin_object_library and moves it all under add_compiler_rt_object_library.
The goal of this is to try to push platform handling as low in the utility functions as possible.
Reviewers: rnk, samsonov
Reviewed By: rnk, samsonov
Subscribers: rnk, rsmith, llvm-commits
Differential Revision: http://reviews.llvm.org/D10250
llvm-svn: 239498
Sanjay Patel [Wed, 10 Jun 2015 23:27:33 +0000 (23:27 +0000)]
change assert that will never fire to llvm_unreachable
llvm-svn: 239497
Alexei Starovoitov [Wed, 10 Jun 2015 22:59:13 +0000 (22:59 +0000)]
[bpf] add support for BPF backend
add support for bpfel/bpfeb targets
llvm-svn: 239496
Jingyue Wu [Wed, 10 Jun 2015 22:54:02 +0000 (22:54 +0000)]
[NFC] added a missing space
llvm-svn: 239495
Richard Smith [Wed, 10 Jun 2015 22:49:14 +0000 (22:49 +0000)]
Work around MSVC miscompilation.
llvm-svn: 239494
Pete Cooper [Wed, 10 Jun 2015 22:38:46 +0000 (22:38 +0000)]
Stop returning a Use* from allocHungOffUses.
This always just set the User::OperandList which is now set
in that method instead of being returned.
Reviewed by Duncan Exon Smith.
llvm-svn: 239493
Pete Cooper [Wed, 10 Jun 2015 22:38:41 +0000 (22:38 +0000)]
Add User::growHungoffUses and use it to grow the hung off uses. NFC.
PhiNode, SwitchInst, LandingPad and IndirectBr all had virtually identical
logic for growing the hung off uses.
Move it to User so that they can all call a single shared implementation.
Their destructors were all empty after this change and were deleted. They all
have virtual clone_impl methods which can be used as vtable anchors.
Reviewed by Duncan Exon Smith.
llvm-svn: 239492
Pete Cooper [Wed, 10 Jun 2015 22:38:38 +0000 (22:38 +0000)]
Delete User::dropHungOffUses and move it in to ~User which is the only caller. NFC.
Now that the subclasses which care about hung off uses let ~User clean it up,
there's no need for a separate method. Just inline it to ~User and delete it.
Reviewed by Duncan Exon Smith.
llvm-svn: 239491
Pete Cooper [Wed, 10 Jun 2015 22:38:34 +0000 (22:38 +0000)]
Make User track whether a class has 'hung off uses' and delete them in its destructor.
Currently all of the logic for deleting hung off uses, which PHI/switch/etc use,
is in their classes.
This adds a bit to Value which tracks whether that user had hung off uses,
then User can be responsible for clearing them instead of the sub classes.
Note, the bit used here was taken from NumOperands which was 30-bits.
Given the reduction to 29 bits, and the average User being just over 100 bytes,
a single User with 29-bits of num operands would need 50GB of RAM for itself
so its reasonable to assume that 29-bits is enough for now.
This is a step towards hiding all the hung off uses logic in the User.
Reviewed by Duncan Exon Smith.
llvm-svn: 239490
Pete Cooper [Wed, 10 Jun 2015 22:38:30 +0000 (22:38 +0000)]
Move the special Phi logic for hung off uses in to User::allocHungOffUses. NFC.
PhiNode's need to allocate space for an array of Use[N] and then BasicBlock*[N].
They had their own allocHungOffUses to handle all of this. This moves the logic
in to User::allocHungOffUses and PhiNode passes in a bool to say to allocate
the BB* space too.
Reviewed by Duncan Exon Smith.
llvm-svn: 239489
Peter Collingbourne [Wed, 10 Jun 2015 21:14:34 +0000 (21:14 +0000)]
ArgumentPromotion: Drop sret attribute on functions that are only called directly.
If the first argument to a function is a 'this' argument and the second
has the sret attribute, the ArgumentPromotion pass may promote the 'this'
argument to more than one argument, violating the IR constraint that 'sret'
may only be applied to the first or second argument.
Although this IR constraint is arguably unnecessary, it highlighted the fact
that ArgPromotion does not need to preserve this attribute. Dropping the
attribute reduces register pressure in the backend by avoiding the register
copy required by sret. Because sret implies noalias, we also replace the
former with the latter.
Differential Revision: http://reviews.llvm.org/D10353
llvm-svn: 239488
Richard Smith [Wed, 10 Jun 2015 20:36:34 +0000 (20:36 +0000)]
[modules] Don't allow use of non-visible (inherited) default template arguments.
llvm-svn: 239487
Sanjay Patel [Wed, 10 Jun 2015 20:32:21 +0000 (20:32 +0000)]
[x86] Add a reassociation optimization to increase ILP via the MachineCombiner pass
This is a reimplementation of D9780 at the machine instruction level rather than the DAG.
Use the MachineCombiner pass to reassociate scalar single-precision AVX additions (just a
starting point; see the TODO comments) to increase ILP when it's safe to do so.
The code is closely based on the existing MachineCombiner optimization that is implemented
for AArch64.
This patch should not cause the kind of spilling tragedy that led to the reversion of r236031.
Differential Revision: http://reviews.llvm.org/D10321
llvm-svn: 239486
Richard Smith [Wed, 10 Jun 2015 20:30:23 +0000 (20:30 +0000)]
[modules] Track all default template arguments for a given parameter across
modules, and allow use of a default template argument if any of the parameters
providing it is visible.
llvm-svn: 239485
Sanjay Patel [Wed, 10 Jun 2015 19:52:58 +0000 (19:52 +0000)]
punctuation policing; NFC
llvm-svn: 239484
Serge Pavlov [Wed, 10 Jun 2015 19:06:59 +0000 (19:06 +0000)]
Do not parse members of incomplete class.
If definition of a class is unknown and out-of-line definition of its
member is encountered, do not parse the member declaration.
This change fixes PR18542.
Differential Revision: http://reviews.llvm.org/D8010
llvm-svn: 239483
Reid Kleckner [Wed, 10 Jun 2015 18:14:07 +0000 (18:14 +0000)]
[WinEH] _except_handlerN uses 0 instead of 1 to indicate catch-all
Our usage of 1 was a holdover from __C_specific_handler.
llvm-svn: 239482
Teresa Johnson [Wed, 10 Jun 2015 17:49:45 +0000 (17:49 +0000)]
Pass down the -flto option to the -cc1 job, and from there into the
CodeGenOptions and onto the PassManagerBuilder. This enables gating
the new EliminateAvailableExternally module pass on whether we are
preparing for LTO.
If we are preparing for LTO (e.g. a -flto -c compile), the new pass is not
included as we want to preserve available externally functions for possible
link time inlining.
llvm-svn: 239481
Teresa Johnson [Wed, 10 Jun 2015 17:49:28 +0000 (17:49 +0000)]
Add new EliminateAvailableExternally module pass, which is performed in
O2 compiles just before GlobalDCE, unless we are preparing for LTO.
This pass eliminates available externally globals (turning them into
declarations), regardless of whether they are dead/unreferenced, since
we are guaranteed to have a copy available elsewhere at link time.
This enables additional opportunities for GlobalDCE.
If we are preparing for LTO (e.g. a -flto -c compile), the pass is not
included as we want to preserve available externally functions for possible
link time inlining. The FE indicates whether we are doing an -flto compile
via the new PrepareForLTO flag on the PassManagerBuilder.
llvm-svn: 239480
Alexey Samsonov [Wed, 10 Jun 2015 17:37:38 +0000 (17:37 +0000)]
[GVN] Set proper debug locations for some instructions created by GVN.
Determining proper debug locations for instructions created in
PHITransAddr is tricky. We use a simple approach here and simply copy
debug locations from instructions computing load address to
"corresponding" instructions re-creating the address computation
in predecessor basic blocks.
This may not always be correct, given all the rearrangement and
simplification going on, and debug locations may jump around a lot,
as the basic blocks we copy locations between may be very far from
each other.
Still, this would work good in most simple cases (e.g. when chain
of address computing instruction is short, or our mapping turns out
to be 1-to-1), and we desire to have *some* reasonable debug locations
associated with newly inserted instructions.
See http://reviews.llvm.org/D10351 review thread for more details.
Test Plan: regression test suite
Reviewers: spatel, dblaikie
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10351
llvm-svn: 239479
Sanjay Patel [Wed, 10 Jun 2015 17:08:12 +0000 (17:08 +0000)]
fix typo in comment; NFC
llvm-svn: 239478
Colin LeMahieu [Wed, 10 Jun 2015 16:52:32 +0000 (16:52 +0000)]
[Hexagon] Adding decoders for signed operands and ensuring all signed operand types disassemble correctly.
llvm-svn: 239477
Scott Douglass [Wed, 10 Jun 2015 15:18:23 +0000 (15:18 +0000)]
some StmtExprs do not have side-effects
Differential Revision: http://reviews.llvm.org/D10211
llvm-svn: 239476
Benjamin Kramer [Wed, 10 Jun 2015 14:43:59 +0000 (14:43 +0000)]
[Hexagon] Make global arrays 'static const'. NFC.
llvm-svn: 239475
Scott Douglass [Wed, 10 Jun 2015 13:53:15 +0000 (13:53 +0000)]
add ConstEvaluatedExprVisitor
Differential Revision: http://reviews.llvm.org/D10210
llvm-svn: 239474
Igor Laevsky [Wed, 10 Jun 2015 13:24:00 +0000 (13:24 +0000)]
[Statepoints] Add test case to check that statepoint is marked with Throwable attribute.
Differential Revision: http://reviews.llvm.org/D10215
llvm-svn: 239473
Igor Laevsky [Wed, 10 Jun 2015 12:31:53 +0000 (12:31 +0000)]
[StatepointLowering] Reuse stack slots across basic blocks
During statepoint lowering we can sometimes avoid spilling of the value if we know that it was already spilled for previous statepoint.
We were doing this by checking if incoming statepoint value was lowered into load from stack slot. This was working only in boundaries of one basic block.
But instead of looking at the lowered node we can look directly at the llvm-ir value and if it was gc.relocate (or some simple modification of it) look up stack slot for it's derived pointer and reuse stack slot from it. This allows us to look across basic block boundaries.
Differential Revision: http://reviews.llvm.org/D10251
llvm-svn: 239472
Daniel Sanders [Wed, 10 Jun 2015 12:11:26 +0000 (12:11 +0000)]
Replace string GNU Triples with llvm::Triple in MCSubtargetInfo and create*MCSubtargetInfo(). NFC.
Summary:
This continues the patch series to eliminate StringRef forms of GNU triples
from the internals of LLVM that began in r239036.
Reviewers: rafael
Reviewed By: rafael
Subscribers: rafael, ted, jfb, llvm-commits, rengolin, jholewinski
Differential Revision: http://reviews.llvm.org/D10311
llvm-svn: 239467
Alexander Musman [Wed, 10 Jun 2015 11:20:26 +0000 (11:20 +0000)]
PR5172: Fix for a bug in pragma redefine_extname implementation:
it doesn't work correctly when a structure is declared before pragma
and then a function with the same name declared after pragma.
Patch by Andrey Bokhanko
Differential Revision: http://reviews.llvm.org/D10187
llvm-svn: 239466
Daniel Sanders [Wed, 10 Jun 2015 10:54:40 +0000 (10:54 +0000)]
Replace string GNU Triples with llvm::Triple in create*MCRelocationInfo(). NFC.
Summary:
This continues the patch series to eliminate StringRef forms of GNU triples
from the internals of LLVM that began in r239036.
Reviewers: rafael
Reviewed By: rafael
Subscribers: rafael, llvm-commits, rengolin
Differential Revision: http://reviews.llvm.org/D10307
llvm-svn: 239465
Daniel Sanders [Wed, 10 Jun 2015 10:35:34 +0000 (10:35 +0000)]
Replace string GNU Triples with llvm::Triple in MCAsmBackend subclasses and create*AsmBackend(). NFC.
Summary:
This continues the patch series to eliminate StringRef forms of GNU triples
from the internals of LLVM that began in r239036.
Reviewers: echristo, rafael
Reviewed By: rafael
Subscribers: rafael, llvm-commits, rengolin
Differential Revision: http://reviews.llvm.org/D10243
llvm-svn: 239464
Mohit K. Bhakkad [Wed, 10 Jun 2015 10:02:21 +0000 (10:02 +0000)]
[LLDB][MIPS] Getting correct signals for MIPS Host
Patch by Nitesh Jain
Reviewers: clayborg, ovyalov.
Subscribers: jaydeep, bhushan, dsanders, mohit.bhakkad, sagar, labath, lldb-commits.
Differential Revision: http://reviews.llvm.org/D10180
llvm-svn: 239463
Daniel Jasper [Wed, 10 Jun 2015 09:21:09 +0000 (09:21 +0000)]
clang-format: [JS] Only special case top level object literal
assignments as enums.
Top level object literals are treated as enums, and their k/v pairs are put on
separate lines:
X.Y = {
A: 1,
B: 2
};
However assignments within blocks should not be affected:
function x() {
y = {a:1, b:2};
}
This change fixes the second case. Patch by Martin Probst.
llvm-svn: 239462
Yury Gribov [Wed, 10 Jun 2015 07:16:02 +0000 (07:16 +0000)]
[ASan] Quick-fix tests for new string interceptors.
Patch by Maria Guseva.
Differential Revision: http://reviews.llvm.org/D10336
llvm-svn: 239461
Elena Demikhovsky [Wed, 10 Jun 2015 06:49:28 +0000 (06:49 +0000)]
AVX-512: Fixed a bug in comparison of i1 vectors.
cmp eq should give kxnor instruction
cmp neq should give kxor
https://llvm.org/bugs/show_bug.cgi?id=23631
llvm-svn: 239460
Yaron Keren [Wed, 10 Jun 2015 06:00:59 +0000 (06:00 +0000)]
Replace magic number 19 with the constant GlobalValueSubClassDataBits.
llvm-svn: 239459
Rui Ueyama [Wed, 10 Jun 2015 04:21:47 +0000 (04:21 +0000)]
COFF: De-virtualize and inline garbage collector functions.
isRoot, isLive and markLive functions are called very frequently.
Previously, they were virtual functions. This patch make them
non-virtual.
Also this patch checks chunk liveness before calling its mark().
Previously, we did that at beginning of markLive(), so the virtual
function would return immediately if it's live. That was inefficient.
llvm-svn: 239458
Yunzhong Gao [Wed, 10 Jun 2015 03:19:08 +0000 (03:19 +0000)]
Fix the test case to handle different IR variable names.
llvm-svn: 239457
Alexei Starovoitov [Wed, 10 Jun 2015 03:06:06 +0000 (03:06 +0000)]
fix crash
fix segfault by checking for UnknownArch, since
getArchTypePrefix() will return nullptr for UnknownArch.
This fixes regression caused by r238424.
llvm-svn: 239456
Craig Topper [Wed, 10 Jun 2015 02:07:37 +0000 (02:07 +0000)]
Remove unnecessary conversion from StringRef to std::string and back to StringRef. NFC.
llvm-svn: 239455
Richard Smith [Wed, 10 Jun 2015 01:47:58 +0000 (01:47 +0000)]
[modules] Reconstruct template default argument inheritance on reload rather
than wasting storage and triggering eager deserializations by serializing it.
llvm-svn: 239454
Sean Silva [Wed, 10 Jun 2015 01:37:59 +0000 (01:37 +0000)]
[cleanup] Remove unused default argument and tidy up.
The RequestingModule argument was unused and always its default value of
nullptr.
Also move a declaration closer to its use, and range-for'ify.
llvm-svn: 239453
Richard Smith [Wed, 10 Jun 2015 01:36:14 +0000 (01:36 +0000)]
Revert accidentally-committed test change from r239447.
llvm-svn: 239452
Reid Kleckner [Wed, 10 Jun 2015 01:34:54 +0000 (01:34 +0000)]
[WinEH] Call llvm.stackrestore in __except blocks
We have to do this manually, the runtime only sets up ebp. Fixes a crash
when returning after catching an exception.
llvm-svn: 239451
Oleksiy Vyalov [Wed, 10 Jun 2015 01:34:25 +0000 (01:34 +0000)]
Mark TestMultithreaded as XTIMEOUT on Linux.
llvm-svn: 239450
Reid Kleckner [Wed, 10 Jun 2015 01:13:44 +0000 (01:13 +0000)]
Remove safeseh debug print and remove extra braces
llvm-svn: 239449
Reid Kleckner [Wed, 10 Jun 2015 01:02:30 +0000 (01:02 +0000)]
[WinEH] Emit .safeseh directives for all 32-bit exception handlers
Use a "safeseh" string attribute to do this. You would think we chould
just accumulate the set of personalities like we do on dwarf, but this
fails to account for the LSDA-loading thunks we use for
__CxxFrameHandler3. Each of those needs to make it into .sxdata as well.
The string attribute seemed like the most straightforward approach.
llvm-svn: 239448
Richard Smith [Wed, 10 Jun 2015 00:29:03 +0000 (00:29 +0000)]
Refactor storage of default template arguments.
This is just a preparatory step towards fixing visibility for default template
arguments in modules builds.
llvm-svn: 239447
Yunzhong Gao [Wed, 10 Jun 2015 00:27:52 +0000 (00:27 +0000)]
Implementing C99 partial re-initialization behavior (DR-253)
Based on previous discussion on the mailing list, clang currently lacks support
for C99 partial re-initialization behavior:
Reference: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-April/029188.html
Reference: http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_253.htm
This patch attempts to fix this problem.
Given the following code snippet,
struct P1 { char x[6]; };
struct LP1 { struct P1 p1; };
struct LP1 l = { .p1 = { "foo" }, .p1.x[2] = 'x' };
// this example is adapted from the example for "struct fred x[]" in DR-253;
// currently clang produces in l: { "\0\0x" },
// whereas gcc 4.8 produces { "fox" };
// with this fix, clang will also produce: { "fox" };
Differential Review: http://reviews.llvm.org/D5789
llvm-svn: 239446
Reid Kleckner [Wed, 10 Jun 2015 00:04:53 +0000 (00:04 +0000)]
Fix -Wsign-compare warning in WinException.cpp
llvm-svn: 239445
Pete Cooper [Tue, 9 Jun 2015 23:33:35 +0000 (23:33 +0000)]
Fix warning of comparing different enums. NFC
llvm-svn: 239443
NAKAMURA Takumi [Tue, 9 Jun 2015 23:33:25 +0000 (23:33 +0000)]
Add explicit -mtriple=arm-unknown to llvm/test/CodeGen/ARM/disable-tail-calls.ll, to satisfy *-win32.
llvm-svn: 239442
Pete Cooper [Tue, 9 Jun 2015 22:35:55 +0000 (22:35 +0000)]
Revert "Move MCSymbol Value in to the union of Offset and CommonSize."
This reverts commit
2e449ec5bcdf67b52b315b16c2128aaf25d5b73c.
This was svn r239440. Its currently failing an ARM test so reverting while I work out
what to do next.
llvm-svn: 239441
Pete Cooper [Tue, 9 Jun 2015 22:21:37 +0000 (22:21 +0000)]
Move MCSymbol Value in to the union of Offset and CommonSize.
It wasn't possible to have a variable Symbol with offset or 'isCommon' so
this just enables better packing of the MCSymbol class.
Reviewed by Rafael Espindola.
llvm-svn: 239440
Tobias Edler von Koch [Tue, 9 Jun 2015 22:10:58 +0000 (22:10 +0000)]
[RegisterScavenger] Fix handling of predicated instructions
Summary:
The RegisterScavenger explicitly ignores <kill> flags on operands of
predicated instructions and therefore assumes that such registers remain
live. When it then scavenges such a register, it inserts a spill of this
(killed) register. This is invalid code and gets flagged up by the
verifier.
Nowadays kill flags are set correctly on predicated instructions. This
patch makes the Scavenger respect them.
The bug has so far only been triggered by an internal pass, so I don't
have a test case unfortunately.
Fixes PR23119.
Reviewers: hfinkel, tobiasvk_caf
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9039
llvm-svn: 239439
Alexey Samsonov [Tue, 9 Jun 2015 22:10:29 +0000 (22:10 +0000)]
[BasicBlockUtils] Set debug locations for instructions created in SplitBlockPredecessors.
Test Plan: regression test suite
Reviewers: eugenis, dblaikie
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10343
llvm-svn: 239438
Peter Collingbourne [Tue, 9 Jun 2015 22:09:53 +0000 (22:09 +0000)]
Move dllimport name mangling to IR mangler.
This ensures that LTO clients see the correct external symbol name.
Differential Revision: http://reviews.llvm.org/D10318
llvm-svn: 239437
Peter Collingbourne [Tue, 9 Jun 2015 21:52:48 +0000 (21:52 +0000)]
COFF: Implement /lib using LibDriver.
Differential Revision: http://reviews.llvm.org/D10347
llvm-svn: 239436
Jingyue Wu [Tue, 9 Jun 2015 21:50:32 +0000 (21:50 +0000)]
[NVPTX] fix a crash bug in NVPTXFavorNonGenericAddrSpaces
Summary:
We used to assume V->RAUW only modifies the operand list of V's user.
However, if V and V's user are Constants, RAUW may replace and invalidate V's
user entirely.
This patch fixes the above issue by letting the caller replace the
operand instead of calling RAUW on Constants.
Test Plan: @nested_const_expr and @rauw in access-non-generic.ll
Reviewers: broune, jholewinski
Reviewed By: broune, jholewinski
Subscribers: jholewinski, llvm-commits
Differential Revision: http://reviews.llvm.org/D10345
llvm-svn: 239435
Peter Collingbourne [Tue, 9 Jun 2015 21:50:22 +0000 (21:50 +0000)]
LibDriver, llvm-lib: introduce.
llvm-lib is intended to be a lib.exe compatible utility that also
understands bitcode. The implementation lives in a library so that
lld can use it to implement /lib.
Differential Revision: http://reviews.llvm.org/D10297
llvm-svn: 239434
Reid Kleckner [Tue, 9 Jun 2015 21:42:19 +0000 (21:42 +0000)]
[WinEH] Add 32-bit SEH state table emission prototype
This gets all the handler info through to the asm printer and we can
look at the .xdata tables now. I've convinced one small catch-all test
case to work, but other than that, it would be a stretch to say this is
functional.
The state numbering algorithm avoids doing any scope reconstruction as
we do for C++ to simplify the implementation.
llvm-svn: 239433
Chad Rosier [Tue, 9 Jun 2015 20:59:41 +0000 (20:59 +0000)]
[AArch64] Remove an overly conservative check when generating store pairs.
Store instructions do not modify register values and therefore it's safe
to form a store pair even if the source register has been read in between
the two store instructions.
Previously, the read of w1 (see below) prevented the formation of a stp.
str w0, [x2]
ldr w8, [x2, #8]
add w0, w8, w1
str w1, [x2, #4]
ret
We now generate the following code.
stp w0, w1, [x2]
ldr w8, [x2, #8]
add w0, w8, w1
ret
All correctness tests with -Ofast on A57 with Spec200x and EEMBC pass.
Performance results for SPEC2K were within noise.
llvm-svn: 239432
Pete Cooper [Tue, 9 Jun 2015 20:58:03 +0000 (20:58 +0000)]
Use AlignOf traits to enable static_assert.
This is better than runtime asserts. Thanks to David Blaikie for the help here.
llvm-svn: 239431
Benjamin Kramer [Tue, 9 Jun 2015 20:41:21 +0000 (20:41 +0000)]
Replace loop with std::equal. NFC intended.
llvm-svn: 239430
Pete Cooper [Tue, 9 Jun 2015 20:41:08 +0000 (20:41 +0000)]
Reduce duplication in MCSymbol Name handling. NFC>
Based on feedback to r239428 by David Blaikie, use const_cast to reduce
duplication of the const and non-const versions of getNameEntryPtr.
Also have that method return the pointer to the name directly instead
of users having to then get the name from the union.
Finally, add a FIXME that we should use a static_assert once available in
the new operator.
llvm-svn: 239429
Pete Cooper [Tue, 9 Jun 2015 19:56:05 +0000 (19:56 +0000)]
Make MCSymbol::Name be a union of uint64_t and a pointer.
This should hopefully fix the 32-bit bots which were allocating space for a pointer
but needed to be aligned to 64-bits.
Now we allocate enough space for a uint64_t and a pointer and cast to the appropriate storage
llvm-svn: 239428
Akira Hatanaka [Tue, 9 Jun 2015 19:07:19 +0000 (19:07 +0000)]
Remove DisableTailCalls from TargetOptions and the code in resetTargetOptions
that was resetting it.
Remove the uses of DisableTailCalls in subclasses of TargetLowering and use
the value of function attribute "disable-tail-calls" instead. Also,
unconditionally add pass TailCallElim to the pipeline and check the function
attribute at the start of runOnFunction to disable the pass on a per-function
basis.
This is part of the work to remove TargetMachine::resetTargetOptions, and since
DisableTailCalls was the last non-fast-math option that was being reset in that
function, we should be able to remove the function entirely after the work to
propagate IR-level fast-math flags to DAG nodes is completed.
Out-of-tree users should remove the uses of DisableTailCalls and make changes
to attach attribute "disable-tail-calls"="true" or "false" to the functions in
the IR.
rdar://problem/
13752163
Differential Revision: http://reviews.llvm.org/D10099
llvm-svn: 239427
Akira Hatanaka [Tue, 9 Jun 2015 19:04:36 +0000 (19:04 +0000)]
Attach attribute "disable-tail-calls" to the functions in the IR.
This commit adds back the code that seems to have been dropped unintentionally
in r176985.
rdar://problem/
13752163
Differential Revision: http://reviews.llvm.org/D10100
llvm-svn: 239426
Alexei Starovoitov [Tue, 9 Jun 2015 18:53:30 +0000 (18:53 +0000)]
[bpf] enable BPF backend in autoconf build
llvm-svn: 239425
Pete Cooper [Tue, 9 Jun 2015 18:50:18 +0000 (18:50 +0000)]
Change from alignof to llvm::alignOf to appease Visual Studio
llvm-svn: 239424
Pete Cooper [Tue, 9 Jun 2015 18:36:13 +0000 (18:36 +0000)]
Allocate space for MCSymbol::Name only if required.
Similarly to User which allocates a number of Use's prior to the this pointer,
allocate space for the Name* for MCSymbol only when we need a name.
Given that an MCSymbol is 48-bytes on 64-bit systems, this saves a decent % of space.
Given the verify_uselistorder test case with debug info and llc, 50k symbols have names
out of 700k so this optimises for the common case of temporary unnamed symbols.
Reviewed by David Blaikie.
llvm-svn: 239423
Arnold Schwaighofer [Tue, 9 Jun 2015 18:19:17 +0000 (18:19 +0000)]
MergeFunctions: Don't replace a weak function use by another equivalent weak function
We don't know whether the weak functions definition is the definitive definition.
rdar://
21303727
llvm-svn: 239422
David Majnemer [Tue, 9 Jun 2015 18:05:33 +0000 (18:05 +0000)]
[ItaniumMangle] Mangle long double as __float128 for some Power targets
GCC mangles long double like __float128 in order to support
compatibility with ABI variants which had a different interpretation of
long double.
This fixes PR23791.
llvm-svn: 239421
David Blaikie [Tue, 9 Jun 2015 18:01:51 +0000 (18:01 +0000)]
Revert "[DWARF] Fix a few corner cases in expression emission"
This reverts commit r239380 due to apparently GDB regressions:
http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75/builds/22562
llvm-svn: 239420
Chaoren Lin [Tue, 9 Jun 2015 17:54:27 +0000 (17:54 +0000)]
Rename `FileSpec::IsRelativeToCurrentWorkingDirectory` to `IsRelative`.
Summary:
`IsRelativeToCurrentWorkingDirectory` was misleading, because relative paths
are sometimes appended to other directories, not just the cwd. Plus, the new
name is shorter. Also added `IsAbsolute` for completeness.
Reviewers: clayborg, ovyalov
Reviewed By: ovyalov
Subscribers: tberghammer, lldb-commits
Differential Revision: http://reviews.llvm.org/D10262
llvm-svn: 239419
Rui Ueyama [Tue, 9 Jun 2015 17:52:17 +0000 (17:52 +0000)]
COFF: Split SymbolTable::addCombinedLTOObject. NFC.
llvm-svn: 239418
Reid Kleckner [Tue, 9 Jun 2015 17:49:42 +0000 (17:49 +0000)]
Revert "Re-land r236052, "[SEH] Add 32-bit lowering code for __try""
This reverts commit r239415. This was committed accidentally, LLVM isn't
ready for this.
llvm-svn: 239417
Reid Kleckner [Tue, 9 Jun 2015 17:47:59 +0000 (17:47 +0000)]
Disable style-on-command-line test on Windows
llvm-svn: 239416
Reid Kleckner [Tue, 9 Jun 2015 17:47:50 +0000 (17:47 +0000)]
Re-land r236052, "[SEH] Add 32-bit lowering code for __try"
This reverts r236167.
LLVM should be ready for this now.
llvm-svn: 239415
Chaoren Lin [Tue, 9 Jun 2015 17:39:27 +0000 (17:39 +0000)]
XFail pexpect tests for Windows hosts.
Reviewers: vharron, zturner
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D10340
llvm-svn: 239414
Rui Ueyama [Tue, 9 Jun 2015 16:52:56 +0000 (16:52 +0000)]
COFF: Update comment.
llvm-svn: 239413
Samuel Antao [Tue, 9 Jun 2015 16:29:34 +0000 (16:29 +0000)]
The constant initialization for globals in NVPTX is generated as an
array of bytes. The generation of this byte arrays was expecting
the host to be little endian, which prevents big endian hosts to be
used in the generation of the PTX code. This patch fixes the
problem by changing the way the bytes are extracted so that it
works for either little and big endian.
llvm-svn: 239412
Eli Bendersky [Tue, 9 Jun 2015 15:57:30 +0000 (15:57 +0000)]
Add more wrappers for symbol APIs to the C API.
This represents some of the functionality we expose in the llvmlite Python
binding.
Patch by Antoine Pitrou
Differential Revision: http://reviews.llvm.org/D10222
llvm-svn: 239411
Alexei Starovoitov [Tue, 9 Jun 2015 15:46:00 +0000 (15:46 +0000)]
[bpf] make BPF backend non-experimental
only cmake build change. autoconf build and docs will follow
email thread:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-June/thread.html#86523
llvm-svn: 239410
Rui Ueyama [Tue, 9 Jun 2015 15:20:42 +0000 (15:20 +0000)]
Remove object_error::success and use std::error_code() instead
make_error_code(object_error) is slow because object::object_category()
uses a ManagedStatic variable. But the real problem is that the function is
called too frequently. This patch uses std::error_code() instead of
object_error::success. In most cases, we return "success", so this patch
reduces number of function calls to that function.
http://reviews.llvm.org/D10333
llvm-svn: 239409
Bill Seurer [Tue, 9 Jun 2015 14:39:47 +0000 (14:39 +0000)]
[PowerPC] Reformat altivec.h with clang-format
This revision just fixes the formatting of altivec.h.
llvm-svn: 239408
Jonathan Roelofs [Tue, 9 Jun 2015 14:30:17 +0000 (14:30 +0000)]
Move target-specific Sema test to its own file.
Fixing the build-break introduced in r239406.
llvm-svn: 239407
Jonathan Roelofs [Tue, 9 Jun 2015 14:13:31 +0000 (14:13 +0000)]
Fix printing of GCCAsmExprs with input or output arguments.
Patch by Nick Sumner!
llvm-svn: 239406
Toma Tabacu [Tue, 9 Jun 2015 13:33:26 +0000 (13:33 +0000)]
Recommit "[mips] [IAS] Restore STI.FeatureBits in .set pop." (r239144).
Specified the llvm namespace for the 2 calls to make_unique() which caused
compilation errors in Visual Studio 2013.
llvm-svn: 239405
Daniel Jasper [Tue, 9 Jun 2015 13:16:54 +0000 (13:16 +0000)]
clang-format: Support //!-comments, increase test coverage.
llvm-svn: 239404