1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

93729 Commits

Author SHA1 Message Date
Rafael Espindola
e96bf1b1a4 Add back code for supporting old mingw versions. Should bring the bots back.
llvm-svn: 186096
2013-07-11 16:11:21 +00:00
Benjamin Kramer
2880b5c20b Don't use a potentially expensive shift if all we want is one set bit.
No functionality change.

llvm-svn: 186095
2013-07-11 16:05:50 +00:00
Rafael Espindola
ee3ac4e4ae InsertBefore is the same as AddBefore. Delete it.
llvm-svn: 186094
2013-07-11 15:54:53 +00:00
Rafael Espindola
b0d11eb23c Looks like some versions of mingw don't have errno_t. Use int.
llvm-svn: 186092
2013-07-11 15:47:04 +00:00
Benjamin Kramer
5d718d1737 Use move semantics if possible to construct ConstantRanges.
Arithmetic on ConstantRanges creates a lot of large temporary APInts that
benefit from move semantics.

llvm-svn: 186091
2013-07-11 15:37:27 +00:00
Rafael Espindola
f1b5484cf9 Fix a FIXME about the format and add a test.
While at it, use strftime on Unix too and use the thread safe versions
of localtime.

llvm-svn: 186090
2013-07-11 15:35:23 +00:00
Arnold Schwaighofer
a8667081e1 LoopVectorize: Vectorize all accesses in address space zero with unit stride
We can vectorize them because in the case where we wrap in the address space the
unvectorized code would have had to access a pointer value of zero which is
undefined behavior in address space zero according to the LLVM IR semantics.
(Thank you Duncan, for pointing this out to me).

Fixes PR16592.

llvm-svn: 186088
2013-07-11 15:21:55 +00:00
Rafael Espindola
f9f9d1648c Merge these tests.
llvm-svn: 186084
2013-07-11 13:44:10 +00:00
Rafael Espindola
948310c9c0 Use a more unique name to avoid conflicting with directory.ll tests when running
in parallel.

llvm-svn: 186083
2013-07-11 13:31:38 +00:00
Rafael Espindola
d7f85dd49b Add a test for llvm-ar's 'd' operation.
llvm-svn: 186082
2013-07-11 13:24:27 +00:00
Rafael Espindola
3395d4e371 Add tests for the 'x' operation.
llvm-svn: 186081
2013-07-11 13:13:09 +00:00
Rafael Espindola
5033dd7f7f Remove the 'N' modifier from llvm-ar.
* It is not present on OS X.
* It is untested.
* It is not needed for using ar in a build system.

llvm-svn: 186080
2013-07-11 13:03:27 +00:00
Rafael Espindola
0cf59a462a Delete dead code.
llvm-svn: 186079
2013-07-11 12:54:11 +00:00
Rafael Espindola
6654d0be49 Remove support for truncating names in archives.
* All systems we support have some form of long name support.
* The options has different names and semantics in different implementations
  ('f' on gnu, 'T' on OS X), which makes it unlikely it is normally used on
  build systems.
* It was completely untested.

llvm-svn: 186078
2013-07-11 12:38:02 +00:00
Rafael Espindola
d80d5d52ec Sync llvm-ar's help string with the options it supports.
llvm-svn: 186076
2013-07-11 12:28:36 +00:00
Benjamin Kramer
e161438f33 Reduce the number of indirections in the attributes implementation.
- Coallocate entires for AttributeSetImpls and Nodes after the class itself.
- Remove mutable iterators from immutable classes.
- Remove unused context field from AttributeImpl.
- Derive Enum/Align/String attribute implementations from AttributeImpl instead
  of having a whole new inheritance tree for them.
- Derive AlignAttributeImpl from EnumAttributeImpl.

llvm-svn: 186075
2013-07-11 12:13:16 +00:00
Richard Sandiford
f53d62a725 [SystemZ] Add testcase missing from r186073
llvm-svn: 186074
2013-07-11 09:10:38 +00:00
Richard Sandiford
e5c5a78828 [SystemZ] Use zeroing form of RISBG for shift-and-AND sequences
Extend r186072 to handle shifts and ANDs.

llvm-svn: 186073
2013-07-11 09:10:09 +00:00
Richard Sandiford
fa42560424 [SystemZ] Use zeroing form of RISBG for some AND sequences
RISBG can handle some ANDs for which no AND IMMEDIATE exists.
It also acts as a three-operand AND for some cases where an
AND IMMEDIATE could be used instead.

