Richard Trieu [Fri, 12 Oct 2012 17:57:35 +0000 (17:57 +0000)]
Change (!list.size() == 0) to (!list.empty()). No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165812
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Fri, 12 Oct 2012 17:39:25 +0000 (17:39 +0000)]
Set default CPU for Darwin targets with LTO. <rdar://problem/
12457841>
This is a temporary hack until Bill's project to record command line options
in the LLVM IR is ready. Clang currently sets a default CPU but that isn't
recorded anywhere and it doesn't get used in the final LTO compilation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165809
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 12 Oct 2012 16:01:08 +0000 (16:01 +0000)]
llvm/test/CodeGen/PowerPC/2012-10-12-bitcast.ll: Try to fix failure on non-ppc hosts, to add -mattr=+altivec.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165803
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Fri, 12 Oct 2012 15:42:58 +0000 (15:42 +0000)]
Fix big-endian codegen bug in DAGTypeLegalizer::ExpandRes_BITCAST
On PowerPC, a bitcast of <16 x i8> to i128 may run through a code
path in ExpandRes_BITCAST that attempts to do an intermediate
bitcast to a <4 x i32> vector, and then construct the Hi and Lo parts
of the resulting i128 by pairing up two of those i32 vector elements
each. The code already recognizes that on a big-endian system, the
first two vector elements form the Hi part, and the final two vector
elements form the Lo part (vice-versa from the little-endian situation).
However, we also need to take endianness into account when forming each
of those separate pairs: on a big-endian system, vector element 0 is
the *high* part of the pair making up the Hi part of the result, and
vector element 1 is the low part of the pair. The code currently always
uses vector element 0 as the low part and vector element 1 as the high
part, as is appropriate for little-endian platforms only.
This patch fixes this by swapping the vector elements as they are
paired up as appropriate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165802
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 12 Oct 2012 14:11:48 +0000 (14:11 +0000)]
ExceptionDemo.cpp: Use Function::setDoesNotReturn(). Attributes stuff was updated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165796
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 12 Oct 2012 14:11:43 +0000 (14:11 +0000)]
ExceptionDemo.cpp: Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165795
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Fri, 12 Oct 2012 11:08:57 +0000 (11:08 +0000)]
Add powerpc-ibm-aix to Triple. Patch by Kai.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165792
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 12 Oct 2012 09:55:13 +0000 (09:55 +0000)]
Add float-abi and softfloat options to lli
Patch by Amara Emerson.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165791
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 12 Oct 2012 08:09:29 +0000 (08:09 +0000)]
JITTest.cpp: Use LLVM_ATTRIBUTE_USED, rather than __attribute__ directly!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165790
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Fri, 12 Oct 2012 04:28:25 +0000 (04:28 +0000)]
Shuffle the virtual destructor down to the base. This should actually pacify
-Wnon-virtual-dtor for real.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165787
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Fri, 12 Oct 2012 04:13:25 +0000 (04:13 +0000)]
Give this class full of virtual functions a virtual destructor. Classes love
virtual destructors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165786
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 12 Oct 2012 02:04:47 +0000 (02:04 +0000)]
Indenting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165785
91177308-0d34-0410-b5e6-
96231b3b80d8
Sebastian Pop [Fri, 12 Oct 2012 02:04:32 +0000 (02:04 +0000)]
fix warning
DependenceAnalysis.cpp:1164:32: warning: implicit truncation from 'int' to bitfield changes value from -5 to 3
[-Wconstant-conversion]
Result.DV[Level].Direction &= ~Dependence::DVEntry::GT;
^ ~~~~~~~~~~~~~~~~~~~~~~~~
Patch from Preston Briggs <preston.briggs@gmail.com>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165784
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Fri, 12 Oct 2012 02:01:09 +0000 (02:01 +0000)]
Div, Rem int/unsigned int
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165783
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Fri, 12 Oct 2012 01:55:51 +0000 (01:55 +0000)]
docs: Update example to conform to coding standards.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165782
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Fri, 12 Oct 2012 01:44:08 +0000 (01:44 +0000)]
Mark function as 'used' so that LTO doesn't try to get rid of it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165781
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 12 Oct 2012 01:34:07 +0000 (01:34 +0000)]
Revert r165777, "Mark function as 'used' so that LTO doesn't try to get rid of it."
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165780
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Fri, 12 Oct 2012 01:21:24 +0000 (01:21 +0000)]
docs: Minor clean up of Phabricator documentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165779
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Fri, 12 Oct 2012 01:15:47 +0000 (01:15 +0000)]
Legalizer optimize a pair of div / mod to a call to divrem libcall if they are
not legal. However, it should use a div instruction + mul + sub if divide is
legal. The rem legalization code was missing a check and incorrectly uses a
divrem libcall even when div is legal.
rdar://
12481395
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165778
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Fri, 12 Oct 2012 01:15:17 +0000 (01:15 +0000)]
Mark function as 'used' so that LTO doesn't try to get rid of it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165777
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Fri, 12 Oct 2012 01:06:33 +0000 (01:06 +0000)]
We need this symbol after an LTO build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165776
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Fri, 12 Oct 2012 00:53:48 +0000 (00:53 +0000)]
docs: Add SphinxQuickstartTemplate.rst.
The intent of this document is to be the go-to document for anybody who
wants to write new documentation, but isn't familiar with Sphinx.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165775
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Thu, 11 Oct 2012 23:30:52 +0000 (23:30 +0000)]
docs: Improve HowToSetUpLLVMStyleRTTI.
* Fix confusing explanation regarding abstract classes.
* Clarify auto-upcasting and why `Shape` doesn't need a `classof()`.
* Add section `Rules of Thumb` with some quick summary tips.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165768
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Thu, 11 Oct 2012 23:30:49 +0000 (23:30 +0000)]
Remove unnecessary classof()'s
isa<> et al. automatically infer when the cast is an upcast (including a
self-cast), so these are no longer necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165767
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Thu, 11 Oct 2012 23:30:41 +0000 (23:30 +0000)]
docs: Update HowToSetUpLLVMStyleRTTI.
Recent changes to isa<>/dyn_cast<> have made unnecessary those classof()
of the form:
static bool classof(const Foo *) { return true; }
Accordingly, remove mention of such classof() from the documentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165766
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Thu, 11 Oct 2012 23:30:40 +0000 (23:30 +0000)]
Casting.h: Automatically handle isa<Base>(Derived).
Additionally, all such cases are handled with no dynamic check.
All `classof()` of the form
class Foo {
[...]
static bool classof(const Bar *) { return true; }
[...]
}
where Foo is an ancestor of Bar are no longer necessary.
Don't write them!
Note: The exact test is `is_base_of<Foo, Bar>`, which is non-strict, so
that Foo is considered an ancestor of itself.
This leads to the following rule of thumb for LLVM-style RTTI:
The argument type of `classof()` should be a strict ancestor.
For more information about implementing LLVM-style RTTI, see
docs/HowToSetUpLLVMStyleRTTI.rst
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165765
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Thu, 11 Oct 2012 23:30:38 +0000 (23:30 +0000)]
Remove buggy classof().
This classof() is effectively saying that a MachineCodeEmitter "is-a"
JITEmitter, but JITEmitter is in fact a descendant of
MachineCodeEmitter, so this is not semantically correct. Consequently,
none of the assertions that rely on these classof() actualy check
anything.
Remove the RTTI (which didn't actually check anything) and use
static_cast<> instead.
Post-Mortem Bug Analysis
========================
Cause of the bug
----------------
r55022 appears to be the source of the classof() and assertions removed
by this commit. It aimed at removing some dynamic_cast<> that were
solely in the assertions. A typical diff hunk from that commit looked
like:
- assert(dynamic_cast<JITEmitter*>(MCE) && "Unexpected MCE?");
- JITEmitter *JE = static_cast<JITEmitter*>(getCodeEmitter());
+ assert(isa<JITEmitter>(MCE) && "Unexpected MCE?");
+ JITEmitter *JE = cast<JITEmitter>(getCodeEmitter());
Hence, the source of the bug then seems to be an attempt to replace
dynamic_cast<> with LLVM-style RTTI without properly setting up the
class hierarchy for LLVM-style RTTI. The bug therefore appears to be
simply a "thinko".
What initially indicated the presence of the bug
------------------------------------------------
After implementing automatic upcasting for isa<>, classof() functions of
the form
static bool classof(const Foo *) { return true; }
were removed, since they only serve the purpose of optimizing
statically-OK upcasts. A subsequent recompilation triggered a build
failure on the isa<> tests within the removed asserts, since the
automatic upcasting (correctly) failed to substitute this classof().
Key to pinning down the root cause of the bug
---------------------------------------------
After being alerted to the presence of the bug, some thought about the
semantics which were being asserted by the buggy classof() revealed that
it was incorrect.
How the bug could have been prevented
-------------------------------------
This bug could have been prevented by better documentation for how to
set up LLVM-style RTTI. This should be solved by the recently added
documentation HowToSetUpLLVMStyleRTTI. However, this bug suggests that
the documentation should clearly explain the contract that classof()
must fulfill. The HowToSetUpLLVMStyleRTTI already explains this
contract, but it is a little tucked away. A future patch will expand
that explanation and make it more prominent.
There does not appear to be a simple way to have the compiler prevent
this bug, since fundamentally it boiled down to a spurious classof()
where the programmer made an erroneous statement about the conversion.
This suggests that perhaps the interface to LLVM-style RTTI of classof()
is not the best. There is already some evidence for this, since in a
number of places Clang has classof() forward to classofKind(Kind K)
which evaluates the cast in terms of just the Kind. This could probably
be generalized to simply a `static const Kind MyKind;` field in leaf
classes and `static const Kind firstMyKind, lastMyKind;` for non-leaf
classes, and have the rest of the work be done inside Casting.h,
assuming that the Kind enum is laid out in a preorder traversal of the
inheritance tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165764
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Thu, 11 Oct 2012 22:28:34 +0000 (22:28 +0000)]
PGO: create metadata for switch only if it has more than one targets.
When all cases of a switch statement are dead, the weights vector only has one
element, and we will get an ssertion failure when calling createBranchWeights.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165759
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Thu, 11 Oct 2012 22:26:44 +0000 (22:26 +0000)]
Remove extra semicolon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165758
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Thu, 11 Oct 2012 22:25:56 +0000 (22:25 +0000)]
Remove extra semicolons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165757
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Wen Voung [Thu, 11 Oct 2012 21:45:16 +0000 (21:45 +0000)]
Fix some typos 165739, spotted by Duncan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165753
91177308-0d34-0410-b5e6-
96231b3b80d8
Micah Villmow [Thu, 11 Oct 2012 21:27:41 +0000 (21:27 +0000)]
Revert 165732 for further review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165747
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Wen Voung [Thu, 11 Oct 2012 20:20:40 +0000 (20:20 +0000)]
Change encoding of instruction operands in bitcode binaries to be relative
to the instruction position. The old encoding would give an absolute
ID which counts up within a function, and only resets at the next function.
I.e., Instead of having:
... = icmp eq i32 n-1, n-2
br i1 ..., label %bb1, label %bb2
it will now be roughly:
... = icmp eq i32 1, 2
br i1 1, label %bb1, label %bb2
This makes it so that ids remain relatively small and can be encoded
in fewer bits.
With this encoding, forward reference operands will be given
negative-valued IDs. Use signed VBRs for the most common case
of forward references, which is phi instructions.
To retain backward compatibility we bump the bitcode version
from 0 to 1 to distinguish between the different encodings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165739
91177308-0d34-0410-b5e6-
96231b3b80d8
Manuel Klimek [Thu, 11 Oct 2012 19:40:46 +0000 (19:40 +0000)]
Adds Phabricator documentation. This is a first step that answers many questions we have seen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165736
91177308-0d34-0410-b5e6-
96231b3b80d8
Micah Villmow [Thu, 11 Oct 2012 17:21:41 +0000 (17:21 +0000)]
Add in the first iteration of support for llvm/clang/lldb to allow variable per address space pointer sizes to be optimized correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165726
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 11 Oct 2012 16:46:07 +0000 (16:46 +0000)]
Pass an explicit operand number to addLiveIns.
Not all instructions define a virtual register in their first operand.
Specifically, INLINEASM has a different format.
<rdar://problem/
12472811>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165721
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Thu, 11 Oct 2012 15:38:20 +0000 (15:38 +0000)]
This patch addresses PR13947.
For function calls on the 64-bit PowerPC SVR4 target, each parameter
is mapped to as many doublewords in the parameter save area as
necessary to hold the parameter. The first 13 non-varargs
floating-point values are passed in registers; any additional
floating-point parameters are passed in the parameter save area. A
single-precision floating-point parameter (32 bits) must be mapped to
the second (rightmost, low-order) word of its assigned doubleword
slot.
Currently LLVM violates this ABI requirement by mapping such a
parameter to the first (leftmost, high-order) word of its assigned
doubleword slot. This is internally self-consistent but will not
interoperate correctly with libraries compiled with an ABI-compliant
compiler.
This patch corrects the problem by adjusting the parameter addressing
on both sides of the calling convention.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165714
91177308-0d34-0410-b5e6-
96231b3b80d8
David Chisnall [Thu, 11 Oct 2012 12:42:49 +0000 (12:42 +0000)]
Add test cases for correct parsing of register names in 32- and 64-bit modes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165713
91177308-0d34-0410-b5e6-
96231b3b80d8
David Chisnall [Thu, 11 Oct 2012 10:21:34 +0000 (10:21 +0000)]
Expose move to/from coprocessor instructions in MIPS64 mode.
Note: [D]M{T,F}CP2 is just a recommended encoding. Vendors often provide a
custom CP2 that interprets instructions differently and may wish to add their
own instructions that use this opcode. We should ensure that this is easy to
do. I will probably add a 'has custom CP{0-3}' subtarget flag to make this
easy: We want to avoid the GCC situation where every MIPS vendor makes a custom
fork that breaks every other MIPS CPU and so can't be merged upstream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165711
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 11 Oct 2012 08:26:52 +0000 (08:26 +0000)]
llvm/Analysis/Passes.h: Fix copypasto in createDependenceAnalysisPass().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165709
91177308-0d34-0410-b5e6-
96231b3b80d8
Sebastian Pop [Thu, 11 Oct 2012 07:32:34 +0000 (07:32 +0000)]
dependence analysis
Patch from Preston Briggs <preston.briggs@gmail.com>.
This is an updated version of the dependence-analysis patch, including an MIV
test based on Banerjee's inequalities.
It's a fairly complete implementation of the paper
Practical Dependence Testing
Gina Goff, Ken Kennedy, and Chau-Wen Tseng
PLDI 1991
It cannot yet propagate constraints between coupled RDIV subscripts (discussed
in Section 5.3.2 of the paper).
It's organized as a FunctionPass with a single entry point that supports testing
for dependence between two instructions in a function. If there's no dependence,
it returns null. If there's a dependence, it returns a pointer to a Dependence
which can be queried about details (what kind of dependence, is it loop
independent, direction and distance vector entries, etc). I haven't included
every imaginable feature, but there's a good selection that should be adequate
for supporting many loop transformations. Of course, it can be extended as
necessary.
Included in the patch file are many test cases, commented with C code showing
the loops and array references.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165708
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Liao [Thu, 11 Oct 2012 07:22:01 +0000 (07:22 +0000)]
Follow the same routine to add target float expansion hook
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165707
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 11 Oct 2012 05:37:06 +0000 (05:37 +0000)]
misched: Handle "transient" non-instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165701
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Thu, 11 Oct 2012 02:05:23 +0000 (02:05 +0000)]
Don't crash when !tbaa.struct contents is invalid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165693
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 11 Oct 2012 02:02:05 +0000 (02:02 +0000)]
Revert r165661, "Patch by Shuxin Yang <shuxin.llvm@gmail.com>."
It broke stage2 clang and test-suite/MultiSource/Benchmarks/mediabench/g721/g721encode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165692
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 11 Oct 2012 01:10:37 +0000 (01:10 +0000)]
GettingStarted.rst: s/&/&/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165690
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 11 Oct 2012 01:10:27 +0000 (01:10 +0000)]
GettingStarted.rst: Fix the label to DeveloperPolicy.html.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165689
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 11 Oct 2012 01:10:00 +0000 (01:10 +0000)]
Add the LLVM context to this c'tor. It will be needed in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165687
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 11 Oct 2012 01:05:52 +0000 (01:05 +0000)]
Support a common idiom on how to build an Attributes class with a single attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165686
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Thu, 11 Oct 2012 00:38:25 +0000 (00:38 +0000)]
Don't crash if a .ll file contains a forward-reference that looks like a global
value but later turns out to be a function.
Unfortunately, we can't fold tests into a single file because we only get one
error out of llvm-as.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165680
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Thu, 11 Oct 2012 00:15:48 +0000 (00:15 +0000)]
Change MachineInstrBuilder::addDisp to copy over target flags by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165677
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Wed, 10 Oct 2012 23:06:34 +0000 (23:06 +0000)]
Add isel patterns for v2f32 / v4f32 neon.vbsl intrinsics. rdar://
12471808
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165673
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Wed, 10 Oct 2012 22:45:53 +0000 (22:45 +0000)]
Add getters for the MIPS TargetTransform classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165670
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 10 Oct 2012 22:38:21 +0000 (22:38 +0000)]
Remove unused member variable introduced in r165665.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165669
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 10 Oct 2012 22:37:01 +0000 (22:37 +0000)]
Formatting and 80-col.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165668
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Wed, 10 Oct 2012 22:25:11 +0000 (22:25 +0000)]
Add -mattr=+altivec and remove XFAIL.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165666
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Wed, 10 Oct 2012 22:04:55 +0000 (22:04 +0000)]
Add a new interface to allow IR-level passes to access codegen-specific information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165665
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Wed, 10 Oct 2012 21:52:10 +0000 (21:52 +0000)]
XFAIL for all targets pending investigation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165664
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Wed, 10 Oct 2012 21:31:55 +0000 (21:31 +0000)]
Patch by Shuxin Yang <shuxin.llvm@gmail.com>.
Original message:
The attached is the fix to radar://
11663049. The optimization can be outlined by following rules:
(select (x != c), e, c) -> select (x != c), e, x),
(select (x == c), c, e) -> select (x == c), x, e)
where the <c> is an integer constant.
The reason for this change is that : on x86, conditional-move-from-constant needs two instructions;
however, conditional-move-from-register need only one instruction.
While the LowerSELECT() sounds to be the most convenient place for this optimization, it turns out to be a bad place. The reason is that by replacing the constant <c> with a symbolic value, it obscure some instruction-combining opportunities which would otherwise be very easy to spot. For that reason, I have to postpone the change to last instruction-combining phase.
The change passes the test of "make check-all -C <build-root/test" and "make -C project/test-suite/SingleSource".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165661
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Wed, 10 Oct 2012 21:25:01 +0000 (21:25 +0000)]
When generating spill and reload code for vector registers on PowerPC,
the compiler makes use of GPR0. However, there are two flavors of
GPR0 defined by the target: the 32-bit GPR0 (R0) and the 64-bit GPR0
(X0). The spill/reload code makes use of R0 regardless of whether we
are generating 32- or 64-bit code.
This patch corrects the problem in the obvious manner, using X0 and
ADDI8 for 64-bit and R0 and ADDI for 32-bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165658
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Wed, 10 Oct 2012 20:54:15 +0000 (20:54 +0000)]
The PowerPC VRSAVE register has been somewhat of an odd beast since
the Altivec extensions were introduced. Its use is optional, and
allows the compiler to communicate to the operating system which
vector registers should be saved and restored during a context switch.
In practice, this information is ignored by the various operating
systems using the SVR4 ABI; the kernel saves and restores the entire
register state. Setting the VRSAVE register is no longer performed by
the AIX XL compilers, the IBM i compilers, or by GCC on Power Linux
systems. It seems best to avoid this logic within LLVM as well.
This patch avoids generating code to update and restore VRSAVE for the
PowerPC SVR4 ABIs (32- and 64-bit). The code remains in place for the
Darwin ABI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165656
91177308-0d34-0410-b5e6-
96231b3b80d8
Micah Villmow [Wed, 10 Oct 2012 20:50:51 +0000 (20:50 +0000)]
Add in support for expansion of all of the comparison operations to the absolute minimum required set. This allows a backend to expand any arbitrary set of comparisons as long as a minimum set is supported.
The minimum set of required instructions is ISD::AND, ISD::OR, ISD::SETO(or ISD::SETOEQ) and ISD::SETUO(or ISD::SETUNE). Everything is expanded into one of two patterns:
Pattern 1: (LHS CC1 RHS) Opc (LHS CC2 RHS)
Pattern 2: (LHS CC1 LHS) Opc (RHS CC2 RHS)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165655
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Wed, 10 Oct 2012 20:50:36 +0000 (20:50 +0000)]
Revert r165652: "Remove unnecessary RTTI from the build."
... Apparently the RTTI is still necessary for some reason.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165654
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Wed, 10 Oct 2012 20:27:20 +0000 (20:27 +0000)]
Remove unnecessary RTTI from the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165652
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Wed, 10 Oct 2012 20:27:18 +0000 (20:27 +0000)]
tblgen: Compile TableGen without RTTI.
TableGen no longer needs RTTI!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165651
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Wed, 10 Oct 2012 20:24:49 +0000 (20:24 +0000)]
tblgen: Move mini Type hierarchy to LLVM-style RTTI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165648
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Wed, 10 Oct 2012 20:24:47 +0000 (20:24 +0000)]
tblgen: Use semantically correct RTTI functions.
Also, some minor cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165647
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Wed, 10 Oct 2012 20:24:43 +0000 (20:24 +0000)]
tblgen: Mechanically move dynamic_cast<> to dyn_cast<>.
Some of these dyn_cast<>'s would be better phrased as isa<> or cast<>.
That will happen in a future patch.
There are also two dyn_cast_or_null<>'s slipped in instead of
dyn_cast<>'s, since they were causing crashes with just dyn_cast<>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165646
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Wed, 10 Oct 2012 20:24:40 +0000 (20:24 +0000)]
tblgen: Put dyn_cast<> machinery in place for Init hierarchy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165645
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Wed, 10 Oct 2012 18:41:19 +0000 (18:41 +0000)]
Add the testcase from pr13254 (the old scalarreply pass handles this wrong;
the new sroa pass handles it right).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165644
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 10 Oct 2012 18:20:49 +0000 (18:20 +0000)]
Remove dead variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165639
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Liao [Wed, 10 Oct 2012 18:04:52 +0000 (18:04 +0000)]
Specify CPU model to avoid breaking ATOM builds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165638
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 10 Oct 2012 18:02:57 +0000 (18:02 +0000)]
Remove unused argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165636
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Wed, 10 Oct 2012 17:21:39 +0000 (17:21 +0000)]
docs: Propagate fix from r165632 to other docs.
There are only two other instances of using `.. code::` instead of
`.. code-block::`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165633
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Wed, 10 Oct 2012 17:07:23 +0000 (17:07 +0000)]
docs: Attempt to fix PR14053.
Hypothesis 1: use of `.. code::` directive instead of `.. code-block::`
is causing Sphinx to discard the block. On my machine, `.. code::`
renders fine. However, I don't think that `.. code::` is actually a
legit Sphinx directive. I believe that on my machine Sphinx is falling
back to just displaying it monospace with no syntax, whereas llvm.org's
Sphinx is just discarding it.
This is truly "remote debugging" since I can't reproduce this on my
machine. It would be helpful to be able to see the llvm.org Sphinx
build logs; if that's possible please let me know.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165632
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Liao [Wed, 10 Oct 2012 16:53:28 +0000 (16:53 +0000)]
Add support for FP_ROUND from v2f64 to v2f32
- Due to the current matching vector elements constraints in
ISD::FP_ROUND, rounding from v2f64 to v4f32 (after legalization from
v2f32) is scalarized. Add a customized v2f32 widening to convert it
into a target-specific X86ISD::VFPROUND to work around this
constraints.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165631
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Liao [Wed, 10 Oct 2012 16:32:15 +0000 (16:32 +0000)]
Add alternative support for FP_ROUND from v2f32 to v2f64
- Due to the current matching vector elements constraints in ISD::FP_EXTEND,
rounding from v2f32 to v2f64 is scalarized. Add a customized v2f32 widening
to convert it into a target-specific X86ISD::VFPEXT to work around this
constraints. This patch also reverts a previous attempt to fix this issue by
recovering the scalarized ISD::FP_EXTEND pattern and thus significantly
reduces the overhead of supporting non-power-2 vector FP extend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165625
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 10 Oct 2012 13:33:00 +0000 (13:33 +0000)]
[CMake] check-all: Don't include check-llvm into check-all without LLVM_BUILD_TOOLS.
FIXME: Would you like to run llvm/unittests w/o LLVM_BUILD_TESTS regardless of LLVM_BUILD_TOOLS?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165619
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 10 Oct 2012 13:32:55 +0000 (13:32 +0000)]
[CMake] add_lit_testsuite: EXCLUDE_FROM_ALL excludes the test ${target} out of check-all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165618
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Wed, 10 Oct 2012 11:43:40 +0000 (11:43 +0000)]
Fix for LDRB instruction:
SDNode for LDRB_POST_IMM is invalid: number of registers added to SDNode fewer
that described in .td.
7 ops is needed, but SDNode with only 6 is created.
In more details:
In ARMInstrInfo.td, in multiclass AI2_ldridx, in definition _POST_IMM, offset
operand is defined as am2offset_imm. am2offset_imm is complex parameter type,
and actually it consists from dummy register and imm itself. As I understood
trick with dummy reg was made for AsmParser. In ARMISelLowering.cpp, this dummy
register was not added to SDNode, and it cause crash in Peephole Optimizer pass.
The problem fixed by setting up additional dummy reg when emitting
LDRB_POST_IMM instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165617
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Wed, 10 Oct 2012 11:37:36 +0000 (11:37 +0000)]
Issue description:
SchedulerDAGInstrs::buildSchedGraph ignores dependencies between FixedStack
objects and byval parameters. So loading byval parameters from stack may be
inserted *before* it will be stored, since these operations are treated as
independent.
Fix:
Currently ARMTargetLowering::LowerFormalArguments saves byval registers with
FixedStack MachinePointerInfo. To fix the problem we need to store byval
registers with MachinePointerInfo referenced to first the "byval" parameter.
Also commit adds two new fields to the InputArg structure: Function's argument
index and InputArg's part offset in bytes relative to the start position of
Function's argument. E.g.: If function's argument is 128 bit width and it was
splitted onto 32 bit regs, then we got 4 InputArg structs with same arg index,
but different offset values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165616
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 10 Oct 2012 08:03:34 +0000 (08:03 +0000)]
Cleanup. Get rid of now dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165613
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 10 Oct 2012 07:36:45 +0000 (07:36 +0000)]
Remove the final bits of Attributes being declared in the Attribute
namespace. Use the attribute's enum value instead. No functionality change
intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165610
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Wed, 10 Oct 2012 06:39:48 +0000 (06:39 +0000)]
My earlier "fix" for PBQP (see r165201) was incorrect. The real issue was that
checkRegMaskInterference only initializes the bitmask on the first interference.
This fixes PR14027 and (re)fixes PR13945.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165608
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 10 Oct 2012 06:13:42 +0000 (06:13 +0000)]
Pass into the AttributeWithIndex::get method an ArrayRef of attribute
enums. These are then created via the correct Attributes creation method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165607
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Wed, 10 Oct 2012 05:43:18 +0000 (05:43 +0000)]
misched: fall-back to a target hook for instr bundles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165606
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Wed, 10 Oct 2012 05:43:16 +0000 (05:43 +0000)]
TODO comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165605
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Wed, 10 Oct 2012 05:43:13 +0000 (05:43 +0000)]
TableGen subtarget emitter cleanup.
Consistently evaluate Aliases and Sequences recursively.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165604
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Wed, 10 Oct 2012 05:43:09 +0000 (05:43 +0000)]
misched: Use the TargetSchedModel interface wherever possible.
Allows the new machine model to be used for NumMicroOps and OutputLatency.
Allows the HazardRecognizer to be disabled along with itineraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165603
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Wed, 10 Oct 2012 05:43:04 +0000 (05:43 +0000)]
misched: Generate IsBuffered flag for machine resources.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165602
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Wed, 10 Oct 2012 05:43:01 +0000 (05:43 +0000)]
whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165601
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 10 Oct 2012 05:29:15 +0000 (05:29 +0000)]
Place temporary LTO files into their own subdirectory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165599
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 10 Oct 2012 03:12:49 +0000 (03:12 +0000)]
Have 'addFnAttr' take the attribute enum value. Then have it build the attribute object and add it appropriately. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165595
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 10 Oct 2012 02:54:23 +0000 (02:54 +0000)]
Test case for r165480.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165594
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Wed, 10 Oct 2012 01:58:16 +0000 (01:58 +0000)]
Reorder some parts of the td file to by in alphabetical order
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165590
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Wed, 10 Oct 2012 01:48:52 +0000 (01:48 +0000)]
Adding comments to clarify the reason for non-standard style in these files.
Patch committed on behalf of Kirill Uhanov
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165589
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Wed, 10 Oct 2012 01:45:52 +0000 (01:45 +0000)]
Cosmetic changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165588
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Wed, 10 Oct 2012 01:41:33 +0000 (01:41 +0000)]
This patch adds new functions to the SectionRef and ObjectFile interfaces to determine whether or not a section is meant to be read-only. These functions will be used by the MCJIT RuntimeDyld to give hints to the memory manager during the object loading process in a future patch.
Patch by Ashok Thirumurthi.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165586
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Wed, 10 Oct 2012 01:27:09 +0000 (01:27 +0000)]
Implement MipsTargetLowering::CanLowerReturn.
Patch by Sasa Stankovic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165585
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Tue, 9 Oct 2012 23:59:01 +0000 (23:59 +0000)]
Revert "Use a special path to place the .o files in."
This reverts commit 165428 in an attempt to get our buildbots going.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165574
91177308-0d34-0410-b5e6-
96231b3b80d8