1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-25 05:52:53 +02:00
Commit Graph

86137 Commits

Author SHA1 Message Date
Preston Gurd
1683865eea This patch addresses a problem with the Post RA scheduler generating an
incorrect instruction sequence due to it not being aware that an
inline assembly instruction may reference memory.

This patch fixes the problem by causing the scheduler to always assume that any
inline assembly code instruction could access memory. This is necessary because
the internal representation of the inline instruction does not include
any information about memory accesses.
 
This should fix PR13504.

llvm-svn: 166929
2012-10-29 15:01:23 +00:00
Bill Schmidt
2682b73f6d This patch adds alignment information for long double to the 64-bit PowerPC
ELF subtarget.

The existing logic is used as a fallback to avoid any changes to the Darwin
ABI.  PPC64 ELF now has two possible data layout strings: one for FreeBSD,
which requires 8-byte alignment, and a default string that requires
16-byte alignment.

I've added a test for PPC64 Linux to verify the 16-byte alignment.  If
somebody wants to add a separate test for FreeBSD, that would be great.

Note that there is a companion patch to update the alignment information
in Clang, which I am committing now as well.

llvm-svn: 166928
2012-10-29 14:59:36 +00:00
Duncan Sands
e31c816e49 Factorize code: rather than duplication the logic in getPointerTypeSizeInBits,
just call getPointerTypeSizeInBits.  No functionality change.

llvm-svn: 166926
2012-10-29 14:30:05 +00:00
Duncan Sands
29007803eb Loads and stores without an explicit alignment use the abi alignment not the
preferred alignment.  Correct the documentation.

llvm-svn: 166925
2012-10-29 14:12:44 +00:00
Duncan Sands
38db7fb0cc Rather than duplicating the getPointerSize code just call getPointerSize.
llvm-svn: 166923
2012-10-29 12:19:04 +00:00
Duncan Sands
9234853009 Silence a GCC warning about comparing signed and unsigned types.
llvm-svn: 166922
2012-10-29 11:29:53 +00:00
Tim Northover
a1e6e26f6e Align the data section correctly when loading an ELF file.
Patch by Amara Emerson.

llvm-svn: 166920
2012-10-29 10:47:07 +00:00
Tim Northover
fdb1d1af73 Make use of common-symbol alignment info in ELF loader.
Patch by Amara Emerson.

llvm-svn: 166919
2012-10-29 10:47:04 +00:00
Tim Northover
86db334e17 Add interface for querying object files for symbol values.
Currently only implemented for ELF.

Patch by Amara Emerson.

llvm-svn: 166918
2012-10-29 10:47:00 +00:00
Evgeniy Stepanov
c0670f92a5 va_start, va_end, va_copy: InstrinsicInst subclasses and InstVisitor support.
llvm-svn: 166916
2012-10-29 09:39:03 +00:00
Nadav Rotem
555bf92429 Calling TLI->getNumRegisters creates a circular dependency when building LLVM using cmake.
Get the number of registers by calling getTypeLegalizationCost.

PR14199.

llvm-svn: 166911
2012-10-29 05:28:35 +00:00
Lang Hames
3fe1babcc2 Remove unused typedef.
llvm-svn: 166910
2012-10-29 04:57:52 +00:00
Rafael Espindola
f030658478 Add -alias and -ralias options to match what we have for functions and
globals.

llvm-svn: 166909
2012-10-29 02:23:07 +00:00
Rafael Espindola
c460831626 llvm-extract changes linkages so that functions on both sides of the
split module can see each other. If it is keeping a symbol that already has
a non local linkage, it doesn't need to change it.

llvm-svn: 166908
2012-10-29 01:59:03 +00:00
Rafael Espindola
218ef13219 llvm-extract was unable to handle aliases. It would leave a copy on the
output of both

llvm-extract foo.ll -func=bar
and
llvm-extract foo.ll -func=bar -delete

so the two new files could not be linked together anymore. With this change
alias are handled almost like functions and global variables. Almost because
with alias we cannot just clear the initializer/body, we have to create a new
declaration and replace the alias with it.

The net result is that now the output of the above commands can be linked
even if foo.ll has aliases.

llvm-svn: 166907
2012-10-29 00:27:55 +00:00
Reed Kotler
1b4c985fc8 Implement brind operator for mips16.
llvm-svn: 166903
2012-10-28 23:08:07 +00:00
Rafael Espindola
b6c97c170b Remove TargetELFWriterInfo.
All the credit goes to Jan Voung for noticing it was dead!

