1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

80029 Commits

Author SHA1 Message Date
Colin LeMahieu
084c4d499d [Hexagon] Disassembling, printing, and emitting instructions a whole-bundle at a time which is the semantic unit for Hexagon. Fixing tests to use the new format. Disabling tests in the direct object emission path for a followup patch.
llvm-svn: 238556
2015-05-29 14:44:13 +00:00
Rafael Espindola
2ea0919069 Fix ELFObjectWriter::isLocal for signature symbols.
And with that simplify the logic for inserting them in ExternalSymbolData or
LocalSymbolData.

No functionality change overall since the old code avoided the isLocal bug.

llvm-svn: 238555
2015-05-29 14:20:40 +00:00
Toma Tabacu
1c1d068bb7 [mips] Remove 2 unused variables in MipsTargetStreamer.cpp. NFC.
llvm-svn: 238554
2015-05-29 13:52:56 +00:00
Craig Topper
6d0adbbb1b [TableGen] Remove convertValue functions for UnOpInit, BinOpInit, and TernOpInit as they weren't able to be called.
I don't think converting the inputs to the Ops was the right behavior anyway.

llvm-svn: 238543
2015-05-29 05:51:32 +00:00
Matthias Braun
8585b09fb0 This should have been a reference
llvm-svn: 238540
2015-05-29 02:59:59 +00:00
Matthias Braun
4eae512569 CodeGen: Use mop_iterator instead of MIOperands/ConstMIOperands
MIOperands/ConstMIOperands are classes iterating over the MachineOperand
of a MachineInstr, however MachineInstr::mop_iterator does the same
thing.

I assume these two iterators exist to have a uniform interface to
iterate over the operands of a machine instruction bundle and a single
machine instruction. However in practice I find it more confusing to have 2
different iterator classes, so this patch transforms (nearly all) the
code to use mop_iterators.

The only exception being MIOperands::anlayzePhysReg() and
MIOperands::analyzeVirtReg() still needing an equivalent, I leave that
as an exercise for the next patch.

Differential Revision: http://reviews.llvm.org/D9932

This version is slightly modified from the proposed revision in that it
introduces MachineInstr::getOperandNo to avoid the extra counting
variable in the few loops that previously used MIOperands::getOperandNo.

llvm-svn: 238539
2015-05-29 02:56:46 +00:00
Ahmed Bougacha
a689d2cb58 [IR] fptrunc-of-fptrunc isn't an EliminableCastPair.
Double and single rounding can produce different results.
This is the IR counterpart to r228911.

llvm-svn: 238531
2015-05-29 00:04:30 +00:00
Matthias Braun
ab15095964 MachineFrameInfo: Simplify pristine register calculation.
About pristine regsiters:
Pristine registers "hold a value that is useless to the current
function, but that must be preserved - they are callee saved registers
that have not been saved." This concept saves compile time as it frees
the prologue/epilogue inserter from adding every such register to every
basic blocks live-in list.

However the current code in getPristineRegs is formulated in a
complicated way: Inside the function prologue and epilogue all callee
saves are considered pristine, while in the rest of the code only the
non-saved ones are considered pristine.  This requires logic to
differentiate between prologue/epilogue and the rest and in the presence
of shrink-wrapping this even becomes complicated/expensive.  It's also
unnecessary because the prologue epilogue inserters already mark
callee-save registers that are saved/restores properly in the respective
blocks in the prologue/epilogue (see updateLiveness() in
PrologueEpilogueInserter.cpp). So only declaring non-saved/restored
callee saved registers as pristine just works.

Differential Revision: http://reviews.llvm.org/D10101

llvm-svn: 238524
2015-05-28 23:20:35 +00:00
Eric Christopher
6fef6aa03e Fix typos in variable/grammar names.
llvm-svn: 238523
2015-05-28 23:07:39 +00:00
Reid Kleckner
70ba9df70b Rename Win64Exception.(cpp|h) to WinException.(cpp|h)
This is in preparation for reusing this for 32-bit x86 EH table
emission.  Also updates the type name for consistency. NFC

