1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

98603 Commits

Author SHA1 Message Date
Quentin Colombet
884367d931 [X86][fast-isel] Fix select lowering.
The condition in selects is supposed to be i1.
Make sure we are just reading the less significant bit
of the 8 bits width value to match this constraint.

<rdar://problem/15651765>

llvm-svn: 197712
2013-12-19 18:32:04 +00:00
David Peixotto
16536db0ae Implement the .ltorg directive for ARM assembly
This directive will write out the assembler-maintained constant
pool for the current section. These constant pools are created to
support the ldr-pseudo instruction (e.g. ldr r0, =val).

The directive can be used by the programmer to place the constant
pool in a location that can be reached by a pc-relative offset in
the ldr instruction.

llvm-svn: 197711
2013-12-19 18:26:07 +00:00
Josh Magee
f3c5790260 Unbreak ARM buildbots after r197653 by forcing the target triple on this test.
llvm-svn: 197709
2013-12-19 18:14:42 +00:00
David Peixotto
a66e68bb52 Implement the ldr-pseudo opcode for ARM assembly
The ldr-pseudo opcode is a convenience for loading 32-bit constants.
It is converted into a pc-relative load from a constant pool. For
example,

  ldr r0, =0x10001
  ldr r1, =bar

will generate this output in the final assembly

  ldr r0, .Ltmp0
  ldr r1, .Ltmp1
  ...
  .Ltmp0: .long 0x10001
  .Ltmp1: .long bar

Sketch of the LDR pseudo implementation:
  Keep a map from Section => ConstantPool

  When parsing ldr r0, =val
    parse val as an MCExpr
    get ConstantPool for current Section
    Label = CreateTempSymbol()
    remember val in ConstantPool at next free slot
    add operand to ldr that is MCSymbolRef of Label

  On finishParse() callback
    Write out all non-empty constant pools
    for each Entry in ConstantPool
      Emit Entry.Label
      Emit Entry.Value

Possible improvements to be added in a later patch:
  1. Does not convert load of small constants to mov
     (e.g. ldr r0, =0x1 => mov r0, 0x1)
  2. Does reuse constant pool entries for same constant

The implementation was tested for ARM, Thumb1, and Thumb2 targets on
linux and darwin.

llvm-svn: 197708
2013-12-19 18:12:36 +00:00
David Peixotto
f4537ad9fd Add a finishParse() callback to the targer asm parser
This callback is invoked when the parse has finished successfuly. It
will be used to write out ARM constant pools to implement the ldr
pseudo.

llvm-svn: 197706
2013-12-19 18:08:08 +00:00
Kay Tiong Khoo
304e305b5c Improved fix for PR17827 (instcombine of shift/and/compare).
This change fixes the case of arithmetic shift right - do not attempt to fold that case.
This change also relaxes the conditions when attempting to fold the logical shift right and shift left cases.

No additional IR-level test cases included at this time. See http://llvm.org/bugs/show_bug.cgi?id=17827 for proofs that these are correct transformations.

llvm-svn: 197705
2013-12-19 18:07:17 +00:00
NAKAMURA Takumi
4e11107c76 Revert r197682, "[CMake] Introduce LIT in add_lit_target."
llvm-svn: 197703
2013-12-19 17:11:08 +00:00
Adrian Prantl
15572f3199 Move testcase to the appropriate X86 subdirectory.
llvm-svn: 197701
2013-12-19 17:09:05 +00:00
Rafael Espindola
db0b3614ff Small simplification, p0 is the same as p.
llvm-svn: 197699
2013-12-19 16:51:03 +00:00
Zoran Jovanovic
e6baed485f Support for microMIPS control instructions.
llvm-svn: 197696
2013-12-19 16:25:00 +00:00
Rafael Espindola
6cf8a98d5f Long doubles are required to be aligned to 128 bits and svr4 32 bits.
Clang was already getting this right.

llvm-svn: 197694
2013-12-19 16:23:59 +00:00
Hal Finkel
ce61543897 Add a disassembler to the PowerPC backend
The tests for the disassembler were adapted from the encoder tests, and for the
most part, the output from the disassembler matches that encoder-test inputs.
There are some places where more-informative mnemonics could be produced
(notably for the branch instructions), and those cases are noted in the tests
with FIXMEs.

Future work includes:

 - Generating more-informative mnemonics when possible (this may also be done
   in the printer).

 - Remove the dependence on positional "numbered" operand-to-variable mapping
   (for both encoding and decoding).

 - Internally using 64-bit instruction variants in 64-bit mode (if this turns
   out to matter).