llvm-svn: 166902
2012-10-28 21:34:43 +00:00
Reed Kotler
16eaf8644a This patch is for the implementation of mips16 complex pattern addr16.
Previously mips16 was sharing the pattern addr which is used for mips32
and mips64. This had a number of problems:
1) Storing and loading byte and halfword quantities for mips16 has particular
problems due to the primarily non mips16 nature of SP. When we must
load/store byte/halfword stack objects in a function, we must create a mips16
alias register for SP. This functionality is tested in stchar.ll.
2) We need to have an FP register under certain conditions (such as 
dynamically sized alloca). We use mips16 register S0 for this purpose.
In this case, we also use this register when accessing frame objects so this
issue also affects the complex pattern addr16. This functionality is
tested in alloca16.ll.

The Mips16InstrInfo.td has been updated to use addr16 instead of addr.

The complex pattern C++ function for addr has been copied to addr16 and
updated to reflect the above issues.

llvm-svn: 166897
2012-10-28 06:02:37 +00:00
Jakob Stoklund Olesen
2efe8df169 Never attempt to join an early-clobber def with a regular kill.
This fixes PR14194.

llvm-svn: 166880
2012-10-27 17:41:27 +00:00
Benjamin Kramer
00df4c1b61 LoopIdiom: Add checks to avoid turning memmove into an infinite loop.
I don't think this is possible with the current implementation but that may change eventually.

llvm-svn: 166877
2012-10-27 15:18:28 +00:00
Benjamin Kramer
8ba71ab2ab LoopIdiom: Recognize memmove loops.
This turns loops like
  for (unsigned i = 0; i != n; ++i)
    p[i] = p[i+1];
into memmove, which has a highly optimized implementation in most libcs.

This was really easy with the new DependenceAnalysis :)

llvm-svn: 166875
2012-10-27 14:25:51 +00:00
Benjamin Kramer
ba967fc2f3 LoopIdiom: Replace custom dependence analysis with DependenceAnalysis.
Requires a lot less code and complexity on loop-idiom's side and the more
precise analysis can catch more cases, like the one I included as a test case.
This also fixes the edge-case miscompilation from PR9481.

Compile time performance seems to be slightly worse, but this is mostly due
to an extra LCSSA run scheduled by the PassManager and should be fixed there.

llvm-svn: 166874
2012-10-27 14:25:44 +00:00
Benjamin Kramer
081da3573b SCEV validator: Ignore CouldNotCompute/undef on both sides. This is mostly noise and blocks finding more severe bugs.
llvm-svn: 166873
2012-10-27 11:36:07 +00:00
Benjamin Kramer
01817bd238 SCEV validator: Add workarounds for some common false positives due to the way it handles strings.
llvm-svn: 166872
2012-10-27 10:45:01 +00:00
Chandler Carruth
9359c9ab08 Clarify that there is an option other than OAuth for Phabricator and
offer up my email to the spam lords for it. Hopefully this will
eventually be more automatic, but we don't want people to think there is
only one option.

llvm-svn: 166870
2012-10-27 09:47:33 +00:00
Hal Finkel
82db9961eb Update BBVectorize to use the new VTTI instr. cost interfaces.
The monolithic interface for instruction costs has been split into
several functions. This is the corresponding change. No functionality
change is intended.

llvm-svn: 166865
2012-10-27 04:33:48 +00:00
Nadav Rotem
04f3086065 1. Fix a bug in getTypeConversion. When a *simple* type is split, we need to return the type of the split result.
2. Change the maximum vectorization width from 4 to 8.
3. A test for both.

llvm-svn: 166864
2012-10-27 04:11:32 +00:00
Quentin Colombet
bcd2bc3437 [code size][ARM] Emit regular call instructions instead of the move, branch sequence
llvm-svn: 166854
2012-10-27 01:10:17 +00:00
Reed Kotler
cc41464454 Implement MipsHi for mips16
llvm-svn: 166852
2012-10-27 00:57:14 +00:00
Akira Hatanaka
a2ae72bd2f [mips] Do not tail-call optimize vararg functions or functions with byval
arguments.

This is rather conservative and should be fixed later to be more aggressive.

llvm-svn: 166851
2012-10-27 00:56:56 +00:00
Akira Hatanaka
4d26f60ca0 [mips] Make sure FuncArg doesn't advance when OrigArgIndex is the same as in the
previous iteration.