llvm-svn: 238521
2015-05-28 22:47:01 +00:00
Alex Lorenz
8269eba38f MIR Serialization: print and parse machine function names.
This commit introduces a serializable structure called
'llvm::yaml::MachineFunction' that stores the machine
function's name. This structure will mirror the machine 
function's state in the future.

This commit prints machine functions as YAML documents
containing a YAML mapping that stores the state of a machine
function. This commit also parses the YAML documents
that contain the machine functions.

Reviewers: Duncan P. N. Exon Smith

Differential Revision: http://reviews.llvm.org/D9841

llvm-svn: 238519
2015-05-28 22:41:12 +00:00
Quentin Colombet
df910a4090 [MachineCopyPropagation] Fix a bug with undef handling when the value is actualy alive.
Test case will follow.

llvm-svn: 238518
2015-05-28 22:38:40 +00:00
Reid Kleckner
711f4eb0a1 [WinEH] Start inserting state number stores for C++ EH
This moves all the state numbering code for C++ EH to WinEHPrepare so
that we can call it from the X86 state numbering IR pass that runs
before isel.

Now we just call the same state numbering machinery and insert a bunch
of stores. It also populates MachineModuleInfo with information about
the current function.

llvm-svn: 238514
2015-05-28 22:00:24 +00:00
Rafael Espindola
c79576b357 Don't special case undefined symbol when deciding the symbol order.
ELF has no restrictions on where undefined symbols go relative to other defined
symbols. In fact, gas just sorts them together. Do the same.

This was there since r111174 probably just because the MachO writer has it.

llvm-svn: 238513
2015-05-28 21:59:34 +00:00
Wei Mi
e3bab282ea Enable exitValue rewrite only when the cost of expansion is low.
The patch evaluates the expansion cost of exitValue in indVarSimplify pass, and only does the rewriting when the expansion cost is low or loop can be deleted with the rewriting. It provides an option "-replexitval=" to control the default aggressiveness of the exitvalue rewriting. It also fixes some missing cases in SCEVExpander::isHighCostExpansionHelper to enhance the evaluation of SCEV expansion cost.

Differential Revision: http://reviews.llvm.org/D9800

llvm-svn: 238507
2015-05-28 21:49:07 +00:00
Rafael Espindola
be6f69a9cc Remove a trivial forwarding function. NFC.
llvm-svn: 238506
2015-05-28 21:36:02 +00:00
David Majnemer
b213c7ba47 [SelectionDAG] Scalar shift amounts may require legalization
The shift amount may be too small to cope with promoted left hand side,
make sure to promote it as well.

This fixes PR23664.

llvm-svn: 238503
2015-05-28 21:29:59 +00:00
Reid Kleckner
4748d81d28 Remove debug prints from r238487
llvm-svn: 238501
2015-05-28 21:23:53 +00:00
Rafael Espindola
effa5fc7da Inline trivial method. NFC.
llvm-svn: 238492
2015-05-28 20:53:09 +00:00
Reid Kleckner
2c78d5e9c7 Disable x86 tail call optimizations that jump through GOT
For x86 targets, do not do sibling call optimization when materializing
the callee's address would require a GOT relocation. We can still do
tail calls to internal functions, hidden functions, and protected
functions, because they do not require this kind of relocation. It is
still possible to get GOT relocations when the user explicitly asks for
it with musttail or -tailcallopt, both of which are supposed to
guarantee TCO.

Based on a patch by Chih-hung Hsieh.

Reviewers: srhines, timmurray, danalbert, enh, void, nadav, rnk

Subscribers: joerg, davidxl, llvm-commits

Differential Revision: http://reviews.llvm.org/D9799

llvm-svn: 238487
2015-05-28 20:44:28 +00:00
Daniel Sanders
82a2ed16ac Revert r238427 - [mips] Make TTypeEncoding indirect to allow .eh_frame to be read-only.
It caused a smaller number of failures than the previous attempt at committing but still caused a couple on the llvm-linux-mips builder. Reverting while I investigate the remainder.

