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

113870 Commits

Author SHA1 Message Date
Sanjoy Das
421baaa45f Fix bug 22641
The bug was a result of getPreStartForExtend interpreting nsw/nuw
flags on an add recurrence more strongly than is legal.  {S,+,X}<nsw>
implies S+X is nsw only if the backedge of the loop is taken at least
once.

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

llvm-svn: 230275
2015-02-23 22:55:13 +00:00
Rafael Espindola
3792f3c232 Fix invalid cast.
Fixes PR22525.

Patch by Ben Longbons with testcase by me.

llvm-svn: 230271
2015-02-23 21:51:06 +00:00
David Majnemer
b6ac6360c4 X86: Use a smaller 'mov' instruction for stack probe calls
Prologue emission, in some cases, requires calls to a stack probe helper
function.  The amount of stack to probe is passed as a register
argument in the Win64 ABI but the instruction sequence used is
pessimistic: it assumes that the number of bytes to probe is greater
than 4 GB.

Instead, select a more appropriate opcode depending on the number of
bytes we are going to probe.

llvm-svn: 230270
2015-02-23 21:50:30 +00:00
David Majnemer
5bffee412d X86: Use 'mov' instead of 'lea' in Win64 SEH prologues when possible
'mov' and 'lea' are equivalent when the displacement applied with 'lea'
is zero.  However, 'mov' should encode smaller.

llvm-svn: 230269
2015-02-23 21:50:27 +00:00
David Majnemer
672ed0abe3 X86: Explain why we cannot use a 'mov' in a Win64 epilogue
llvm-svn: 230268
2015-02-23 21:50:25 +00:00
David Majnemer
9bb032eee6 X86: Consistently use 'epilogue' instead of 'epilog'
llvm-svn: 230267
2015-02-23 21:50:18 +00:00
Sanjay Patel
28567e334a add newline for easier reading; NFC
llvm-svn: 230265
2015-02-23 21:32:09 +00:00
Bruno Cardoso Lopes
d2335534c5 [AsmPrinter] Access pointers to globals via pcrel GOT entries
Front-ends could use global unnamed_addr to hold pointers to other
symbols, like @gotequivalent below:

@foo = global i32 42
@gotequivalent = private unnamed_addr constant i32* @foo

@delta = global i32 trunc (i64 sub (i64 ptrtoint (i32** @gotequivalent to i64),
                                    i64 ptrtoint (i32* @delta to i64))
                           to i32)

The global @delta holds a data "PC"-relative offset to @gotequivalent,
an unnamed pointer to @foo. The darwin/x86-64 assembly output for this follows:

 .globl  _foo
_foo:
 .long   42

 .globl  _gotequivalent
_gotequivalent:
 .quad   _foo

 .globl  _delta
_delta:
 .long   _gotequivalent-_delta

Since unnamed_addr indicates that the address is not significant, only
the content, we can optimize the case above by replacing pc-relative
accesses to "GOT equivalent" globals, by a PC relative access to the GOT
entry of the final symbol instead. Therefore, "delta" can contain a pc
relative relocation to foo's GOT entry and we avoid the emission of
"gotequivalent", yielding the assembly code below:

 .globl  _foo
_foo:
 .long   42

 .globl  _delta
_delta:
 .long   _foo@GOTPCREL+4

There are a couple of advantages of doing this: (1) Front-ends that need
to emit a great deal of data to store pointers to external symbols could
save space by not emitting such "got equivalent" globals and (2) IR
constructs combined with this opt opens a way to represent GOT pcrel
relocations by using the LLVM IR, which is something we previously had
no way to express.

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

rdar://problem/18534217

llvm-svn: 230264
2015-02-23 21:26:18 +00:00
Justin Bogner
40b338033b InstrProf: Teach llvm-cov to show the max count instead of the last
When multiple regions start on the same line, llvm-cov was just
showing the count of the last one as the line count. This can be
confusing and misleading for things like one-liner loops, where the
count at the end isn't very interesting, or even "if" statements with
an opening brace at the end of the line.