llvm-svn: 197693
2013-12-19 16:13:01 +00:00
Zoran Jovanovic
a4d6da998d Support for microMIPS LL and SC instructions.
llvm-svn: 197692
2013-12-19 16:12:56 +00:00
Hal Finkel
860adf085f Add support for positionally-encoded operands to FixedLenDecoderEmitter
Unfortunately, the PowerPC instruction definitions make heavy use of the
positional operand encoding heuristic to map operands onto bitfield variables
in the instruction definitions. Changing this to use name-based mapping is not
trivial, however, because additional infrastructure needs to be designed to
handle mapping of complex operands (with multiple suboperands) onto multiple
bitfield variables.

In the mean time, this adds support for positionally encoded operands to
FixedLenDecoderEmitter, so that we can generate a disassembler for the PowerPC
backend. To prevent an accidental reliance on this feature, and to prevent an
undesirable interaction with existing disassemblers, a backend must opt-in to
this support by setting the new decodePositionallyEncodedOperands
instruction-set bit to true.

When enabled, this iterates the variables that contribute to the instruction
encoding, just as the encoder does, and emulates the procedure the encoder uses
to map "numbered" operands to variables. The bit range for each variable is
also determined as the encoder determines them. This map is then consulted
during the decoder-generator's loop over operands to decode, allowing the
decoder to understand both position-based and name-based operand-to-variable
mappings.

As noted in the comment on the decodePositionallyEncodedOperands definition,
this support should be removed once it is no longer needed. There should be no
change to existing disassemblers.

llvm-svn: 197691
2013-12-19 16:12:53 +00:00
Rafael Espindola
64a77ceb5f Add a triple so that this passes on OS X.
I am surprised I am the first one to notice this.

llvm-svn: 197689
2013-12-19 16:06:33 +00:00
Zoran Jovanovic
6b16ca6dfa Support for microMIPS TLS relocations.
llvm-svn: 197685
2013-12-19 16:02:32 +00:00
NAKAMURA Takumi
6d9f03d46c llvm-config: Don't show build tree with --obj-root for installed llvm-config. Show $(prefix) instead.
llvm-svn: 197684
2013-12-19 16:02:28 +00:00
NAKAMURA Takumi
b541cf83d2 llvm-config: Show build root instead of parent path in build tree with --obj-root for CMake multiconfig.
llvm-svn: 197683
2013-12-19 16:02:23 +00:00
NAKAMURA Takumi
ae79bc81b6 [CMake] Introduce LIT in add_lit_target.
llvm-svn: 197682
2013-12-19 16:02:17 +00:00
Hal Finkel
75f8d9984e Add support for PointerLikeRegClass to FixedLenDecoderEmitter
This is more prep for adding the PowerPC disassembler. FixedLenDecoderEmitter
should recognize PointerLikeRegClass operands as register types, and generate
register-like decoding calls instead of treating them like immediates.

llvm-svn: 197680
2013-12-19 14:58:22 +00:00
Evgeniy Stepanov
301154310a [dfsan] Simplify code after r197677.
llvm-svn: 197679
2013-12-19 14:37:03 +00:00
Evgeniy Stepanov
0cd4eea1b6 Add an explicit insert point argument to SplitBlockAndInsertIfThen.
Currently SplitBlockAndInsertIfThen requires that branch condition is an
Instruction itself, which is very inconvenient, because it is sometimes an
Operator, or even a Constant.

llvm-svn: 197677
2013-12-19 13:29:56 +00:00
Timur Iskhodzhanov
3d72e1e9e4 Teach the llvm-readobj COFF dumper to dump debug line tables from object files
Reviewed at http://llvm-reviews.chandlerc.com/D2425

llvm-svn: 197674
2013-12-19 11:37:14 +00:00
Timur Iskhodzhanov
60e5c2a48d Remove the COFF files with Z7 debug info from the repo
Rationale: going to land D2425 shortly.
I'll re-land these COFF files along with D2425 to simplify the SVN history

llvm-svn: 197673
2013-12-19 11:30:21 +00:00
NAKAMURA Takumi
e67a3fe0ef Add REQUIRES:asserts to 3 tests in llvm/test/CodeGen/R600 added in r192212.
They are failing in assertions.