llvm-svn: 238483
2015-05-28 20:30:32 +00:00
Rafael Espindola
2addfe8ca6 Remove structure field that can be computed just before use.
llvm-svn: 238480
2015-05-28 20:25:29 +00:00
Rafael Espindola
1b6358631c Avoid warnings when building without asserts.
llvm-svn: 238479
2015-05-28 20:19:31 +00:00
Rafael Espindola
7335e39983 Move these vectors to the only function where they are used.
llvm-svn: 238477
2015-05-28 20:11:34 +00:00
Peter Collingbourne
688547e6fc Thumb2: Modify codegen for memcpy intrinsic to prefer LDM/STM.
We were previously codegen'ing these as regular load/store operations and
hoping that the register allocator would allocate registers in ascending order
so that we could apply an LDM/STM combine after register allocation. According
to the commit that first introduced this code (r37179), we planned to teach
the register allocator to allocate the registers in ascending order. This
never got implemented, and up to now we've been stuck with very poor codegen.

A much simpler approach for achiveing better codegen is to create LDM/STM
instructions with identical sets of virtual registers, let the register
allocator pick arbitrary registers and order register lists when printing an
MCInst. This approach also avoids the need to repeatedly calculate offsets
which ultimately ought to be eliminated pre-RA in order to decrease register
pressure.

This is implemented by lowering the memcpy intrinsic to a series of SD-only
MCOPY pseudo-instructions which performs a memory copy using a given number
of registers. During SD->MI lowering, we lower MCOPY to LDM/STM. This is a
little unusual, but it avoids the need to encode register lists in the SD,
and we can take advantage of SD use lists to decide whether to use the _UPD
variant of the instructions.

Fixes PR9199.

Differential Revision: http://reviews.llvm.org/D9508

llvm-svn: 238473
2015-05-28 20:02:45 +00:00
Reid Kleckner
dbcfffa4e5 [WinEH] Remove debugging dump() call
llvm-svn: 238472
2015-05-28 20:02:05 +00:00
Rafael Espindola
b57f3b4cc5 Merge redundant loops. NFC.
llvm-svn: 238471
2015-05-28 20:00:13 +00:00
Duncan P. N. Exon Smith
9ba8af76a1 AsmPrinter: Stop exposing underlying DIE children list, NFC
Update `DIE` API to hide the implementation of `DIE::Children` so we can
swap it out.

llvm-svn: 238468
2015-05-28 19:56:34 +00:00
Rafael Espindola
2fdca8e81e Simplify LastLocalSymbolIndex computation. NFC.
llvm-svn: 238465
2015-05-28 19:46:36 +00:00
Rafael Espindola
341a6b15d6 Use range loops. NFC.
llvm-svn: 238463
2015-05-28 19:43:20 +00:00
Pete Cooper
e64f416a13 Add BranchProbabilityInfo::releaseMemory to clear the Weights field.
BranchProbabilityInfo was leaking 3MB of memory when running 'opt -O2 verify-uselistorder.lto.bc'.  This was due to the Weights member not being cleared once the pass is no longer needed.

This adds the releaseMemory override to clear that field.  The other fields are cleared at the end of runOnFunction so can stay there.

llvm-svn: 238462
2015-05-28 19:43:06 +00:00
Rafael Espindola
bb70fe86e9 Remove temporary FileSymbolData. NFC.
llvm-svn: 238461
2015-05-28 19:29:15 +00:00
Duncan P. N. Exon Smith
0c791a688f AsmPrinter: Rename begin_values() => values_begin(), NFC
llvm-svn: 238456
2015-05-28 18:55:38 +00:00
Colin LeMahieu
b63fdb630a [llvm] Parameterizing the output stream for dumpbytes and outputting directly to stream.
llvm-svn: 238453
2015-05-28 18:39:50 +00:00
David Majnemer
514ab73614 [InstCombine] Fold IntToPtr and PtrToInt into preceding loads.
Currently we only fold a BitCast into a Load when the BitCast is its
only user.

Do the same for any no-op cast.

Differential Revision: http://reviews.llvm.org/D9152

llvm-svn: 238452
2015-05-28 18:39:17 +00:00
Chad Rosier
74573e63bc Reuse Loc variable. NFC.
llvm-svn: 238448
2015-05-28 18:18:21 +00:00
Rafael Espindola
cea3662074 Use range loops for accessing file names. NFC.
llvm-svn: 238446
2015-05-28 18:03:20 +00:00
Rafael Espindola
7a39767414 Merge computeSymbolTable and writeSymbolTable.
For now this just saves a few loops, but it will allow more simplifications
in the future.

