OSDN Git Service
Jim Grosbach [Fri, 24 May 2013 22:53:06 +0000 (22:53 +0000)]
Tidy up. Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182689
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 24 May 2013 22:51:52 +0000 (22:51 +0000)]
Follow up of the introduction of MCSymbolizer.
- Ressurect old MCDisassemble API to soften transition.
- Extend MCTargetDesc to set target specific symbolizer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182688
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Fri, 24 May 2013 22:40:37 +0000 (22:40 +0000)]
clang formatted APFloat.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182686
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Fri, 24 May 2013 22:38:49 +0000 (22:38 +0000)]
clang-formatted APInt.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182685
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 24 May 2013 22:25:20 +0000 (22:25 +0000)]
MathExtras: Return the result of find(First|Last)Set in the input type.
Otherwise ZB_Max returns a wrong result when sizeof(T) > sizeof(size_t).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182684
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Fri, 24 May 2013 22:23:49 +0000 (22:23 +0000)]
Replace Count{Leading,Trailing}Zeros_{32,64} with count{Leading,Trailing}Zeros.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182680
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Fri, 24 May 2013 22:19:05 +0000 (22:19 +0000)]
[Support][MathExtras] Fix literal type issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182679
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Fri, 24 May 2013 20:54:11 +0000 (20:54 +0000)]
Add missing header for atexit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182672
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Fri, 24 May 2013 20:51:59 +0000 (20:51 +0000)]
[Support][MathExtras] Add missing include and disable _BitScan{Forward,Reverse}64 on non x64 MSVC systems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182671
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Fri, 24 May 2013 20:44:05 +0000 (20:44 +0000)]
[objc-arc] KnownSafe does not imply that it is safe to perform code motion across CFG edges since even if it is safe to remove RR pairs, we may still be able to move a retain/release into a loop.
rdar://
13949644
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182670
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Fri, 24 May 2013 20:44:02 +0000 (20:44 +0000)]
[objc-arc] Make sure that multiple owners is propogated correctly through the pass via the usage of a global data structure.
rdar://
13750319
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182669
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Fri, 24 May 2013 20:29:47 +0000 (20:29 +0000)]
[Support] Add type generic bit utilities to MathExtras.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182667
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 24 May 2013 18:05:35 +0000 (18:05 +0000)]
LoopVectorize: LoopSimplify can't canonicalize loops with an indirectbr in it, don't assert on those cases.
Fixes PR16139.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182656
91177308-0d34-0410-b5e6-
96231b3b80d8
Diego Novillo [Fri, 24 May 2013 17:00:22 +0000 (17:00 +0000)]
Do not reserve space for the ColdEdges and NormalEdges vectors.
Discussion and rationale at
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-
20130520/175698.html
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182653
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Fri, 24 May 2013 14:26:46 +0000 (14:26 +0000)]
[SystemZ] Improve AsmParser handling of invalid instructions
Previously, an invalid instruction like:
foo %r1, %r0
would generate the rather odd error message:
....: error: unknown token in expression
foo %r1, %r0
^
We now get the more informative:
....: error: invalid instruction
foo %r1, %r0
^
The same would happen if an address were used where a register was expected.
We now get "invalid operand for instruction" instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182644
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Fri, 24 May 2013 14:14:38 +0000 (14:14 +0000)]
[SystemZ] Improve AsmParser register parsing
The idea is to make sure that:
(1) "register expected" is restricted to cases where ParseRegister()
is called and the token obviously isn't a register.
(2) "invalid register" is restricted to cases where a register-like "%..."
sequence is found, but the "..." makes no sense.
(3) the generic "invalid operand for instruction" is used in cases where
the wrong register type is used (GPR instead of FPR, etc.).
(4) the new "invalid register pair" is used if the register has the right type,
but is not a valid register pair.
Testing of (1)-(3) is now restricted to regs-bad.s. It uses a representative
instruction for each register class to make sure that only registers from
that class are accepted.
(4) is tested by both regs-bad.s (which checks all invalid register pairs)
and insn-bad.s (which tests one invalid pair for each instruction that
requires a pair).
While there, I changed "Number" to "Num" for consistency with the
operand class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182643
91177308-0d34-0410-b5e6-
96231b3b80d8
Joey Gouly [Fri, 24 May 2013 12:33:28 +0000 (12:33 +0000)]
Run clang-format over the scalarizePHI function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182640
91177308-0d34-0410-b5e6-
96231b3b80d8
Joey Gouly [Fri, 24 May 2013 12:29:54 +0000 (12:29 +0000)]
scalarizePHI needs to insert the next ExtractElement in the same block
as the BinaryOperator, *not* in the block where the IRBuilder is currently
inserting into. Fixes a bug where scalarizePHI would create instructions
that would not dominate all uses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182639
91177308-0d34-0410-b5e6-
96231b3b80d8
Diego Novillo [Fri, 24 May 2013 12:26:52 +0000 (12:26 +0000)]
Add a new function attribute 'cold' to functions.
Other than recognizing the attribute, the patch does little else.
It changes the branch probability analyzer so that edges into
blocks postdominated by a cold function are given low weight.
Added analysis and code generation tests. Added documentation for the
new attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182638
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 24 May 2013 10:54:58 +0000 (10:54 +0000)]
Remove the Copied parameter from MemoryObject::readBytes.
There was exactly one caller using this API right, the others were relying on
specific behavior of the default implementation. Since it's too hard to use it
right just remove it and standardize on the default behavior.
Defines away PR16132.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182636
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Fri, 24 May 2013 06:26:18 +0000 (06:26 +0000)]
Fix unused warning in opt builds.
In these builds, the asserts() are completely compiled out of the code
leaving "End" unused. Directly accessing it, should not have a
performance impact, as it is just a data member.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182634
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Fri, 24 May 2013 01:07:04 +0000 (01:07 +0000)]
MC: Disassembled CFG reconstruction.
This patch builds on some existing code to do CFG reconstruction from
a disassembled binary:
- MCModule represents the binary, and has a list of MCAtoms.
- MCAtom represents either disassembled instructions (MCTextAtom), or
contiguous data (MCDataAtom), and covers a specific range of addresses.
- MCBasicBlock and MCFunction form the reconstructed CFG. An MCBB is
backed by an MCTextAtom, and has the usual successors/predecessors.
- MCObjectDisassembler creates a module from an ObjectFile using a
disassembler. It first builds an atom for each section. It can also
construct the CFG, and this splits the text atoms into basic blocks.
MCModule and MCAtom were only sketched out; MCFunction and MCBB were
implemented under the experimental "-cfg" llvm-objdump -macho option.
This cleans them up for further use; llvm-objdump -d -cfg now generates
graphviz files for each function found in the binary.
In the future, MCObjectDisassembler may be the right place to do
"intelligent" disassembly: for example, handling constant islands is just
a matter of splitting the atom, using information that may be available
in the ObjectFile. Also, better initial atom formation than just using
sections is possible using symbols (and things like Mach-O's
function_starts load command).
This brings two minor regressions in llvm-objdump -macho -cfg:
- The printing of a relocation's referenced symbol.
- An annotation on loop BBs, i.e., which are their own successor.
Relocation printing is replaced by the MCSymbolizer; the basic CFG
annotation will be superseded by more related functionality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182628
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Fri, 24 May 2013 00:39:57 +0000 (00:39 +0000)]
Add MCSymbolizer for symbolic/annotated disassembly.
This is a basic first step towards symbolization of disassembled
instructions. This used to be done using externally provided (C API)
callbacks. This patch introduces:
- the MCSymbolizer class, that mimics the same functions that were used
in the X86 and ARM disassemblers to symbolize immediate operands and
to annotate loads based off PC (for things like c string literals).
- the MCExternalSymbolizer class, which implements the old C API.
- the MCRelocationInfo class, which provides a way for targets to
translate relocations (either object::RelocationRef, or disassembler
C API VariantKinds) to MCExprs.
- the MCObjectSymbolizer class, which does symbolization using what it
finds in an object::ObjectFile. This makes simple symbolization (with
no fancy relocation stuff) work for all object formats!
- x86-64 Mach-O and ELF MCRelocationInfos.
- A basic ARM Mach-O MCRelocationInfo, that provides just enough to
support the C API VariantKinds.
Most of what works in otool (the only user of the old symbolization API
that I know of) for x86-64 symbolic disassembly (-tvV) works, namely:
- symbol references: call _foo; jmp 15 <_foo+50>
- relocations: call _foo-_bar; call _foo-4
- __cf?string: leaq 193(%rip), %rax ## literal pool for "hello"
Stub support is the main missing part (because libObject doesn't know,
among other things, about mach-o indirect symbols).
As for the MCSymbolizer API, instead of relying on the disassemblers
to call the tryAdding* methods, maybe this could be done automagically
using InstrInfo? For instance, even though PC-relative LEAs are used
to get the address of string literals in a typical Mach-O file, a MOV
would be used in an ELF file. And right now, the explicit symbolization
only recognizes PC-relative LEAs. InstrInfo should have already have
most of what is needed to know what to symbolize, so this can
definitely be improved.
I'd also like to remove object::RelocationRef::getValueString (it seems
only used by relocation printing in objdump), as simply printing the
created MCExpr is definitely enough (and cleaner than string concats).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182625
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Thu, 23 May 2013 22:48:06 +0000 (22:48 +0000)]
[PowerPC] Remove symbolLo/symbolHi instruction operand types
Now that there is no longer any distinction between symbolLo
and symbolHi operands in either printing, encoding, or parsing,
the operand types can be removed in favor of simply using
s16imm.
This completes the patch series to decouple lo/hi operand part
processing from the particular instruction whose operand it is.
No change in code generation expected from this patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182618
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Malea [Thu, 23 May 2013 22:34:33 +0000 (22:34 +0000)]
Re-implement DebugIR in a way that does not subclass AssemblyWriter:
- move AsmWriter.h from public headers into lib
- marked all AssemblyWriter functions as non-virtual; no need to override them
- DebugIR now "plugs into" AssemblyWriter with an AssemblyAnnotationWriter helper
- exposed flags to control hiding of a) debug metadata b) debug intrinsic calls
C/R: Paul Redmond
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182617
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Thu, 23 May 2013 22:26:41 +0000 (22:26 +0000)]
[PowerPC] Clean up generation of ha16() / lo16() markers
When targeting the Darwin assembler, we need to generate markers ha16() and
lo16() to designate the high and low parts of a (symbolic) immediate. This
is necessary not just for plain symbols, but also for certain symbolic
expression, typically along the lines of ha16(A - B). The latter doesn't
work when simply using VariantKind flags on the symbol reference.
This is why the current back-end uses hacks (explicitly called out as such
via multiple FIXMEs) in the symbolLo/symbolHi print methods.
This patch uses target-defined MCExpr codes to represent the Darwin
ha16/lo16 constructs, following along the lines of the equivalent solution
used by the ARM back end to handle their :upper16: / :lower16: markers.
This allows us to get rid of special handling both in the symbolLo/symbolHi
print method and in the common code MCExpr::print routine. Instead, the
ha16 / lo16 markers are printed simply in a custom print routine for the
target MCExpr types. (As a result, the symbolLo/symbolHi print methods
can now replaced by a single printS16ImmOperand routine that also handles
symbolic operands.)
The patch also provides a EvaluateAsRelocatableImpl routine to handle
ha16/lo16 constructs. This is not actually used at the moment by any
in-tree code, but is provided as it makes merging into David Fang's
out-of-tree Mach-O object writer simpler.
Since there is no longer any need to treat VK_PPC_GAS_HA16 and
VK_PPC_DARWIN_HA16 differently, they are merged into a single
VK_PPC_ADDR16_HA (and likewise for the _LO16 types).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182616
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 23 May 2013 21:21:50 +0000 (21:21 +0000)]
The command line options need to be processed before we create the TargetMachine.
Move the processing of the command line options to right before we create the
TargetMachine instead of after.
<rdar://problem/
13468287>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182611
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Thu, 23 May 2013 19:11:20 +0000 (19:11 +0000)]
ARM: implement @llvm.readcyclecounter intrinsic
This implements the @llvm.readcyclecounter intrinsic as the specific
MRC instruction specified in the ARM manuals for CPUs with the Power
Management extensions.
Older CPUs had slightly different methods which may also have to be
implemented eventually, but this should cover all v7 cases.
rdar://problem/
13939186
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182603
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Thu, 23 May 2013 19:11:14 +0000 (19:11 +0000)]
ARM: Add Performance Monitor Extensions feature
Performance monitors, including a basic cycle counter, are an official
extension in the ARMv7 specification. This adds support for enabling and
disabling them, orthogonally from CPU selection.
rdar://problem/
13939186
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182602
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Thu, 23 May 2013 18:26:42 +0000 (18:26 +0000)]
R600: Fix R600ControlFlowFinalizer not considering VTX_READ 128 bit dst reg
Patch by: Vincent Lejeune
https://bugs.freedesktop.org/show_bug.cgi?id=64877
NOTE: This is a candidate for the 3.3 branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182600
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 23 May 2013 17:10:37 +0000 (17:10 +0000)]
Move passes from namespace llvm into anonymous namespaces. Sort includes while there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182594
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 23 May 2013 17:02:23 +0000 (17:02 +0000)]
Fix PR16110: Handle DBG_VALUE in ConnectedVNInfoEqClasses::Distribute().
Now that the LiveDebugVariables pass is running *after* register
coalescing, the ConnectedVNInfoEqClasses class needs to deal with
DBG_VALUE instructions.
This only comes up when rematerialization during coalescing causes the
remaining live range of a virtual register to separate into two
connected components.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182592
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 23 May 2013 16:09:15 +0000 (16:09 +0000)]
More symbols that should be static.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182590
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 23 May 2013 15:43:11 +0000 (15:43 +0000)]
Hexagon: Make helper functions static.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182588
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 23 May 2013 15:43:05 +0000 (15:43 +0000)]
R600: Hide symbols of implementation details.
Also removes an unused function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182587
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 23 May 2013 15:42:57 +0000 (15:42 +0000)]
InlineSpiller: Store bucket pointers instead of iterators.
Lets us use a SetVector instead of an explicit set + vector combination.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182586
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Thu, 23 May 2013 14:55:00 +0000 (14:55 +0000)]
Setting the default value (fixes CRT assertions about uninitialized variable use when doing debug MSVC builds), and fixing coding style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182585
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 23 May 2013 13:22:30 +0000 (13:22 +0000)]
Fix 32 bit build in c++11 mode.
The error was:
error: non-constant-expression cannot be narrowed from type 'long long' to 'long' in initializer list [-Wc++11-narrowing]
MI.getOperand(6).getImm() & 0x1F,
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182584
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Thu, 23 May 2013 07:46:13 +0000 (07:46 +0000)]
Add missing test from r175092.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182564
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 23 May 2013 03:31:47 +0000 (03:31 +0000)]
Fix a leak on the r600 backend.
This should bring the valgrind bot back to life.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182561
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 23 May 2013 03:28:39 +0000 (03:28 +0000)]
clang-format this file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182560
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 23 May 2013 02:53:22 +0000 (02:53 +0000)]
Remove redundant rpath.
These are not needed since we added the $ORIGIN based rpath.
Fixes pr12517.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182559
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 23 May 2013 02:38:50 +0000 (02:38 +0000)]
Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182558
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Thu, 23 May 2013 02:35:21 +0000 (02:35 +0000)]
[objc-arc] Fixed number of prefixing slashes in some comments in a function from 3 to 2 to match the rest of ObjCARCOpts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182557
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Thu, 23 May 2013 02:03:05 +0000 (02:03 +0000)]
Fixed trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182556
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Thu, 23 May 2013 02:00:03 +0000 (02:00 +0000)]
Updated the comments of APInt.h to match the llvm style guide and be consistent. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182555
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Thu, 23 May 2013 00:32:34 +0000 (00:32 +0000)]
Missed removing one of the assert()'s from the LLVMCreateDisasmCPU() library
API with my 176880 revision. If a bad Triple is passed in it can also assert.
In this case too it should just return 0 to indicate failure to create the
disassembler.
rdar://
13955214
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182542
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 22 May 2013 23:25:59 +0000 (23:25 +0000)]
Minor fix to comment from my previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182536
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 22 May 2013 23:23:14 +0000 (23:23 +0000)]
Simplify the logic described in the comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182534
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 22 May 2013 23:22:18 +0000 (23:22 +0000)]
Solidify the assumption that a DW_TAG_subprogram's type is a DW_TAG_subroutine_type
There were bits & pieces of code lying around that may've given the
impression that debug info metadata supported the possibility that a
subprogram's type could be specified by a non-subroutine type describing
the return type of a void function. This support was incomplete &
unnecessary. Asserts & API have been changed to make the desired usage
more clear.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182532
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 22 May 2013 23:17:36 +0000 (23:17 +0000)]
Simplify logic now that r182490 is in place. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182531
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 22 May 2013 22:36:55 +0000 (22:36 +0000)]
Simplify logic now that r182490 is in place. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182527
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 22 May 2013 22:26:05 +0000 (22:26 +0000)]
Simplify logic now that r182490 is in place. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182526
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Wed, 22 May 2013 20:45:11 +0000 (20:45 +0000)]
Recognize ValueType operands in source patterns for fast-isel.
Currently the fast-isel table generator recognizes registers, register
classes, and immediates for source pattern operands. ValueType
operands are not recognized. This is not a problem for existing
targets with fast-isel support, but will not work for targets like
PowerPC and SPARC that use types in source patterns.
The proposed patch allows ValueType operands and treats them in the
same manner as register classes. There is no convenient way to map
from a ValueType to a register class, but there's no need to do so.
The table generator already requires that all types in the source
pattern be identical, and we know the register class of the output
operand already. So we just assign that register class to any
ValueType operands we encounter.
No functional effect on existing targets. Testing deferred until the
PowerPC target implements fast-isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182512
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Wed, 22 May 2013 20:09:24 +0000 (20:09 +0000)]
Change some PowerPC PatLeaf definitions to ImmLeaf for fast-isel.
Using PatLeaf rather than ImmLeaf when defining immediate predicates
prevents simple patterns using those predicates from being recognized
for fast instruction selection. This patch replaces the immSExt16
PatLeaf predicate with two ImmLeaf predicates, imm32SExt16 and
imm64SExt16, allowing a few more patterns to be recognized (ADDI,
ADDIC, MULLI, ADDI8, and ADDIC8). Using the new predicates does not
help for LI, LI8, SUBFIC, and SUBFIC8 because these are rejected for
other reasons, but I see no reason to retain the PatLeaf predicate.
No functional change intended, and thus no test cases yet. This is
preliminary work for enabling fast-isel support for PowerPC. When
that support is ready, we'll be able to test this function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182510
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Wed, 22 May 2013 19:47:32 +0000 (19:47 +0000)]
SLPVectorizer: Change the order in which new instructions are added to the function.
We are not working on a DAG and I ran into a number of problems when I enabled the vectorizations of 'diamond-trees' (trees that share leafs).
* Imroved the numbering API.
* Changed the placement of new instructions to the last root.
* Fixed a bug with external tree users with non-zero lane.
* Fixed a bug in the placement of in-tree users.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182508
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Wed, 22 May 2013 19:28:41 +0000 (19:28 +0000)]
X86: Fix a bug in EltsFromConsecutiveLoads. We can't generate new loads without chains.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182507
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 22 May 2013 19:07:26 +0000 (19:07 +0000)]
Remove unneeded call to a base default ctor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182503
91177308-0d34-0410-b5e6-
96231b3b80d8
Jean-Luc Duprat [Wed, 22 May 2013 18:29:31 +0000 (18:29 +0000)]
This is an update to a previous commit (r181216).
The earlier change list introduced the following inst combines:
B * (uitofp i1 C) —> select C, B, 0
A * (1 - uitofp i1 C) —> select C, 0, A
select C, 0, B + select C, A, 0 —> select C, A, B
Together these 3 changes would simplify :
A * (1 - uitofp i1 C) + B * uitofp i1 C
down to :
select C, B, A
In practice we found that the first two substitutions can have a
negative effect on performance, because they reduce opportunities to
use FMA contractions; between the two options FMAs are often the
better choice. This change list amends the previous one to enable
just these inst combines:
select C, B, 0 + select C, 0, A —> select C, B, A
A * (1 - uitofp i1 C) + B * uitofp i1 C —> select C, B, A
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182499
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Wed, 22 May 2013 18:09:39 +0000 (18:09 +0000)]
Fix typo in docs/GettingStarted.rst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182496
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Wed, 22 May 2013 18:02:19 +0000 (18:02 +0000)]
Unify formatting of debug output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182495
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 22 May 2013 17:32:15 +0000 (17:32 +0000)]
Fix StringMapIterator compile errors for non-MSVC compilers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182493
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 22 May 2013 17:26:26 +0000 (17:26 +0000)]
Add the IncludeSelf parameter to the MCSubRegIterator and MCSuperRegIterator
constructors. No functional change.
Part of rdar://
12906217
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182490
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 22 May 2013 17:10:11 +0000 (17:10 +0000)]
[Support] Add StringMap::swap() and a default ctor for iterators
This makes StringMap<> more compatible with std::map<std::string, ...>.
Differential Revision: http://llvm-reviews.chandlerc.com/D842
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182487
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 22 May 2013 17:01:12 +0000 (17:01 +0000)]
X86: When expanding PCMPGTQ to PCMPGTD we always want to compare the lower halves as unsigned.
Take #2 on fixing PR15977.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182486
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnold Schwaighofer [Wed, 22 May 2013 16:54:56 +0000 (16:54 +0000)]
LoopVectorize: Make Value pointers that could be RAUW'ed a VH
The Value pointers we store in the induction variable list can be RAUW'ed by a
call to SCEVExpander::expandCodeFor, use a TrackingVH instead. Do the same thing
in some other places where we store pointers that could potentially be RAUW'ed.
Fixes PR16073.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182485
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 22 May 2013 15:31:11 +0000 (15:31 +0000)]
Fix use after free (pr16103).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182482
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 22 May 2013 14:57:42 +0000 (14:57 +0000)]
Check that a function starts with llvm. before using GET_FUNCTION_RECOGNIZER.
Fixes a use of uninitialized memory found by asan and valgind.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182480
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Wed, 22 May 2013 13:38:45 +0000 (13:38 +0000)]
[SystemZ] Rename PSW to CC
Addresses a review comment from Ulrich Weigand. No functional change intended.
I'm not sure whether the old TODO that this patch touches still holds,
but that's something we'd get to when adding a targetted scheduling
description.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182474
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 22 May 2013 12:37:27 +0000 (12:37 +0000)]
sync projects/sample's autohell.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182464
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Wed, 22 May 2013 09:57:57 +0000 (09:57 +0000)]
[SystemZ] Fix thinko in long branch pass
The original version of the pass could underestimate the length of a backward
branch in cases like:
alignment to N bytes or more
...
relaxable branch A
...
foo: (aligned to M<N bytes)
...
bar: (aligned to N bytes)
...
relaxable branch B to foo
We don't add any misalignment gap for "bar" because N bytes of alignment
had already been reached earlier in the function. In this case, assuming
that A is relaxed can push "foo" closer to "bar", and make B appear to be
in range. Similar problems can occur for forward branches.
I don't think it's possible to create blocks with mixed alignments as
things stand, not least because we haven't yet defined getPrefLoopAlignment()
for SystemZ (that would need benchmarking). So I don't think we can test
this yet.
Thanks to Rafael EspĂndola for spotting the bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182460
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 22 May 2013 08:13:02 +0000 (08:13 +0000)]
X86: Remove test instructions proceeding shift by immediate instructions
Allow LLVM to take advantage of shift instructions that set the ZF flag,
making instructions that test the destination superfluous.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182454
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 22 May 2013 06:37:31 +0000 (06:37 +0000)]
R600ISelLowering.cpp: Avoid "using namespace Intrinsic;" to appease MSC. Specify namespaces explicitly here.
MSC is confused about "memcpy" between <cstring> and llvm::Intrinsic::memcpy, when llvm::Intrinsic were exposed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182452
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 22 May 2013 06:37:25 +0000 (06:37 +0000)]
R600: Whitespace and untabify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182451
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Wed, 22 May 2013 06:36:09 +0000 (06:36 +0000)]
Create an FPOW SDNode opcode def in the target independent .td file rather than in a specific backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182450
91177308-0d34-0410-b5e6-
96231b3b80d8
Filip Pizlo [Wed, 22 May 2013 02:46:43 +0000 (02:46 +0000)]
Expose the RTDyldMemoryManager through the C API. This allows clients of
the C API to provide their own way of allocating JIT memory (both code
and data) and finalizing memory permissions (page protections, cache
flush).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182448
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 22 May 2013 02:45:28 +0000 (02:45 +0000)]
Allow duplicates in LLVM_TARGETS_TO_BUILD and LLVM_EXPERIMENTAL_TARGETS_TO_BUILD.
Should fix the cmake bots that were already building R600.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182447
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 22 May 2013 02:30:47 +0000 (02:30 +0000)]
Attempt to fix the mingw32 bot.
This should hopefully fix
http://lab.llvm.org:8011/builders/clang-x86_64-darwin11-self-mingw32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182446
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 22 May 2013 01:36:19 +0000 (01:36 +0000)]
s/u_int32_t/uint32_t/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182444
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 22 May 2013 01:29:38 +0000 (01:29 +0000)]
Fix warning in non-assert build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182443
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 22 May 2013 00:35:47 +0000 (00:35 +0000)]
Make R600 non-experimental.
The r600 backend has been in tree for some time now. Marking it as
non-experimental to avoid accidental breakage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182442
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Tue, 21 May 2013 22:06:02 +0000 (22:06 +0000)]
Mips16 does not use register scavenger from TargetRegisterInfo. It allocates
a RegScavenger object on it's own.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182430
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 21 May 2013 21:22:34 +0000 (21:22 +0000)]
Be more specific and capitalize filenames.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182424
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Tue, 21 May 2013 20:36:13 +0000 (20:36 +0000)]
Define BYTE_ORDER on Solaris.
Solaris doesn't have an endian.h header, but SPARC is the only
big-endian architecture that runs Solaris, so just use that to detect
endianness at compile time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182419
91177308-0d34-0410-b5e6-
96231b3b80d8
Filip Pizlo [Tue, 21 May 2013 20:24:07 +0000 (20:24 +0000)]
Put RTDyldMemoryManager into its own file, and make it linked into
libExecutionEngine. Move method implementations that aren't specific to
allocation out of SectionMemoryManager and into RTDyldMemoryManager.
This is in preparation for exposing RTDyldMemoryManager through the C
API.
This is a fixed version of r182407 and r182411. That first revision
broke builds because I forgot to move the conditional includes of
various POSIX headers from SectionMemoryManager into
RTDyldMemoryManager. Those includes are necessary because of how
getPointerToNamedFunction works around the glibc libc_nonshared.a thing.
The latter revision still broke things because I forgot to include
llvm/Config/config.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182418
91177308-0d34-0410-b5e6-
96231b3b80d8
Filip Pizlo [Tue, 21 May 2013 20:17:14 +0000 (20:17 +0000)]
Roll out r182411 and 182412 because it's still broken.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182415
91177308-0d34-0410-b5e6-
96231b3b80d8
Filip Pizlo [Tue, 21 May 2013 20:11:01 +0000 (20:11 +0000)]
Fix busted comment. This conditional include block used to be in SectionMemoryManager, but is now in RTDyldMemoryManager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182412
91177308-0d34-0410-b5e6-
96231b3b80d8
Filip Pizlo [Tue, 21 May 2013 20:07:12 +0000 (20:07 +0000)]
Put RTDyldMemoryManager into its own file, and make it linked into
libExecutionEngine. Move method implementations that aren't specific to
allocation out of SectionMemoryManager and into RTDyldMemoryManager.
This is in preparation for exposing RTDyldMemoryManager through the C
API.
This is a fixed version of r182407. That revision broke builds because I
forgot to move the conditional includes of various POSIX headers from
SectionMemoryManager into RTDyldMemoryManager. Those includes are
necessary because of how getPointerToNamedFunction works around the
glibc libc_nonshared.a thing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182411
91177308-0d34-0410-b5e6-
96231b3b80d8
Filip Pizlo [Tue, 21 May 2013 20:03:01 +0000 (20:03 +0000)]
Roll out r182407 and r182408 because they broke builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182409
91177308-0d34-0410-b5e6-
96231b3b80d8
Filip Pizlo [Tue, 21 May 2013 20:00:56 +0000 (20:00 +0000)]
Expose the RTDyldMemoryManager through the C API. This allows clients of
the C API to provide their own way of allocating JIT memory (both code
and data) and finalizing memory permissions (page protections, cache
flush).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182408
91177308-0d34-0410-b5e6-
96231b3b80d8
Filip Pizlo [Tue, 21 May 2013 19:56:00 +0000 (19:56 +0000)]
Put RTDyldMemoryManager into its own file, and make it linked into
libExecutionEngine. Move method implementations that aren't specific to
allocation out of SectionMemoryManager and into RTDyldMemoryManager.
This is in preparation for exposing RTDyldMemoryManager through the C
API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182407
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 21 May 2013 18:53:50 +0000 (18:53 +0000)]
Use std::list so that we have a stable iterator.
I will try to avoid creating these std::strings, but for now this gets
the tests passing with libc++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182405
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 21 May 2013 18:06:33 +0000 (18:06 +0000)]
Remove duplicated comment.
Found by -Wdocumentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182402
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 21 May 2013 17:59:15 +0000 (17:59 +0000)]
Regenerate configure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182401
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Tue, 21 May 2013 17:17:59 +0000 (17:17 +0000)]
[mips] Rename option to make it compatible with gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182397
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Tue, 21 May 2013 17:13:47 +0000 (17:13 +0000)]
[mips] Add instruction selection patterns for blez and bgez.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182396
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Holewinski [Tue, 21 May 2013 16:51:30 +0000 (16:51 +0000)]
[NVPTX] Add @llvm.nvvm.sqrt.f() intrinsic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182394
91177308-0d34-0410-b5e6-
96231b3b80d8
Jyotsna Verma [Tue, 21 May 2013 15:54:32 +0000 (15:54 +0000)]
Hexagon: SelectionDAG should not use MVT::Other to check the legality of BR_CC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182390
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Holewinski [Tue, 21 May 2013 14:37:16 +0000 (14:37 +0000)]
Drop @llvm.annotation and @llvm.ptr.annotation intrinsics during codegen.
The intrinsic calls are dropped, but the annotated value is propagated.
Fixes PR 15253
Original patch by Zeng Bin!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182387
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 21 May 2013 14:21:09 +0000 (14:21 +0000)]
Fix PPC branch selection for counter-based branches
Although I had added some support for the BDZ/BDNZ branches into the selector
(in r158204), I had not correctly adjusted the condition at the top of the
loop. As a result, these branches were still essentially unsupported.
This fixes PR16086. Unfortunately, any test case would be very large (because
it would need to force the loop backedge to exceed the range of the 16-bit
immediate).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182385
91177308-0d34-0410-b5e6-
96231b3b80d8