It might be worth adding a pass to replace RISBG with AND IMMEDIATE
in cases where the register operands end up being the same and where
AND IMMEDIATE is smaller.

llvm-svn: 186072
2013-07-11 08:59:12 +00:00
Richard Sandiford
c27e0de402 [SystemZ] Allow 8-bit operands to RISBG
RISBG has three 8-bit operands (I3, I4 and I5).  I'd originally
restricted all three to 6 bits, since that's the only range we intended
to use at the time.  However, the top bit of I4 acts as a "zero" flag for
RISBG, while the top bit of I3 acts as a "test" flag for RNSBG & co.
This patch therefore allows them to have the full 8-bit range.
I've left the fifth operand as a 6-bit value for now since the
upper 2 bits have no defined meaning.

llvm-svn: 186070
2013-07-11 08:37:13 +00:00
Duncan Sands
447d97b223 TryToSimplifyUncondBranchFromEmptyBlock was checking that any common
predecessors of the two blocks it is attempting to merge supply the
same incoming values to any phi in the successor block.  This change
allows merging in the case where there is one or more incoming values
that are undef.  The undef values are rewritten to match the non-undef
value that flows from the other edge.  Patch by Mark Lacey.

llvm-svn: 186069
2013-07-11 08:28:20 +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
Craig Topper
b03fdf14f4 Fix indentation. No functional change.
llvm-svn: 186065
2013-07-11 05:39:44 +00:00
Nadav Rotem
965af9cb85 Fix a warning.
llvm-svn: 186064
2013-07-11 05:39:02 +00:00
Nadav Rotem
ee3b8a1b49 Consolidate more lit tests.
llvm-svn: 186063
2013-07-11 05:15:11 +00:00
Nadav Rotem
7bfc1b28ea Consolidate some of the lit tests.
llvm-svn: 186062
2013-07-11 05:11:33 +00:00
Nadav Rotem
b4313e229a Consolidate some of the lit tests.
llvm-svn: 186060
2013-07-11 05:01:50 +00:00
Nadav Rotem
8e1d89128f SLPVectorizer: refactor the code that places extracts. Place the code that decides where to put extracts in the build-tree phase. This allows us to take the cost of the extracts into account.
llvm-svn: 186058
2013-07-11 04:54:05 +00:00
Michael Gottesman
722cf9dc9b Teach TailRecursionElimination to handle certain cases of nocapture escaping allocas.
Without the changes introduced into this patch, if TRE saw any allocas at all,
TRE would not perform TRE *or* mark callsites with the tail marker.

Because TRE runs after mem2reg, this inadequacy is not a death sentence. But
given a callsite A without escaping alloca argument, A may not be able to have
the tail marker placed on it due to a separate callsite B having a write-back
parameter passed in via an argument with the nocapture attribute.

Assume that B is the only other callsite besides A and B only has nocapture
escaping alloca arguments (*NOTE* B may have other arguments that are not passed
allocas). In this case not marking A with the tail marker is unnecessarily
conservative since:

  1. By assumption A has no escaping alloca arguments itself so it can not
     access the caller's stack via its arguments.

  2. Since all of B's escaping alloca arguments are passed as parameters with
     the nocapture attribute, we know that B does not stash said escaping
     allocas in a manner that outlives B itself and thus could be accessed
     indirectly by A.

With the changes introduced by this patch:

  1. If we see any escaping allocas passed as a capturing argument, we do
     nothing and bail early.

  2. If we do not see any escaping allocas passed as captured arguments but we
     do see escaping allocas passed as nocapture arguments:

       i. We do not perform TRE to avoid PR962 since the code generator produces
          significantly worse code for the dynamic allocas that would be created
          by the TRE algorithm.

       ii. If we do not return twice, mark call sites without escaping allocas
           with the tail marker. *NOTE* This excludes functions with escaping
           nocapture allocas.

  3. If we do not see any escaping allocas at all (whether captured or not):

       i. If we do not have usage of setjmp, mark all callsites with the tail
          marker.

       ii. If there are no dynamic/variable sized allocas in the function,
           attempt to perform TRE on all callsites in the function.

Based off of a patch by Nick Lewycky.

rdar://14324281.

llvm-svn: 186057
2013-07-11 04:40:01 +00:00
Hal Finkel
e4c36bd8fb Move r186044 tests into CodeGen/X86
I had thought that these tests could be target-neutral, but in practice this is
not the case (on some targets, like Hexagon and Darwin), they trigger an assert
(a different assert than the one that r186044 fixes).