Instead, use the maximum of all of the region start counts.

llvm-svn: 230263
2015-02-23 21:21:34 +00:00
Andrew Kaylor
e73260c648 Removing unused private field.
llvm-svn: 230259
2015-02-23 21:03:30 +00:00
Bruno Cardoso Lopes
a8c6f58e91 [X86][MMX] Fix test to reflect current codegen
This test failed in several buildbots, a bit unclear how that happen
since this was the previous behavior before r230248.

llvm-svn: 230258
2015-02-23 20:57:46 +00:00
Andrew Kaylor
8eb14460aa Second attempt to fix WinEHCatchDirector build failures.
llvm-svn: 230257
2015-02-23 20:44:34 +00:00
Andrew Kaylor
695cbcb2a1 Attempting to fix WinEHCatchDirector destructor related build failures.
llvm-svn: 230252
2015-02-23 20:19:15 +00:00
Andrew Kaylor
a496164a47 Adding test for Windows EH frame variable remapping.
llvm-svn: 230250
2015-02-23 20:04:51 +00:00
Andrew Kaylor
4e424eb088 Remap frame variables for native Windows exception handling.
Differential Revision: http://reviews.llvm.org/D7770

llvm-svn: 230249
2015-02-23 20:01:56 +00:00
Bruno Cardoso Lopes
390bb4572c Revert "[X86][MMX] Add MMX instructions to foldable tables"
This reverts commit r230226 since it breaks win buildbots.

llvm-svn: 230248
2015-02-23 19:53:37 +00:00
Chad Rosier
96f24682d4 Revert "Revert "Raising minimum required CMake version to 2.8.12.2.""
This reverts commit r230240, which was an accidental commit.

llvm-svn: 230246
2015-02-23 19:34:04 +00:00
Eric Christopher
673f20f883 Rewrite the global merge pass to be subprogram agnostic for now.
It was previously using the subtarget to get values for the global
offset without actually checking each function as it was generating
code. Go ahead and solidify the current behavior and make the
existing FIXMEs more prominent.

As a note the ARM backend previously had a thumb1 and non-thumb1
set of defaults. Only the former was tested so I've changed the
behavior to only use that for now.

llvm-svn: 230245
2015-02-23 19:28:45 +00:00
Chad Rosier
a95dc74f57 Prevent hoisting fmul from THEN/ELSE to IF if there is fmsub/fmadd opportunity.
This patch adds the isProfitableToHoist API.  For AArch64, we want to prevent a
fmul from being hoisted in cases where it is more profitable to form a
fmsub/fmadd.

Phabricator Review: http://reviews.llvm.org/D7299
Patch by Lawrence Hu <lawrence@codeaurora.org>

llvm-svn: 230241
2015-02-23 19:15:16 +00:00
Chad Rosier
5f625fb96e Revert "Raising minimum required CMake version to 2.8.12.2."
This reverts commit 247aed4710e8befde76da42b27313661dea7cf66.

llvm-svn: 230240
2015-02-23 19:15:08 +00:00
Reid Kleckner
f0735a01d1 cmake: Don't do the libstdc++ version check when clang simulates MSVC
If we're using clang-cl, that's a pretty good indication that we're
going to use MSVC's STL.

This simplifies the clang-cl ninja self-host configuration down to:
CC=clang-cl CXX=clang-cl cmake .. -GNinja

Modified version of zturner's patch:
Differential Revision: http://reviews.llvm.org/D7824

llvm-svn: 230239
2015-02-23 19:07:25 +00:00
Mehdi Amini
1b3cca0d56 InstSimplify: simplify 0 / X if nnan and nsz
From: Fiona Glaser <fglaser@apple.com>
llvm-svn: 230238
2015-02-23 18:30:25 +00:00
Daniel Sanders
0eca0162a3 [mips] Honour -mno-odd-spreg for vector insert/extract when MSA is enabled.
Summary:
-mno-odd-spreg prohibits the use of odd-numbered single-precision floating
point registers. However, vector insert/extract was still using them when
manipulating the subregisters of an MSA register. Fixed this by ensuring
that insertion/extraction is only performed on even-numbered vector
registers when -mno-odd-spreg is given.

