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

15190 Commits

Author SHA1 Message Date
Michael Gottesman
062dd20303 [stackprotector] Refactored ssp prologue creation code into its own helper function.
No functionality change.

rdar://13935163

llvm-svn: 186868
2013-07-22 20:44:11 +00:00
Bill Wendling
63482ebdd5 Recommit r186217 with testcase fix:
Use the function attributes to pass along the stack protector buffer size.

 Now that we have robust function attributes, don't use a command line option to
 specify the stack protecto buffer size.

llvm-svn: 186863
2013-07-22 20:15:21 +00:00
Eric Christopher
3749516bec Formatting.
llvm-svn: 186851
2013-07-22 18:26:15 +00:00
Michael Gottesman
fb309e1237 Added missing - in the header of PrologEpilogInserter.h so that editors properly realize it is a c++ header and not a c header.
llvm-svn: 186801
2013-07-22 00:52:55 +00:00
Alexey Samsonov
5ab22e39d5 Fix uninitialized memory read found by MemorySanitizer: always set output parameter of ConvergingScheduler::SchedBoundary::getOtherResourceCount
llvm-svn: 186658
2013-07-19 08:55:18 +00:00
Andrew Trick
7e1d12334a MI Sched: Update the way resources are tracked so the current heuristics make more sense.
llvm-svn: 186632
2013-07-19 00:20:07 +00:00
Michael Gottesman
f8e87b6288 Add -*- C++ -*- to InstrEmitter.h.
llvm-svn: 186527
2013-07-17 18:53:29 +00:00
Craig Topper
c6d133943e Make constant string pointer into an array to remove a pointer lookup for every access.
llvm-svn: 186482
2013-07-17 03:11:32 +00:00
Manman Ren
929ebf85f2 Add getModuleFlag(StringRef Key) to query a module flag given Key.
No functionality change.

llvm-svn: 186470
2013-07-16 23:21:16 +00:00
Rafael Espindola
2a9326a78f Add a wrapper for open.
This centralizes the handling of O_BINARY and opens the way for hiding more
differences (like how open behaves with directories).

llvm-svn: 186447
2013-07-16 19:44:17 +00:00
Jakob Stoklund Olesen
e0d15d47e1 Remove floats from live range splitting costs.
These floats all represented block frequencies anyway, so just use the
BlockFrequency class directly.

Some floating point computations remain in tryLocalSplit(). They are
estimating spill weights which are still floats.

llvm-svn: 186435
2013-07-16 18:26:18 +00:00
Jakob Stoklund Olesen
0d3ae14227 Reapply r185393.
Original commit message:

Remove floating point computations from SpillPlacement.cpp.

Patch by Benjamin Kramer!

Use the BlockFrequency class instead of floats in the Hopfield network
computations. This rescales the node Bias field from a [-2;2] float
range to two block frequencies BiasN and BiasP pulling in opposite
directions. This construct has a more predictable behavior when block
frequencies saturate.

The per-node scaling factors are no longer necessary, assuming the block
frequencies around a bundle are consistent.

This patch can cause the register allocator to make different spilling
decisions. The differences should be small.

llvm-svn: 186434
2013-07-16 18:26:15 +00:00
Craig Topper
b8260534f6 Add 'const' qualifiers to static const char* variables.
llvm-svn: 186371
2013-07-16 01:17:10 +00:00
Manman Ren
19fc512a36 PEI: Support for non-zero SPAdj at beginning of a basic block.
We can have a FrameSetup in one basic block and the matching FrameDestroy
in a different basic block when we have struct byval. In that case, SPAdj
is not zero at beginning of the basic block.

Modify PEI to correctly set SPAdj at beginning of each basic block using
DFS traversal. We used to assume SPAdj is 0 at beginning of each basic block.

PEI had an assert SPAdjCount || SPAdj == 0.
If we have a Destroy <n> followed by a Setup <m>, PEI will assert failure.
We can add an extra condition to make sure the pairs are matched:
  The pairs start with a FrameSetup.