llvm-svn: 197669
2013-12-19 10:41:12 +00:00
NAKAMURA Takumi
ca4f03760d llvm-config: Introduce --system-libs to print SYSTEM_LIBS, and deprecate SYSTEM_LIBS in --ldflags.
Although --system-libs is expected to use after --libs, it can be used alone.

  $ bin/llvm-config --ldflags
  -L/path/to/llvm/objroot/lib

  $ bin/llvm-config --libs object
  -lLLVMObject -lLLVMSupport

  $ bin/llvm-config --system-libs
    (Blank line. "all" is assumed but nothing is printed.)
  -lrt -ldl -ltinfo -lpthread -lz

  $ bin/llvm-config --ldflags --libs --system-libs object
  -L/path/to/llvm/objroot/lib
  -lLLVMObject -lLLVMSupport
  -lrt -ldl -ltinfo -lpthread -lz

It is reimplementation of r197380, and workaround for PR3347 and PR8449.

FIXME: Each LLVM component may have its dependent system libs.
llvm-svn: 197664
2013-12-19 08:46:36 +00:00
NAKAMURA Takumi
aaf136c503 GCOV.cpp: Fix format strings, %lf. Don't use %lf to double.
llvm-svn: 197663
2013-12-19 08:46:28 +00:00
NAKAMURA Takumi
c43d8c9237 Introduce clean-ups in llvm/unittests/Makefile.unittest, to sweep stray *Tests.
Stray *Tests might stay after reverting.

FIXME: Could we apply this feature to clang/unittests?
FIXME: Implement this feature to CMake.
llvm-svn: 197661
2013-12-19 07:09:28 +00:00
Matt Arsenault
e64331a159 R600/SI: Make private pointers be 32-bit.
Different sized address spaces should theoretically work
most of the time now, and since 64-bit add is currently
disabled, using more 32-bit pointers fixes some cases.

llvm-svn: 197659
2013-12-19 05:32:55 +00:00
Matt Arsenault
afde586636 Fix missing C++ mode comment
llvm-svn: 197658
2013-12-19 05:32:44 +00:00
Saleem Abdulrasool
a48f1a5b54 ARM IAS: support .inst directive
This adds support for the .inst directive.  This is an ARM specific directive to
indicate an instruction encoded as a constant expression.  The major difference
between .word, .short, or .byte and .inst is that the latter will be
disassembled as an instruction since it does not get flagged as data.

llvm-svn: 197657
2013-12-19 05:17:58 +00:00
Rafael Espindola
85842b6045 No point in having a "#if 0"ed unittest.
It is also not clear what the value of the test was. The API is used from
existing tools and can (and is) tested with lit.

llvm-svn: 197654
2013-12-19 03:44:13 +00:00
Josh Magee
86d29cffa7 [stackprotector] Use analysis from the StackProtector pass for stack layout in PEI a nd LocalStackSlot passes.
This changes the MachineFrameInfo API to use the new SSPLayoutKind information
produced by the StackProtector pass (instead of a boolean flag) and updates a
few pass dependencies (to preserve the SSP analysis).

The stack layout follows the same approach used prior to this change - i.e.,
only LargeArray stack objects will be placed near the canary and everything
else will be laid out normally.  After this change, structures containing large
arrays will also be placed near the canary - a case previously missed by the
old implementation.

Out of tree targets will need to update their usage of
MachineFrameInfo::CreateStackObject to remove the MayNeedSP argument. 

The next patch will implement the rules for sspstrong and sspreq.  The end goal
is to support ssp-strong stack layout rules.

WIP.

Differential Revision: http://llvm-reviews.chandlerc.com/D2158

llvm-svn: 197653
2013-12-19 03:17:11 +00:00
Anna Zaks
3a3a64f7fe Fix a buffer overrun detected by AddressSanitizer.
llvm-svn: 197647
2013-12-19 02:35:26 +00:00
Rafael Espindola
5589bebfa5 Add stack alignment information for Sparc.
This matches the data in clang which was added by Jakob Stoklund Olesen in
r179596.

Thanks for erikjv on irc for pointing me to the relevant documents:
http://sparc.com/standards/64.psabi.1.35.ps.Z
page 25: Every stack frame must be 16-byte aligned.

http://sparc.com/standards/psABI3rd.pdf
page 3-10: Although the architecture requires only word alignment, software convention and the operating system require every stack frame to be doubleword aligned.

I tried to add a test, but it looks like sparc doesn't implement dynamic stack
realignment. This will be tested in clang shortly.