Reviewers: vmedic, sstankovic

Reviewed By: sstankovic

Subscribers: llvm-commits

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

llvm-svn: 230235
2015-02-23 17:22:16 +00:00
Bob Wilson
4d72fc7a63 Fix incorrect immediate size for AddrModeT2_i8s4 in rewriteT2FrameIndex.
The natural way to handle this addressing mode would be to say that it has
8 bits and gets scaled by 4, but since the MC layer is expecting the scaling
to be already reflected in the immediate value, we have been setting the
Scale to 1. That's fine, but then NumBits needs to be adjusted to reflect
the effective increase in the range of the immediate. That adjustment was
missing.

The consequence is that the register scavenger can fail.
The estimateRSStackSizeLimit() function in ARMFrameLowering.cpp correctly
assumes that the AddrModeT2_i8s4 address mode can handle scaled offsets up to
1020. Under just the right circumstances, we fail to reserve space for the
scavenger because it thinks that nothing will be needed. However, the overly
pessimistic behavior in rewriteT2FrameIndex causes some frame indexes to be
out of range and require scavenged registers, and so the scavenger asserts.

Unfortunately I have not been able to come up with a testcase for this. I
can only reproduce it on an internal branch where the frame layout and
register allocation is slightly different than trunk. We really need a
way to serialize MachineInstr-level IR to write reasonable tests for things
like this.

rdar://problem/19909005

llvm-svn: 230233
2015-02-23 16:57:19 +00:00
Benjamin Kramer
5633d420b2 Sync the __builtin_expects for our 3 quadratically probed hash table implementations.
This assumes that
  a) finding the bucket containing the value is LIKELY
  b) finding an empty bucket is LIKELY
  c) growing the table is UNLIKELY

I also switched the a) and b) cases for SmallPtrSet as we seem to use
the set mostly more for insertion than for checking existence.

In a simple benchmark consisting of 2^21 insertions of 2^20 unique
pointers into a DenseMap or SmallPtrSet a few percent speedup on average,
but nothing statistically significant.

llvm-svn: 230232
2015-02-23 16:41:36 +00:00
Bruno Cardoso Lopes
01a01f5b4a [X86] Add specific mtriple in order to appease builbots
llvm-svn: 230229
2015-02-23 15:33:40 +00:00
Bruno Cardoso Lopes
ae9a9b4601 [X86][MMX] Add MMX instructions to foldable tables
Teach the peephole optimizer to work with MMX instructions by adding
entries into the foldable tables. This covers folding opportunities not
handled during isel.

llvm-svn: 230226
2015-02-23 15:23:22 +00:00
Bruno Cardoso Lopes
8fe8621194 [X86][MMX] Support folding loads in psll, psrl and psra intrinsics
llvm-svn: 230225
2015-02-23 15:23:14 +00:00
Bruno Cardoso Lopes
8b65bbca30 [X86][MMX] Add tests for pslli, psrli and psrai intrinsics
Add tests to cover the RR form of the pslli, psrli and psrai intrinsics.
In the next commit, the loads are going to be folded and the
instructions use the RM form.

llvm-svn: 230224
2015-02-23 15:23:06 +00:00
Elena Demikhovsky
b15d81ba19 AVX-512: recommitted 229837 + bugfix + test
llvm-svn: 230223
2015-02-23 15:12:31 +00:00
Elena Demikhovsky
b180c77ca9 restructured X86 scalar unary operation templates
I made the templates general, no need to define pattern separately for each instruction/intrinsic.
Now only need to add r_Int pattern for AVX.