But since we are doing a much better job in the verifier, this patch removes
the check in PEI.

PR16393

llvm-svn: 186364
2013-07-15 23:47:29 +00:00
Manman Ren
02374de3f6 Machine Verifier: verify FrameSetup and FrameDestroy
1> on every path through the CFG, a FrameSetup <n> is always followed by a
   FrameDestroy <n> and a FrameDestroy is always followed by a FrameSetup.
2> stack adjustments are identical on all CFG edges to a merge point.
3> frame is destroyed at end of a return block.

PR16393

llvm-svn: 186350
2013-07-15 21:26:31 +00:00
Hal Finkel
d34cb3e70c Remove invalid assert in DAGTypeLegalizer::RemapValue
There is a comment at the top of DAGTypeLegalizer::PerformExpensiveChecks
which, in part, says:

  // Note that these invariants may not hold momentarily when processing a node:
  // the node being processed may be put in a map before being marked Processed.

Unfortunately, this assert would be valid only if the above-mentioned invariant
held unconditionally. This was causing llc to assert when, in fact,
everything was fine.

Thanks to Richard Sandiford for investigating this issue!

Fixes PR16562.

llvm-svn: 186338
2013-07-15 18:57:05 +00:00
Craig Topper
642bfedd2e Add 'const' qualifier to some arrays.
llvm-svn: 186312
2013-07-15 08:02:13 +00:00
Eric Christopher
c95ff399e8 Clarify comments.
llvm-svn: 186297
2013-07-14 22:23:54 +00:00
Eric Christopher
a7002e51e3 Collapse temporary variable into call.
llvm-svn: 186295
2013-07-14 21:46:51 +00:00
Tobias Grosser
6e4ee527af Fix build by replacing '>>' with '> >'
llvm-svn: 186276
2013-07-14 06:12:01 +00:00
Craig Topper
58fa7a9b4a Use SmallVectorImpl& instead of SmallVector to avoid repeating small vector size.
llvm-svn: 186274
2013-07-14 04:42:23 +00:00
Craig Topper
5e0aa8a396 Pass SmallVector by const reference instead of by value.
llvm-svn: 186243
2013-07-13 07:43:40 +00:00
Chandler Carruth
c0b3faf509 Revert commit r186217 -- this is breaking bots:
http://lab.llvm.org:8013/builders/clang-x86_64-darwin11-nobootstrap-RAincremental/builds/4328

Original commit log:
  Use the function attributes to pass along the stack protector buffer
  size.

llvm-svn: 186234
2013-07-13 01:00:17 +00:00
Bill Wendling
c4d489b5ee Use the function attributes to pass along the stack protector buffer size.
Now that we have robust function attributes, don't use a command line option to
specify the stack protecto buffer size.

llvm-svn: 186217
2013-07-12 22:25:20 +00:00
Arnold Schwaighofer
b9c37551bc TargetTransformInfo: address calculation parameter for gather/scather
Address calculation for gather/scather in vectorized code can incur a
significant cost making vectorization unbeneficial. Add infrastructure to add
cost.
Tests and cost model for targets will be in follow-up commits.

radar://14351991

llvm-svn: 186187
2013-07-12 19:16:02 +00:00
Manman Ren
12ea263cc7 PEI: refactor replaceFrameIndices(MF) to call replaceFrameIndices(BB).
replaceFrameIndices(MF) will iterate over the BBs and call
replaceFrameIndices(BB). No functionality change.

llvm-svn: 186141
2013-07-12 00:37:01 +00:00
Craig Topper
74e16da8dc Use SmallVectorImpl& instead of SmallVector to avoid repeating small vector size.
llvm-svn: 186098
2013-07-11 16:22:38 +00:00
Hal Finkel
cfe83c42cd Initialize AsmPrinter::MF in the constructor
MF is normally initialized in AsmPrinter::SetupMachineFunction, but if the file
contains only globals (no functions), then we need this to be initialized
because, when encountering an error, lowerConstant() references it.