llvm-svn: 197646
2013-12-19 02:21:16 +00:00
Reid Kleckner
f795c3e4a9 Begin adding docs and IR-level support for the inalloca attribute
The inalloca attribute is designed to support passing C++ objects by
value in the Microsoft C++ ABI.  It behaves the same as byval, except
that it always implies that the argument is in memory and that the bytes
are never copied.  This attribute allows the caller to take the address
of an outgoing argument's memory and execute arbitrary code to store
into it.

This patch adds basic IR support, docs, and verification.  It does not
attempt to implement any lowering or fix any possibly broken transforms.

When this patch lands, a complete description of this feature should
appear at http://llvm.org/docs/InAlloca.html .

Differential Revision: http://llvm-reviews.chandlerc.com/D2173

llvm-svn: 197645
2013-12-19 02:14:12 +00:00
Adrian Prantl
4d7b214e27 add source in comment
llvm-svn: 197642
2013-12-19 01:41:16 +00:00
Rafael Espindola
859cb122ba Synchronize the NaCl DataLayout strings with the ones in clang.
Patch by Derek Schuff.

llvm-svn: 197640
2013-12-19 00:44:37 +00:00
Reed Kotler
660bf702a1 Make cosmetic changes as part of Mips internal post commit review of
patch r196331.

llvm-svn: 197638
2013-12-19 00:43:08 +00:00
NAKAMURA Takumi
5bd83087aa ArchiveFileDescriptorTests: Fix CMake build. Each unit test is expected to have suffix "*Tests" for lit gtest runner to seek one.
llvm-svn: 197636
2013-12-19 00:41:08 +00:00
NAKAMURA Takumi
b74598e93b ArchiveFileDescriptorTests: Resurrect part of r197600, but make it invalidated, to appease buildbots.
Please revert this several hours later ;)

llvm-svn: 197635
2013-12-19 00:41:03 +00:00
Yuchen Wu
a7b83f0a43 llvm-cov: Added -f option for function summaries.
Similar to the file summaries, the function summaries output line,
branching and call statistics. The file summaries have been moved
outside the initial loop so that all of the function summaries can be
outputted before file summaries.

Also updated test cases.

llvm-svn: 197633
2013-12-19 00:29:25 +00:00
Reed Kotler
012c0a0f79 Fix a problem with mips16 stubs when calls are transformed during
tail call optimization. Some more work may be needed for indirect
calls but this patch fixes the current regression in Prolangc++/trees.
S2 optimization as part of the general cleanup and optimization
of prolog and epilog was not saving S2 in this case and needed to.

llvm-svn: 197630
2013-12-18 23:57:48 +00:00
Andrew Trick
e73fd60399 Revert "Add -mcpu=z10 to SystemZ tests."
This reverts commit r197466.

The MachineCSE fix that required the -mcpu flag has been disabled
until more work can be done to fix downstream issues. Adding -mcpu
wasn't the right workaround anyway.

llvm-svn: 197624
2013-12-18 23:04:37 +00:00
Weiming Zhao
628bf03d65 [aarch32] fix bug 18268: Incorrect condition of vsel
Given vsel_cc, op1, op2, since vsel has no LE/LT, to generate vsel for
such selection, it needs to inverse cc and swap op1 and op2. To inverse
cc, both L/G and E bits should be flipped.

llvm-svn: 197615
2013-12-18 22:25:17 +00:00
Adrian Prantl
a16d0492a0 Debug info: Implement (rvalue) reference qualifiers for C++11 non-static
member functions. Paired commit with CFE.

rdar://problem/15356637

llvm-svn: 197613
2013-12-18 21:48:19 +00:00
Adrian Prantl
e2d61b87e3 Pull in a couple of new constants from the upcoming DWARF 5 standard.
llvm-svn: 197611
2013-12-18 21:48:14 +00:00
Adrian Prantl
789db8ecdd formatting
llvm-svn: 197610
2013-12-18 21:48:11 +00:00
Rafael Espindola
6dc5fe883a Correctly handle the degenerated triple "thumb".
Fixes a crash in llc where some parts think the target is thumb and others think
it is ARM.

llvm-svn: 197607
2013-12-18 21:29:44 +00:00
Yuchen Wu
2639825176 llvm-cov: Print coverage summary to STDOUT.
File summaries will now be optionally outputted which will give line,
branching and call coverage info. Unfortunately, clang's current
instrumentation does not give enough information to deduce function
calls, something that gcc is able to do. Thus, no calls are always
outputted to be consistent with gcov output.

Also updated tests.

llvm-svn: 197606
2013-12-18 21:12:51 +00:00