OSDN Git Service
David Majnemer [Tue, 9 Jul 2013 09:20:58 +0000 (09:20 +0000)]
InstCombine: variations on 0xffffffff - x >= 4
The following transforms are valid if -C is a power of 2:
(icmp ugt (xor X, C), ~C) -> (icmp ult X, C)
(icmp ult (xor X, C), -C) -> (icmp uge X, C)
These are nice, they get rid of the xor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185915
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 9 Jul 2013 08:09:32 +0000 (08:09 +0000)]
InstCombine: X & -C != -C -> X <= u ~C
Tests were added in r185910 somehow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185912
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Tue, 9 Jul 2013 07:59:25 +0000 (07:59 +0000)]
[PowerPC] Support .llong and fix .word
This adds support for the .llong PowerPC-specifc assembler directive.
In doing so, I notices that .word is currently incorrect: it is
supposed to define a 2-byte data element, not a 4-byte one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185911
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 9 Jul 2013 07:58:32 +0000 (07:58 +0000)]
Commit r185909 was a misapplied patch, fix it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185910
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 9 Jul 2013 07:50:59 +0000 (07:50 +0000)]
InstCombine: add more transforms
C1-X <u C2 -> (X|(C2-1)) == C1
C1-X >u C2 -> (X|C2) == C1
X-C1 <u C2 -> (X & -C2) == C1
X-C1 >u C2 -> (X & ~C2) == C1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185909
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 9 Jul 2013 06:34:51 +0000 (06:34 +0000)]
PPC: Allocate RS spill slot for unaligned i64 load/store
This fixes another bug found by llvm-stress!
If we happen to be doing an i64 load or store into a stack slot that has less
than a 4-byte alignment, then the frame-index elimination may need to use an
indexed load or store instruction (because the offset may not be a multiple of
4, a requirement of the STD/LD instructions). The extra register needed to hold
the offset comes from the register scavenger, and it is possible that the
scavenger will need to use an emergency spill slot. As a result, we need to
make sure that a spill slot is allocated when doing an i64 load/store into a
less-than-4-byte-aligned stack slot.
Because test cases for things like this tend to be fairly fragile, I've
concatenated a few small bugpoint-reduced test cases together to form the
regression test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185907
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 9 Jul 2013 05:26:25 +0000 (05:26 +0000)]
Compute the size of an archive member in the constructor.
It is always computed the same way (by parsing the header). Doing it in the
constructor simplifies the callers a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185905
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 9 Jul 2013 05:09:08 +0000 (05:09 +0000)]
Remove declare but not implemented methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185904
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 9 Jul 2013 03:39:35 +0000 (03:39 +0000)]
Move some code out of line. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185901
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Tue, 9 Jul 2013 02:07:28 +0000 (02:07 +0000)]
X86: Add comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185900
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Tue, 9 Jul 2013 02:07:25 +0000 (02:07 +0000)]
X86 fast-isel: Avoid explicit AH subreg reference for [SU]Rem.
Explicit references to %AH for an i8 remainder instruction can lead to
references to %AH in a REX prefixed instruction, which causes things to
blow up. Do the same thing in FastISel as we do for DAG isel and instead
shift %AX right by 8 bits and then extract the 8-bit subreg from that
result.
rdar://
14203849
http://llvm.org/bugs/show_bug.cgi?id=16105
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185899
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Tue, 9 Jul 2013 00:54:46 +0000 (00:54 +0000)]
Make BinaryRef output correctly in case of empty data.
Previously, it would simply output nothing, but it should output an
empty string `""`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185894
91177308-0d34-0410-b5e6-
96231b3b80d8
Stephen Lin [Tue, 9 Jul 2013 00:44:49 +0000 (00:44 +0000)]
Style fixes: remove unnecessary braces for one-statement if blocks, no else after return, etc. No funcionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185893
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 9 Jul 2013 00:16:56 +0000 (00:16 +0000)]
Revert "DebugInfo: remove unused helper function getDICompositeType."
This reverts commit r185876 as the functions appear to still be used
by dragonegg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185890
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Bendersky [Mon, 8 Jul 2013 23:57:07 +0000 (23:57 +0000)]
Fix comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185888
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Mon, 8 Jul 2013 23:31:13 +0000 (23:31 +0000)]
This patch changes the saved IRBuilder insert point from BasicBlock::iterator to AssertingVH.
Commit 185883 fixes a bug in the IRBuilder that should fix the ASan bot. AssertingVH can help in exposing some RAUW problems.
Thanks Ben and Alexey!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185886
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Mon, 8 Jul 2013 23:30:23 +0000 (23:30 +0000)]
[objc-arc] Fix assertion in EraseInstruction so that noop on null calls when passed null do not trigger the assert.
The specific case of interest is when objc_retainBlock is passed null.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185885
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Mon, 8 Jul 2013 23:27:43 +0000 (23:27 +0000)]
Fix a bug in IRBuilder::ClearInsertionPoint. The IR Builder needs to reset both the BB and the insert point inside the BB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185883
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Mon, 8 Jul 2013 23:23:03 +0000 (23:23 +0000)]
Don't run internalize if we're outputing bit-code and not an object file.
The problem with running internalize before we're ready to output an object file
is that it may change a 'weak' symbol into an internal one, but that symbol
could be needed by an external object file --- e.g. with arclite.
<rdar://problem/
14334895>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185882
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Mon, 8 Jul 2013 21:55:46 +0000 (21:55 +0000)]
DebugInfo: remove unused helper function getDICompositeType.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185876
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 8 Jul 2013 21:47:33 +0000 (21:47 +0000)]
CEHCK->CHECK typo fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185875
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 8 Jul 2013 21:47:31 +0000 (21:47 +0000)]
Fix up whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185874
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Mon, 8 Jul 2013 21:34:52 +0000 (21:34 +0000)]
Stop emitting weak symbols into the "coal" sections.
The Mach-O linker has been able to support the weak-def bit on any symbol for
quite a while now. The compiler however continued to place these symbols into a
"coal" section, which required the linker to map them back to the base section
name.
Replace the sections like this:
__TEXT/__textcoal_nt instead use __TEXT/__text
__TEXT/__const_coal instead use __TEXT/__const
__DATA/__datacoal_nt instead use __DATA/__data
<rdar://problem/
14265330>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185872
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 8 Jul 2013 21:18:54 +0000 (21:18 +0000)]
No ',' between programs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185867
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 8 Jul 2013 21:16:18 +0000 (21:16 +0000)]
Update comment to avoid mentioning DbgValues which is an instance
variable later in the class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185866
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Mon, 8 Jul 2013 20:27:34 +0000 (20:27 +0000)]
Revert r185852.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185861
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 8 Jul 2013 20:24:54 +0000 (20:24 +0000)]
Find xdot or xdot.py.
Ubuntu installs this as xdot, so finding xdot.py would fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185860
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 8 Jul 2013 20:24:49 +0000 (20:24 +0000)]
Allow llvm_find_program to find alternate names
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185859
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Mon, 8 Jul 2013 20:20:51 +0000 (20:20 +0000)]
[PowerPC] Always use "assembler dialect" 1
A setting in MCAsmInfo defines the "assembler dialect" to use. This is used
by common code to choose between alternatives in a multi-alternative GNU
inline asm statement like the following:
__asm__ ("{sfe|subfe} %0,%1,%2" : "=r" (out) : "r" (in1), "r" (in2));
The meaning of these dialects is platform specific, and GCC defines those
for PowerPC to use dialect 0 for old-style (POWER) mnemonics and 1 for
new-style (PowerPC) mnemonics, like in the example above.
To be compatible with inline asm used with GCC, LLVM ought to do the same.
Specifically, this means we should always use assembler dialect 1 since
old-style mnemonics really aren't supported on any current platform.
However, the current LLVM back-end uses:
AssemblerDialect = 1; // New-Style mnemonics.
in PPCMCAsmInfoDarwin, and
AssemblerDialect = 0; // Old-Style mnemonics.
in PPCLinuxMCAsmInfo.
The Linux setting really isn't correct, we should be using new-style
mnemonics everywhere. This is changed by this commit.
Unfortunately, the setting of this variable is overloaded in the back-end
to decide whether or not we are on a Darwin target. This is done in
PPCInstPrinter (the "SyntaxVariant" is initialized from the MCAsmInfo
AssemblerDialect setting), and also in PPCMCExpr. Setting AssemblerDialect
to 1 for both Darwin and Linux no longer allows us to make this distinction.
Instead, this patch uses the MCSubtargetInfo passed to createPPCMCInstPrinter
to distinguish Darwin targets, and ignores the SyntaxVariant parameter.
As to PPCMCExpr, this patch adds an explicit isDarwin argument that needs
to be passed in by the caller when creating a target MCExpr. (To do so
this patch implicitly also reverts commit 184441.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185858
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Mon, 8 Jul 2013 20:00:03 +0000 (20:00 +0000)]
PPC: Mark vector CC action for SETO and SETONE as Expand
Another bug found by llvm-stress! This fixes hitting
llvm_unreachable("Invalid integer vector compare condition");
at the end of getVCmpInst in PPCISelDAGToDAG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185855
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 8 Jul 2013 19:59:35 +0000 (19:59 +0000)]
IR headers moved to llvm/IR some aeons ago, update documentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185854
91177308-0d34-0410-b5e6-
96231b3b80d8
Joey Gouly [Mon, 8 Jul 2013 19:52:51 +0000 (19:52 +0000)]
Add a comment to this change, requested by Eric Christopher.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185853
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Mon, 8 Jul 2013 19:17:48 +0000 (19:17 +0000)]
StringRef: add DenseMapInfo for StringRef.
Remove the implementation in include/llvm/Support/YAMLTraits.h.
Added a DenseMap type DITypeHashMap in DebugInfo.h:
DenseMap<std::pair<StringRef, unsigned>, MDNode*>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185852
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Mon, 8 Jul 2013 19:12:01 +0000 (19:12 +0000)]
[ADT/NullablePtr] Allow implicit conversion of NullablePtr<OtherT> -> NullablePtr<T> if OtherT is derived from T.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185851
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 8 Jul 2013 19:06:25 +0000 (19:06 +0000)]
Reland "Use Clang's __has_* macros in Compiler.h ..." with fixes
This reverts r185841 and relands r185831 without using
__has_attribute(const).
Clang prior to r161767 (between 3.1 and 3.2) does not accept
__has_attribute(const) due to rdar://
10253857. __const and __const__
are both keyword aliases of const, so they don't work either.
I was able to repro the buildbot failure using clang 3.1 and this patch
fixes it. Various important versions of XCode use clang 2.9-ish, so
this workaround is necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185850
91177308-0d34-0410-b5e6-
96231b3b80d8
Stephen Lin [Mon, 8 Jul 2013 18:34:39 +0000 (18:34 +0000)]
Update docs to say that a FunctionPass should not inspect other functions than the one being processed.
Please let me know if you disagree with this assessment (no one has yet, after asking on llvm-commits and LLVMDev) and I will revert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185848
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Mon, 8 Jul 2013 18:33:29 +0000 (18:33 +0000)]
Debug Info: clean up usage of Verify.
No functionality change. It should suffice to check the type of a debug info
metadata, instead of calling Verify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185847
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Mon, 8 Jul 2013 18:18:52 +0000 (18:18 +0000)]
ARM: Improve codegen for generic vselect.
Fall back to by-element insert rather than building it up on the stack.
rdar://
14351991
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185846
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 8 Jul 2013 17:51:28 +0000 (17:51 +0000)]
DebugInfo: Correct comment & re-format a nearby loop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185844
91177308-0d34-0410-b5e6-
96231b3b80d8
Shuxin Yang [Mon, 8 Jul 2013 17:33:13 +0000 (17:33 +0000)]
Fix a SCEV update problem.
The symptom is seg-fault, and the root cause is that a SCEV contains a SCEVUnknown
which has null-pointer to a llvm::Value.
This is how the problem take place:
===================================
1). In the pristine input IR, there are two relevant instrutions Op1 and Op2,
Op1's corresponding SCEV (denoted as SCEV(op1)) is a SCEVUnknown, and
SCEV(Op2) contains SCEV(Op1). None of these instructions are dead.
Op1 : V1 = ...
...
Op2 : V2 = ... // directly or indirectly (data-flow) depends on Op1
2) Optimizer (LSR in my case) generates an instruction holding the equivalent
value of Op1, making Op1 dead.
Op1': V1' = ...
Op1: V1 = ... ; now dead)
Op2 : V2 = ... //Now deps on Op1', but the SCEV(Op2) still contains SCEV(Op1)
3) Op1 is deleted, and call-back function is called to reset
SCEV(Op1) to indicate it is invalid. However, SCEV(Op2) is not
invalidated as well.
4) Following pass get the cached, invalid SCEV(Op2), and try to manipulate it,
and cause segfault.
The fix:
========
It seems there is no clean yet inexpensive fix. I write to dev-list
soliciting good solution, unforunately no ack. So, I decide to fix this
problem in a brute-force way:
When ScalarEvolution::getSCEV is called, check if the cached SCEV
contains a invalid SCEVUnknow, if yes, remove the cached SCEV, and
re-evaluate the SCEV from scratch.
I compile buch of big *.c and *.cpp, fortunately, I don't see any increase
in compile time.
Misc:
=====
The reduced test-case has 2357 lines of code+other-stuff, too big to commit.
rdar://
14283433
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185843
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 8 Jul 2013 17:33:10 +0000 (17:33 +0000)]
DebugInfo: Simplify Address Pool index handling.
Since the pool indexes are necessarily sequential and contiguous, just
insert things in the right place rather than having to sort the sequence
after the fact.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185842
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Mon, 8 Jul 2013 17:32:13 +0000 (17:32 +0000)]
Revert: "Use Clang's __has_* macros in Compiler.h to test for features"
This reverts r185831 and 185833.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185841
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Mon, 8 Jul 2013 17:30:25 +0000 (17:30 +0000)]
PPC: Mark vector FREM as Expand by default
Another bug found by llvm-stress! This fixes crashing with:
LLVM ERROR: Cannot select: v4f32 = frem ...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185840
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 8 Jul 2013 16:55:56 +0000 (16:55 +0000)]
clang-format this enum.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185835
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 8 Jul 2013 16:42:01 +0000 (16:42 +0000)]
We now always create files with the correct permissions. Simplify the interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185834
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 8 Jul 2013 16:36:29 +0000 (16:36 +0000)]
Attempt to fix Compiler.h for some self-hosting bots
I tested r185831 by self-hosting clang with a recent clang, and got no
warnings. I haven't been able to reproduce the problem locally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185833
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 8 Jul 2013 16:16:51 +0000 (16:16 +0000)]
Create files with the correct permission instead of changing it afterwards.
No intended functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185832
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 8 Jul 2013 15:31:29 +0000 (15:31 +0000)]
Use Clang's __has_* macros in Compiler.h to test for features
When targetting Windows, clang does not define __GNUC__, and as a result
we don't use our attributes with it. This leads to warnings about
unused functions that are already annotated with LLVM_ATTRIBUTE_UNUSED.
Rather than testing for __clang__, we can use its __has_attribute and
__has_builtin macros directlty.
While I'm here, conditionally define and use __GNUC_PREREQ for gcc
version checks. Spelling the check out with three comparisons is
verbose and error prone.
Reviewers: aaron.ballman
Differential Revision: http://llvm-reviews.chandlerc.com/D1080
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185831
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 8 Jul 2013 15:22:09 +0000 (15:22 +0000)]
Create files with the correct permission instead of changing it afterwards.
Not intended functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185830
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Mon, 8 Jul 2013 15:20:38 +0000 (15:20 +0000)]
[PowerPC] Support time base instructions
This adds support for the old-style time base instructions;
while new programs are supposed to use mfspr, the mftb instructions
are still supported and in use by existing assembler files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185829
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Mon, 8 Jul 2013 14:49:37 +0000 (14:49 +0000)]
[PowerPC] Support basic compare mnemonics
This adds support for the basic mnemoics (with the L operand) for the
fixed-point compare instructions. These are defined as aliases for the
already existing CMPW/CMPD patterns, depending on the value of L.
This requires use of InstAlias patterns with immediate literal operands.
To make this work, we need two further changes:
- define a RegisterPrefix, because otherwise literals 0 and 1 would
be parsed as literal register names
- provide a PPCAsmParser::validateTargetOperandClass routine to
recognize immediate literals (like ARM does)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185826
91177308-0d34-0410-b5e6-
96231b3b80d8
Manuel Klimek [Mon, 8 Jul 2013 14:44:57 +0000 (14:44 +0000)]
Fixes problem when calling llvm-ar from an unmodifiable directory.
This fixes a regression introduced by r185726: the new call to get
a unique file does not prepend the system temporary directory, so
we need to anchor on the file that the temporary file gets moved
to to ensure we're on the same file system.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185825
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Mon, 8 Jul 2013 14:40:04 +0000 (14:40 +0000)]
Improve the comment from r185794 (re: PromoteIntRes_BUILD_VECTOR)
In response to Duncan's review, I believe that the original comment was not as
clear as it could be. Hopefully, this is better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185824
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Mon, 8 Jul 2013 14:22:45 +0000 (14:22 +0000)]
[PowerPC] Fix PR16556 (handle undef ppcf128 in LowerFP_TO_INT).
PPCTargetLowering::LowerFP_TO_INT() expects its source operand to be
either an f32 or f64, but this is not checked. A long double
(ppcf128) operand will normally be custom-lowered to a conversion to
f64 in this context. However, this isn't the case for an UNDEF node.
This patch recognizes a ppcf128 as a legal source operand for
FP_TO_INT only if it's an undef, in which case it creates an undef of
the target type.
At some point we might want to do a wholesale custom lowering of
ISD::UNDEF when the type is ppcf128, but it's not really clear that's
a great idea, and probably more work than it's worth for a situation
that only arises in the case of a programming error. At this point I
think simple is best.
The test case comes from PR16556, and is a crash-test only.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185821
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 8 Jul 2013 14:14:22 +0000 (14:14 +0000)]
Convert an OCaml binding grep test to FileCheck
I shaved this yak because I mistakenly thought that this was one of the
last grep tests. Turns out my search was skipping .ll files, for which
there are ~1200 more tests using grep.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185819
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 8 Jul 2013 11:53:08 +0000 (11:53 +0000)]
InstCombine: Fold X-C1 <u 2 -> (X & -2) == C1
Back in r179493 we determined that two transforms collided with each
other. The fix back then was to reorder the transforms so that the
preferred transform would give it a try and then we would try the
secondary transform. However, it was noted that the best approach would
canonicalize one transform into the other, removing the collision and
allowing us to optimize IR given to us in that form.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185808
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Rieck [Mon, 8 Jul 2013 11:20:11 +0000 (11:20 +0000)]
Reuse %rax after calling __chkstk on win64
Reapply this as I reverted the wrong commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185807
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Rieck [Mon, 8 Jul 2013 11:19:44 +0000 (11:19 +0000)]
Revert "Proper va_arg/va_copy lowering on win64"
This reverts commit
2b52880592a525cfe04d8f9008a35da8c2ea94c3.
Needs review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185806
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Mon, 8 Jul 2013 09:55:36 +0000 (09:55 +0000)]
[SystemZ] Remove unwanted part from last commit
I was originally going to use MVC for memmove too, but that's less of
a clear win. Remove some accidental left-overs in the previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185804
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Mon, 8 Jul 2013 09:35:23 +0000 (09:35 +0000)]
[SystemZ] Use MVC for memcpy
Use MVC for memcpy in cases where a single MVC is enough. Using MVC is
a win for longer copies too, but I'll leave that for later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185802
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 8 Jul 2013 08:44:36 +0000 (08:44 +0000)]
llvm/test/CMakeLists.txt: Add llvm-cov in "check-clang".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185801
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 8 Jul 2013 08:44:30 +0000 (08:44 +0000)]
llvm/test/CMakeLists.txt: Reformat LLVM_TEST_DEPENDS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185800
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 8 Jul 2013 08:44:24 +0000 (08:44 +0000)]
llvm/test/Other/llvm-cov.test: It requires +Asserts to let XFAILed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185799
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Mon, 8 Jul 2013 06:16:58 +0000 (06:16 +0000)]
Fix PromoteIntRes_BUILD_VECTOR crash with i1 vectors
This fixes a bug (found by llvm-stress) in
DAGTypeLegalizer::PromoteIntRes_BUILD_VECTOR where it assumed that the result
type would always be larger than the original operands. This is not always
true, however, with boolean vectors. For example, promoting a node of type v8i1
(where the operands will be of type i32, the type to which i1 is promoted) will
yield a node with a result vector element type of i16 (and operands of type
i32). As a result, we cannot blindly assume that we can ANY_EXTEND the operands
to the result type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185794
91177308-0d34-0410-b5e6-
96231b3b80d8
Kai Nacke [Mon, 8 Jul 2013 04:48:34 +0000 (04:48 +0000)]
Revert: Fix wrong code offset for unwind code SET_FPREG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185793
91177308-0d34-0410-b5e6-
96231b3b80d8
Kai Nacke [Mon, 8 Jul 2013 04:46:55 +0000 (04:46 +0000)]
Revert: Generate IMAGE_REL_AMD64_ADDR32NB relocations for SEH data structures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185791
91177308-0d34-0410-b5e6-
96231b3b80d8
Kai Nacke [Mon, 8 Jul 2013 04:45:05 +0000 (04:45 +0000)]
Revert: Fix alignment of unwind data.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185790
91177308-0d34-0410-b5e6-
96231b3b80d8
Kai Nacke [Mon, 8 Jul 2013 04:43:23 +0000 (04:43 +0000)]
Revert: Emit personality function and Dwarf EH data for Win64 SEH.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185788
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Mon, 8 Jul 2013 03:24:07 +0000 (03:24 +0000)]
Add the nearbyint -> FNEARBYINT mapping to BasicTargetTransformInfo
This fixes an oversight that Intrinsic::nearbyint was not being mapped to
ISD::FNEARBYINT (thus fixing the over-optimistic cost we were assigning to
nearbyint calls for some targets).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185783
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Mon, 8 Jul 2013 02:13:47 +0000 (02:13 +0000)]
[objc-arc] Committed test for r185770 as per dblaikie's suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185782
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Rieck [Mon, 8 Jul 2013 01:30:57 +0000 (01:30 +0000)]
Revert "Reuse %rax after calling __chkstk on win64"
This reverts commit
01f8d579f7672872324208ac5bc4ac311e81b22e.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185781
91177308-0d34-0410-b5e6-
96231b3b80d8
Stephen Lin [Mon, 8 Jul 2013 00:37:03 +0000 (00:37 +0000)]
Remove trailing whitespace from SelectionDAG/*.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185780
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Rieck [Sun, 7 Jul 2013 16:48:39 +0000 (16:48 +0000)]
Reuse %rax after calling __chkstk on win64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185778
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Sun, 7 Jul 2013 14:57:18 +0000 (14:57 +0000)]
Clear the builder insert point between tree-vectorization phases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185777
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Sun, 7 Jul 2013 10:15:16 +0000 (10:15 +0000)]
Eliminate trivial redundant loads across nocapture+readonly calls to uncaptured
pointer arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185776
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Sun, 7 Jul 2013 08:29:51 +0000 (08:29 +0000)]
Add missing per-argument doesNotAccessMemory accessors. No functionality change
since it has no callers today.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185775
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Sun, 7 Jul 2013 06:57:07 +0000 (06:57 +0000)]
SLPVectorizer: Implement DCE as part of vectorization.
This is a complete re-write if the bottom-up vectorization class.
Before this commit we scanned the instruction tree 3 times. First in search of merge points for the trees. Second, for estimating the cost. And finally for vectorization.
There was a lot of code duplication and adding the DCE exposed bugs. The new design is simpler and DCE was a part of the design.
In this implementation we build the tree once. After that we estimate the cost by scanning the different entries in the constructed tree (in any order). The vectorization phase also works on the built tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185774
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Sun, 7 Jul 2013 04:18:03 +0000 (04:18 +0000)]
[objc-arc] Remove the alias analysis part of r185764.
Upon further reflection, the alias analysis part of r185764 is not a safe
change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185770
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Sun, 7 Jul 2013 01:52:55 +0000 (01:52 +0000)]
[objc-arc] Teach the ARC optimizer that objc_sync_enter/objc_sync_exit do not modify the ref count of an objc object and additionally are inert for modref purposes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185769
91177308-0d34-0410-b5e6-
96231b3b80d8
Stephen Lin [Sat, 6 Jul 2013 21:44:25 +0000 (21:44 +0000)]
SelectionDAGBuilder: style fixes (add space between end parentheses and open brace)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185768
91177308-0d34-0410-b5e6-
96231b3b80d8
Joey Gouly [Sat, 6 Jul 2013 20:50:18 +0000 (20:50 +0000)]
Add MC support for the v8fp instructions: vmaxnm and vminnm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185767
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 6 Jul 2013 20:01:46 +0000 (20:01 +0000)]
COFFDumper: Print uint64_t with the right format string.
I wish we could typecheck llvm::format.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185766
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Sat, 6 Jul 2013 18:43:05 +0000 (18:43 +0000)]
[objc-arc] When we initialize ARCRuntimeEntryPoints, make sure we reset all references to entrypoint declarations as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185764
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Rieck [Sat, 6 Jul 2013 18:08:19 +0000 (18:08 +0000)]
Proper va_arg/va_copy lowering on win64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185763
91177308-0d34-0410-b5e6-
96231b3b80d8
Kai Nacke [Sat, 6 Jul 2013 17:17:31 +0000 (17:17 +0000)]
Emit personality function and Dwarf EH data for Win64 SEH.
Obviously the personality function should be emitted as language handler
instead of the hard coded _GCC_specific_handler. The language specific
data must be placed after the unwind information therefore it must not
be emitted into a separate section.
Reviewed by Charles Davis and Nico Rieck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185761
91177308-0d34-0410-b5e6-
96231b3b80d8
Kai Nacke [Sat, 6 Jul 2013 17:16:50 +0000 (17:16 +0000)]
Fix alignment of unwind data.
For alignment purposes, the instruction array will always have an even
number of entries, with the final entry potentially unused (in which
case the array will be one longer than indicated by the count of unwind
codes field).
Reviewed by Charles Davis and Nico Rieck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185760
91177308-0d34-0410-b5e6-
96231b3b80d8
Kai Nacke [Sat, 6 Jul 2013 17:16:12 +0000 (17:16 +0000)]
Generate IMAGE_REL_AMD64_ADDR32NB relocations for SEH
data structures.
The Win64 EH data structures must be of type IMAGE_REL_AMD64_ADDR32NB
instead of IMAGE_REL_AMD64_ADDR32. This is easiely achieved by adding
the VK_COFF_IMGREL32 modifier to the symbol reference.
Change also references to start and end of the SEH range of a function
as offsets to start of the function.
Reviewed by Charles Davis and Nico Rieck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185759
91177308-0d34-0410-b5e6-
96231b3b80d8
Kai Nacke [Sat, 6 Jul 2013 17:15:36 +0000 (17:15 +0000)]
Fix wrong code offset for unwind code SET_FPREG.
The code offset for unwind code SET_FPREG is wrong because it is set
to constant 0. The fix is to do the same as for the other unwind
codes: emit a label and later the absolute difference between the
label and the begin of the prologue.
Also enables the failing test case MC/COFF/seh.s
Reviewed by Charles Davis and Nico Rieck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185758
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 6 Jul 2013 15:10:13 +0000 (15:10 +0000)]
Reassociate: Remove unnecessary default operator=.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185757
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 6 Jul 2013 14:05:09 +0000 (14:05 +0000)]
DAGCombiner: Don't drop extension behavior when shrinking a load when unsafe.
ReduceLoadWidth unconditionally drops extensions from loads. Limit it to the
case when all of the bits the extension would otherwise produce are dropped by
the shrink. It would be possible to shrink the load in more cases by merging
the extensions, but this isn't trivial and a very rare case. I left a TODO for
that case.
Fixes PR16551.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185755
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Sat, 6 Jul 2013 12:58:45 +0000 (12:58 +0000)]
Stop putting operations after a tail call.
This prevents the emission of DAG-generated vreg definitions after a
tail call be dropping them entirely (on the grounds that nothing could
use them anyway, and they interfere with O0 CodeGen).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185754
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Rieck [Sat, 6 Jul 2013 12:13:10 +0000 (12:13 +0000)]
MC: Implement COFF .linkonce directive
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185753
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Sat, 6 Jul 2013 02:39:51 +0000 (02:39 +0000)]
[llvm-ar] Added llvm_unreachable to quiet -Wreturn-type warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185751
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sat, 6 Jul 2013 02:24:59 +0000 (02:24 +0000)]
isKnownToBeAPowerOfTwo: Fix a typo in a comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185748
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Sat, 6 Jul 2013 02:18:56 +0000 (02:18 +0000)]
[objc-arc] Performed some small cleanups in ARCRuntimeEntryPoints and added an llvm_unreachable after the switch to quiet -Wreturn_type errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185746
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Sat, 6 Jul 2013 01:57:32 +0000 (01:57 +0000)]
[objc-arc] Renamed Module => TheModule in ARCRuntimeEntryPoints. Also did some small cleanups.
This fixes an issue that came up due to -fpermissive on the bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185744
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Sat, 6 Jul 2013 01:41:35 +0000 (01:41 +0000)]
Removed trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185743
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Sat, 6 Jul 2013 01:39:26 +0000 (01:39 +0000)]
[objc-arc] Updated ObjCARCContract to use ARCRuntimeEntryPoints.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185742
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Sat, 6 Jul 2013 01:39:23 +0000 (01:39 +0000)]
[objc-arc] Updated ObjCARCOpts to use ARCRuntimeEntryPoints.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185741
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Sat, 6 Jul 2013 01:39:18 +0000 (01:39 +0000)]
[objc-arc] Refactor runtime entrypoint declaration entrypoint creation.
This is the first patch in a series of 3 patches which clean up how we create
runtime function declarations in the ARC optimizer when they do not exist
already in the IR.
Currently we have a bunch of duplicated code in ObjCARCOpts, ObjCARCContract
that does this. This patch refactors that code into a separate class called
ARCRuntimeEntryPoints which lazily creates the declarations for said
entrypoints.
The next two patches will consist of the work of refactoring
ObjCARCContract/ObjCARCOpts to use this new code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185740
91177308-0d34-0410-b5e6-
96231b3b80d8