This should fix the non-deterministic failures of
test/CodeGen/X86/nonconst-static-iv.ll, etc.

llvm-svn: 186068
2013-07-11 06:41:14 +00:00
Hal Finkel
38ec4d9a41 RegScavenger should not exclude undef uses
When computing currently-live registers, the register scavenger excludes undef
uses. As a result, undef uses are ignored when computing the restore points of
registers spilled into the emergency slots. While the register scavenger
normally excludes from consideration, when scavenging, registers used by the
current instruction, we need to not exclude undef uses. Otherwise, we might end
up requiring more emergency spill slots than we have (in the case where the
undef use *is* the currently-spilled register).

Another bug found by llvm-stress.

llvm-svn: 186067
2013-07-11 05:55:57 +00:00
Stephen Lin
1686353ec3 Remove trailing whitespac
llvm-svn: 186032
2013-07-10 20:47:39 +00:00
Adrian Prantl
11505264ce Use the appropriate unsigned int type for the offset.
llvm-svn: 186015
2013-07-10 16:56:52 +00:00
Adrian Prantl
c86bbc1f75 Safeguard DBG_VALUE handling. Unbreaks the ASAN buildbot.
llvm-svn: 186014
2013-07-10 16:56:47 +00:00
Adrian Prantl
99aa5bc65a Un-break the buildbot by tweaking the indirection flag.
Pulled in a testcase from the debuginfo-test suite.

llvm-svn: 185993
2013-07-10 01:53:37 +00:00
Adrian Prantl
e80db7fe3b Document a known limitation of the status quo.
llvm-svn: 185992
2013-07-10 01:53:30 +00:00
Eric Christopher
6e1bb5f12d Fix comment.
llvm-svn: 185984
2013-07-09 23:48:45 +00:00
Adrian Prantl
ed4b284841 Typo.
llvm-svn: 185971
2013-07-09 21:44:06 +00:00
Adrian Prantl
a295f68201 Reapply an improved version of r180816/180817.
Change the informal convention of DBG_VALUE machine instructions so that
we can express a register-indirect address with an offset of 0.
The old convention was that a DBG_VALUE is a register-indirect value if
the offset (operand 1) is nonzero. The new convention is that a DBG_VALUE
is register-indirect if the first operand is a register and the second
operand is an immediate. For plain register values the combination reg,
reg is used. MachineInstrBuilder::BuildMI knows how to build the new
DBG_VALUES.

rdar://problem/13658587

llvm-svn: 185966
2013-07-09 20:28:37 +00:00
Hal Finkel
560c3b2ad4 WidenVecRes_BUILD_VECTOR must use the first operand's type
Because integer BUILD_VECTOR operands may have a larger type than the result's
vector element type, and all operands must have the same type, when widening a
BUILD_VECTOR node by adding UNDEFs, we cannot use the vector element type, but
rather must use the type of the existing operands.

Another bug found by llvm-stress.

llvm-svn: 185960
2013-07-09 18:55:10 +00:00
Stephen Lin
30b326010c AArch64/PowerPC/SystemZ/X86: This patch fixes the interface, usage, and all
in-tree implementations of TargetLoweringBase::isFMAFasterThanMulAndAdd in
order to resolve the following issues with fmuladd (i.e. optional FMA)
intrinsics:

1. On X86(-64) targets, ISD::FMA nodes are formed when lowering fmuladd
intrinsics even if the subtarget does not support FMA instructions, leading
to laughably bad code generation in some situations.

2. On AArch64 targets, ISD::FMA nodes are formed for operations on fp128,
resulting in a call to a software fp128 FMA implementation.

3. On PowerPC targets, FMAs are not generated from fmuladd intrinsics on types
like v2f32, v8f32, v4f64, etc., even though they promote, split, scalarize,
etc. to types that support hardware FMAs.

The function has also been slightly renamed for consistency and to force a
merge/build conflict for any out-of-tree target implementing it. To resolve,
see comments and fixed in-tree examples.