llvm-svn: 238444
2015-05-28 17:54:01 +00:00
Kai Nacke
59a31f2f53 [mips] Add new format for dmtc2/dmfc2 for Octeon CPUs.
Octeon CPUs use dmtc2 rt,imm16 and dmfcp2 rt,imm16 for the crypto coprocessor.
E.g. dmtc2 rt,0x4057 starts calculation of sha-1.

I had to introduce a new deconding namespace to avoid a decoding conflict.

Reviewed By: dsanders

Differential Revision: http://reviews.llvm.org/D10083

llvm-svn: 238439
2015-05-28 16:23:16 +00:00
Ed Maste
33815a24e8 DebugInfo: .debug_line DWARF64 support
This adds support for the 64-bit DWARF format, but is still limited to
less than 4GB of debug data by the DataExtractor class.  Some versions
of the GNU MIPS toolchain generate 64-Bit DWARF even though it isn't
actually necessary.

Differential Revision: http://reviews.llvm.org/D1988

llvm-svn: 238434
2015-05-28 15:38:17 +00:00
Rafael Espindola
bde36f1a15 Don't create an unused _GLOBAL_OFFSET_TABLE_.
This was a bug for bug compatibility with gas that is completely unnecessary.
If a _GLOBAL_OFFSET_TABLE_ symbol is used, it will already be created by
the time we get to the ELF writer.

llvm-svn: 238432
2015-05-28 15:20:00 +00:00
Renato Golin
321a55f6a3 [ARMTargetParser] Adding sub-arch information for Clang. NFC
llvm-svn: 238429
2015-05-28 15:05:18 +00:00
Daniel Sanders
bb2be43a35 [mips] Make TTypeEncoding indirect to allow .eh_frame to be read-only.
Summary:
Following on from r209907 which made personality encodings indirect, do the
same for TType encodings. This fixes the case where a try/catch block needs
to generate references to, for example, std::exception in the
.gcc_except_table.

Reviewers: petarj

Reviewed By: petarj

Subscribers: srhines, joerg, tberghammer, llvm-commits

Differential Revision: http://reviews.llvm.org/D9669

llvm-svn: 238427
2015-05-28 14:52:15 +00:00
Petar Jovanovic
e26f67279e [Mips64] Add support for MCJIT for MIPS64r2 and MIPS64r6
Add support for resolving MIPS64r2 and MIPS64r6 relocations in MCJIT.

Patch by Vladimir Radosavljevic.

Differential Revision: http://reviews.llvm.org/D9667

llvm-svn: 238424
2015-05-28 13:48:41 +00:00
Benjamin Kramer
c6e6778781 [AsmPrinter] Destroy allocated DIEAbbrevs on teardown.
DIEAbbrev contains a SmallVector that can leak for overly large abbrevs. They
used to be owned by the DIE, but after the recent refactoring DWARFFile
allocates its own abbrevs.

Leak found by asan.

llvm-svn: 238418
2015-05-28 12:55:43 +00:00
Renato Golin
0cdb09cf96 [ARMTargetParser] Adding a few more CPUs for Clang CPU detection. NFC.
llvm-svn: 238415
2015-05-28 12:10:37 +00:00
Benjamin Kramer
2f0759b0f8 [MC] Replace custom string join function with the one from StringExtras.
NFC.

llvm-svn: 238414
2015-05-28 11:45:32 +00:00
Benjamin Kramer
5a56e44e39 Don't call utostr in Twine/raw_ostream contexts.
Creating temporary std::strings there is unnecessary.

llvm-svn: 238412
2015-05-28 11:24:24 +00:00
Renato Golin
b027528ed0 Fix comments in ARMTargetParser. NFC.
llvm-svn: 238404
2015-05-28 08:59:03 +00:00
Yury Gribov
87f3324fce [ASan] Fix previous commit. Patch by Max Ostapenko!
llvm-svn: 238403
2015-05-28 08:03:28 +00:00