llvm-svn: 186051
2013-07-11 01:55:55 +00:00
Hal Finkel
a874b8226d Set REQUIRES shell on the test cases for r186044
Trying to fix the i686-mingw32 build.

llvm-svn: 186046
2013-07-10 23:25:03 +00:00
Hal Finkel
082c25c501 XFAIL the test cases for r186044 on Hexagon
For some reason, the Hexagon backend does not reject these invalid static
initializer expressions, but instead crashes in AsmPrinter::EmitGlobalConstant.

llvm-svn: 186045
2013-07-10 23:11:14 +00:00
Hal Finkel
6d75832312 Don't assert if we can't constant fold extract/insertvalue
A non-constant-foldable static initializer expression containing insertvalue or
extractvalue had been causing an assert:

  Constants.cpp:1971: Assertion `FC && "ExtractValue constant expr couldn't be
                                 folded!"' failed.

Now we report a more-sensible "Unsupported expression in static initializer"
error instead.

Fixes PR15417.

llvm-svn: 186044
2013-07-10 22:51:01 +00:00
Rafael Espindola
a639b1d8e8 Remove this test for now.
It is not reliable to depend on the output of llvm_unreachable. The original
change will have proper tests when llvm-ar moves to lib/Object (soon).

llvm-svn: 186043
2013-07-10 22:15:29 +00:00
Hans Wennborg
638eb9dfef CommandLine.rst: remove tiny bit of bad mark-up
llvm-svn: 186042
2013-07-10 22:09:22 +00:00
Rafael Espindola
a18221a110 Find the symbol table on archives created on OS X.
llvm-svn: 186041
2013-07-10 22:07:59 +00:00
Rafael Espindola
1974e1f8d7 Move tests from test/Archive to test/Object.
There is no lib/Archive anymore and some archive tests were in test/Archive and
others in test/Object. Since archive is just one of the formats supported by
lib/Object, test/Object is probably the best location.

llvm-svn: 186038
2013-07-10 21:47:16 +00:00
Adrian Prantl
4150690228 Add a comment.
llvm-svn: 186035
2013-07-10 21:08:02 +00:00
Tim Northover
363f97f683 Put ELF COMDAT relocations into the relevant COMDAT group.
Patch from Игорь Пашев  (I do hope we support utf-8 commit messages; I
also hope he'll forgive me for transliterating it as Igor Pashev in
case things go horribly wrong).

llvm-svn: 186034
2013-07-10 20:58:17 +00:00
Stephen Lin
1686353ec3 Remove trailing whitespac
llvm-svn: 186032
2013-07-10 20:47:39 +00:00
Adrian Prantl
19b226f303 Add a testcase for r186014.
llvm-svn: 186031
2013-07-10 20:43:29 +00:00
Rafael Espindola
912eeb2ecb Don't crash in 'llvm -s' when an archive has no symtab.
llvm-svn: 186029
2013-07-10 20:14:22 +00:00
Reid Kleckner
6beed3b08d Fix %t typo in Ocaml bindings test.
llvm-svn: 186027
2013-07-10 18:55:06 +00:00
Michael Gottesman
55fe2fe0ba [objc-arc] Changed 'mode: c++' => 'C++' at Nick Lewycky's suggestion. Also removed unnecessary mode: c++ lines from .cpp files.
llvm-svn: 186026
2013-07-10 18:49:00 +00:00
Michael Gottesman
ebc9c4bf07 Changed "mode: c++" => "C++" at the suggestion of Nick Lewycky.
llvm-svn: 186025
2013-07-10 18:40:49 +00:00
Benjamin Kramer
60ca836ce0 Update doxygen comment to match renamed parameters.
Found by -Wdocumentation.

llvm-svn: 186021
2013-07-10 18:01:16 +00:00
Rafael Espindola
33a904329a MemoryBuffer::getFile handles zero sized files, no need to duplicate the test.
llvm-svn: 186018
2013-07-10 17:30:39 +00:00
Aaron Ballman
e3eec3e18c Replacing an empty switch with its moral equivalent. No functional changes intended.
llvm-svn: 186017
2013-07-10 17:19:22 +00:00
Rafael Espindola
af2c19d481 Use status to implement file_size.
The status function is already using a syscall that returns the file size.
Remember it and implement file_size as a simple wrapper.

No functionally change, but clients that already use status now can avoid
calling file_size.

llvm-svn: 186016
2013-07-10 17:16:40 +00:00