llvm-svn: 185956
2013-07-09 18:16:56 +00:00
Hal Finkel
984c244d8d DAGCombine tryFoldToZero cannot create illegal types after type legalization
When folding sub x, x (and other similar constructs), where x is a vector, the
result is a vector of zeros. After type legalization, make sure that the input
zero elements have a legal type. This type may be larger than the result's
vector element type.

This was another bug found by llvm-stress.

llvm-svn: 185949
2013-07-09 17:02:45 +00:00
Alexander Potapenko
9c55668f5b Revert r185872 - "Stop emitting weak symbols into the "coal" sections"
This patch broke `make check-asan` on Mac, causing ld warnings like the following one:

ld: warning: direct access in __GLOBAL__I_a to global weak symbol
___asan_mapping_scale means the weak symbol cannot be overridden at
runtime. This was likely caused by different translation units being
compiled with different visibility settings.

The resulting test binaries crashed with incorrect ASan warnings.

llvm-svn: 185923
2013-07-09 10:00:16 +00:00
Stephen Lin
bf42692662 Style fixes: remove unnecessary braces for one-statement if blocks, no else after return, etc. No funcionality change.
llvm-svn: 185893
2013-07-09 00:44:49 +00:00
Bill Wendling
f81cb5b9ed Stop emitting weak symbols into the "coal" sections.
The Mach-O linker has been able to support the weak-def bit on any symbol for
quite a while now. The compiler however continued to place these symbols into a
"coal" section, which required the linker to map them back to the base section
name.

Replace the sections like this:

  __TEXT/__textcoal_nt   instead use  __TEXT/__text
  __TEXT/__const_coal    instead use  __TEXT/__const
  __DATA/__datacoal_nt   instead use  __DATA/__data

<rdar://problem/14265330>

llvm-svn: 185872
2013-07-08 21:34:52 +00:00
Eric Christopher
1931de8109 Update comment to avoid mentioning DbgValues which is an instance
variable later in the class.

llvm-svn: 185866
2013-07-08 21:16:18 +00:00
Manman Ren
1da12e6b2b Debug Info: clean up usage of Verify.
No functionality change. It should suffice to check the type of a debug info
metadata, instead of calling Verify.

llvm-svn: 185847
2013-07-08 18:33:29 +00:00
David Blaikie
b236f97d1a DebugInfo: Correct comment & re-format a nearby loop
llvm-svn: 185844
2013-07-08 17:51:28 +00:00
David Blaikie
8fa902a764 DebugInfo: Simplify Address Pool index handling.
Since the pool indexes are necessarily sequential and contiguous, just
insert things in the right place rather than having to sort the sequence
after the fact.

No functionality change.

llvm-svn: 185842
2013-07-08 17:33:10 +00:00
Hal Finkel
caf5dc75de Improve the comment from r185794 (re: PromoteIntRes_BUILD_VECTOR)
In response to Duncan's review, I believe that the original comment was not as
clear as it could be. Hopefully, this is better.

llvm-svn: 185824
2013-07-08 14:40:04 +00:00
Hal Finkel
b21ca286dc Fix PromoteIntRes_BUILD_VECTOR crash with i1 vectors
This fixes a bug (found by llvm-stress) in
DAGTypeLegalizer::PromoteIntRes_BUILD_VECTOR where it assumed that the result
type would always be larger than the original operands. This is not always
true, however, with boolean vectors. For example, promoting a node of type v8i1
(where the operands will be of type i32, the type to which i1 is promoted) will
yield a node with a result vector element type of i16 (and operands of type
i32). As a result, we cannot blindly assume that we can ANY_EXTEND the operands
to the result type.

llvm-svn: 185794
2013-07-08 06:16:58 +00:00
Kai Nacke
94a5be6668 Revert: Emit personality function and Dwarf EH data for Win64 SEH.
llvm-svn: 185788
2013-07-08 04:43:23 +00:00