llvm-svn: 166850
2012-10-27 00:44:39 +00:00
Akira Hatanaka
f04bcd095c Use the methods and classes that were added to simplify LowerCall and
LowerFormalArguments in MipsTargetLowering.

No functionality change intended.

llvm-svn: 166846
2012-10-27 00:29:43 +00:00
Akira Hatanaka
3cd01228a7 Add method MipsTargetLowering::writeVarArgRegs which copies argument registers
of vararg functions back to the stack.

llvm-svn: 166844
2012-10-27 00:21:13 +00:00
Akira Hatanaka
7713c406cf Add method MipsTargetLowering::passByValArg.
This method emits nodes for passing byval arguments in registers and stack.
This has the same functionality as existing functions PassByValArg64 and
WriteByValArg which will be deleted later.

llvm-svn: 166843
2012-10-27 00:16:36 +00:00
Akira Hatanaka
5b7f71dcfc Add method MipsTargetLowering::copyByValRegs.
This method copies byval arguments passed in registers onto the stack and has
the same functionality as existing functions CopyMips64ByValRegs and
ReadByValArg which will be deleted later.

llvm-svn: 166841
2012-10-27 00:10:18 +00:00
Akira Hatanaka
32f472529e Add class MipsCC which provides methods used to analyze formal and call
arguments and inquire about calling convention information.

llvm-svn: 166840
2012-10-26 23:56:38 +00:00
Akira Hatanaka
d206b7dcb3 Delete MipsFunctionInfo::InArgFIRange.
llvm-svn: 166837
2012-10-26 23:49:51 +00:00
Nadav Rotem
133e437c48 Refactor the VectorTargetTransformInfo interface.
Add getCostXXX calls for different families of opcodes, such as casts, arithmetic, cmp, etc.

Port the LoopVectorizer to the new API.

The LoopVectorizer now finds instructions which will remain uniform after vectorization. It uses this information when calculating the cost of these instructions.

llvm-svn: 166836
2012-10-26 23:49:28 +00:00
Jakob Stoklund Olesen
4b4db880a3 Revert r163298 "Optimize codegen for VSETLNi{8,16,32} operating on Q registers."
Keep the integer_insertelement test case, the new coalescer can handle
this kind of lane insertion without help from pseudo-instructions.

llvm-svn: 166835
2012-10-26 23:39:46 +00:00
Kaelyn Uhrain
601e3b457f Avoid an unused-variable warning when asserts are disabled.
llvm-svn: 166834
2012-10-26 23:28:41 +00:00
Jakob Stoklund Olesen
3831f9f19f Reduce indentation with early exit.
No functional change.

llvm-svn: 166829
2012-10-26 23:05:13 +00:00
Jakob Stoklund Olesen
74618f417a Also make the current basic block a class member.
Don't pass it around everywhere as a function argument.

llvm-svn: 166828
2012-10-26 23:05:10 +00:00
Reed Kotler
8721a311b3 implement mips16 tls global addr
llvm-svn: 166827
2012-10-26 22:57:32 +00:00
Lang Hames
a2fffc78e7 MCRegisterClass should be returned by const ref, not by value.
llvm-svn: 166822
2012-10-26 22:14:10 +00:00
Jordan Rose
c9ba5a38bb Suggest llvm_unreachable over assert(0).
llvm-svn: 166821
2012-10-26 22:08:46 +00:00
Jakob Stoklund Olesen
cdf3df4595 Make the Processed set a class member.
Don't pass it everywhere as an argument.

llvm-svn: 166820
2012-10-26 22:06:00 +00:00
Chad Rosier
9ed4ab0c64 [ms-inline asm] Add a comment.
llvm-svn: 166819
2012-10-26 22:01:25 +00:00
Jakob Stoklund Olesen
c02a8906fc 80 col.
llvm-svn: 166818
2012-10-26 21:46:57 +00:00
Jakob Stoklund Olesen
4cf10d7d78 Remove ARMBaseRegisterInfo::isReservedReg().
It is just as easy to use MRI::isReserved() now.

llvm-svn: 166817
2012-10-26 21:43:05 +00:00
Jakob Stoklund Olesen
1a8c00078d Add GPRPair Register class to ARM.
Some instructions in ARM require 2 even-odd paired GPRs. This
patch adds support for such register class.

Patch by Weiming Zhao!

llvm-svn: 166816
2012-10-26 21:29:15 +00:00