llvm-svn: 230221
2015-02-23 14:14:02 +00:00
Benjamin Kramer
05393bfc78 [llvm-pdbdump] Remove unused variables.
llvm-svn: 230216
2015-02-23 11:33:54 +00:00
NAKAMURA Takumi
4edf8a29e9 Orc/JITSymbol.h requires not "Compiler.h" but "DataTypes.h" due to uint64_t.
llvm-svn: 230214
2015-02-23 11:12:52 +00:00
David Majnemer
c9335a127a AsmParser: Check ConstantExpr insertvalue operands for type correctness
llvm-svn: 230206
2015-02-23 07:13:52 +00:00
Zachary Turner
45c9c54cc7 [llvm-pdbdump] Fix builders again.
llvm-svn: 230205
2015-02-23 06:13:27 +00:00
Zachary Turner
bf3f275325 [llvm-pdbdump] Very minor code cleanup.
This just removes some dead enums as well as some debug flushes
of stdout.

llvm-svn: 230204
2015-02-23 05:59:14 +00:00
Zachary Turner
b7d9bc75c5 [llvm-pdbdump] Add an option to dump full class definitions.
This adds the --class-definitions flag.  If specified, when dumping
types, instead of "class Foo" you will see the full class definition,
with member functions, constructors, access specifiers.

NOTE: Using this option can be very slow, as generating a full class
definition requires accessing many different parts of the PDB.

llvm-svn: 230203
2015-02-23 05:58:34 +00:00
Lang Hames
9d40391a59 [Orc][Kaleidoscope] Tidy up the lazy_irgen tutorial, touch up a couple of
comments in the fully_lazy tutorial to minimize the diff between the two.

llvm-svn: 230202
2015-02-23 04:45:05 +00:00
Lang Hames
693a73cca4 [Orc][Kaleidoscope] Remove dead AST map in SessionContext.
llvm-svn: 230201
2015-02-23 04:34:43 +00:00
Nico Weber
c712fac3f6 Try to fix reST markup for an external link.
llvm-svn: 230200
2015-02-23 03:31:29 +00:00
David Blaikie
55b35d6f45 Fix Makefile build
llvm-svn: 230197
2015-02-23 00:53:35 +00:00
David Blaikie
4639d7a7ec [orc] Add a trivial unit test to get the ball rolling
I made my best guess at the Makefile, since I don't have a make build.

I'm not sure if it should be valid to add an empty list of things, but
it seemed the sort of degenerate case.

llvm-svn: 230196
2015-02-23 00:36:25 +00:00
David Majnemer
5ce7bb3582 AsmParser: Call instructions can't have an alignment
llvm-svn: 230193
2015-02-23 00:01:32 +00:00
David Majnemer
fe7d978682 AsmParser: Check ConstantExpr GEP operands for validity
llvm-svn: 230188
2015-02-22 23:14:52 +00:00
David Majnemer
dd1c970b28 llvm-pdbdump: Fix gcc/clang build
llvm-svn: 230187
2015-02-22 22:33:57 +00:00
Zachary Turner
79336d3758 [llvm-pdbdump] Fix a few compilation failures.
llvm-svn: 230186
2015-02-22 22:20:26 +00:00
David Blaikie
186b59b707 Add missing header
llvm-svn: 230185
2015-02-22 22:18:55 +00:00
Zachary Turner
1a7a66bda7 [llvm-pdbdump] Rewrite dumper using visitor pattern.
This increases the flexibility of how to dump different
symbol types -- necessary for context-sensitive formatting of
symbol types -- and also improves the modularity by allowing
the dumping to be implemented in the actual dumper, as opposed
to in the PDB library.

llvm-svn: 230184
2015-02-22 22:03:38 +00:00
Zachary Turner
a0f04e851c [llvm-pdbdump] Simplify options and output.
This removes a wealth of options, and instead now only provides
three options.  -symbols, -types, and -compilands.  This greatly
simplifies use of the tool, and makes it easier to understand
what you're going to see when you run the tool.

llvm-svn: 230182
2015-02-22 21:45:38 +00:00
David Blaikie
7420353cf2 Roll condition into an assert then wrap it 'ifndef NDEBUG' to protect from the inevitable "unused variable" warning in a non-asserts build.
llvm-svn: 230181
2015-02-22 20:58:38 +00:00