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

100951 Commits

Author SHA1 Message Date
Matt Arsenault
998df7332f Fix undefined behavior in vector shift tests.
These were all shifting the same amount as the bitwidth.

llvm-svn: 203519
2014-03-11 00:01:41 +00:00
Matt Arsenault
ea5d59f5ac Remove incomplete comment
llvm-svn: 203518
2014-03-11 00:01:37 +00:00
Matt Arsenault
3595b7ee79 Move trivial getter into header.
llvm-svn: 203517
2014-03-11 00:01:34 +00:00
Matt Arsenault
805d9618a9 Use .data() instead of &x[0]
llvm-svn: 203516
2014-03-11 00:01:31 +00:00
Matt Arsenault
5ce0aee456 Fix indentation
llvm-svn: 203515
2014-03-11 00:01:27 +00:00
Matt Arsenault
f90ec08530 Fix non 2-space indentation.
llvm-svn: 203514
2014-03-11 00:01:25 +00:00
Duncan P. N. Exon Smith
2635636165 Module: Don't rename in getOrInsertFunction()
During LTO, user-supplied definitions of C library functions often
exist.  -instcombine uses Module::getOrInsertFunction() to get a handle
on library functions (e.g., @puts, when optimizing @printf).

Previously, Module::getOrInsertFunction() would rename any matching
functions with local linkage, and create a new declaration.  In LTO,
this is the opposite of desired behaviour, as it skips by the
user-supplied version of the library function and creates a new
undefined reference which the linker often cannot resolve.

After some discussing with Rafael on the list, it looks like it's
undesired behaviour.  If a consumer actually *needs* this behaviour, we
should add new API with a more explicit name.

I added two testcases: one specifically for the -instcombine behaviour
and one for the LTO flow.

<rdar://problem/16165191>

llvm-svn: 203513
2014-03-10 23:42:28 +00:00
Raul E. Silvera
9f07f16d94 When analyzing vectors of element type that require legalization,
the legalization cost must be included to get an accurate
estimation of the total cost of the scalarized vector.
The inaccurate cost triggered unprofitable SLP vectorization on
32-bit X86.

Summary:
Include legalization overhead when computing scalarization cost

Reviewers: hfinkel, nadav

CC: chandlerc, rnk, llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2992

llvm-svn: 203509
2014-03-10 22:59:13 +00:00
Diego Novillo
dd37be24ca Use discriminator information in sample profiles.
Summary:
When the sample profiles include discriminator information,
use the discriminator values to distinguish instruction weights
in different basic blocks.

This modifies the BodySamples mapping to map <line, discriminator> pairs
to weights. Instructions on the same line but different blocks, will
use different discriminator values. This, in turn, means that the blocks
may have different weights.

Other changes in this patch:

- Add tests for positive values of line offset, discriminator and samples.
- Change data types from uint32_t to unsigned and int and do additional
  validation.

Reviewers: chandlerc

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2857

llvm-svn: 203508
2014-03-10 22:41:28 +00:00
Manuel Jacob
45087c594c Test commit: Remove trailing whitespace.
llvm-svn: 203502
2014-03-10 22:24:07 +00:00
Mark Lacey
a5ba784a02 Fix a couple typos.
llvm-svn: 203499
2014-03-10 21:59:28 +00:00
Daniel Dunbar
c1356cbd3a [lit] Bump dev version number.
llvm-svn: 203498
2014-03-10 21:58:16 +00:00
Daniel Dunbar
97b49237d9 [lit] Add a README.txt.
- Also, update MANIFEST.in and utils/check-sdist.

llvm-svn: 203497
2014-03-10 21:58:12 +00:00
Daniel Dunbar
1a6b374918 [lit] Add --version option.
llvm-svn: 203496
2014-03-10 21:57:48 +00:00
Sebastian Pop
210ef0c908 fix polly buildbot
llvm-svn: 203492
2014-03-10 21:27:04 +00:00
Justin Bogner
88d0488496 IR: Slightly more verbose error in Verifier
Extend the error message generated by the Verifier when an intrinsic
name does not match the expected mangling to include the expected
name.  Simplifies debugging.

Patch by Philip Reames!

llvm-svn: 203490
2014-03-10 21:22:44 +00:00
Benjamin Kramer
108d24886e MemCpyOpt: When merging memsets also merge the trivial case of two memsets with the same destination.
The testcase is from PR19092, but I think the bug described there is actually a clang issue.

llvm-svn: 203489
2014-03-10 21:05:13 +00:00
Evan Cheng
b0fdca31bc For functions with ARM target specific calling convention, when simplify-libcall
optimize a call to a llvm intrinsic to something that invovles a call to a C
library call, make sure it sets the right calling convention on the call.

e.g.
extern double pow(double, double);
double t(double x) {
  return pow(10, x);
}

Compiles to something like this for AAPCS-VFP:
define arm_aapcs_vfpcc double @t(double %x) #0 {
entry:
  %0 = call double @llvm.pow.f64(double 1.000000e+01, double %x)
  ret double %0
}

declare double @llvm.pow.f64(double, double) #1

Simplify libcall (part of instcombine) will turn the above into:
define arm_aapcs_vfpcc double @t(double %x) #0 {
entry:
  %__exp10 = call double @__exp10(double %x) #1
  ret double %__exp10
}

declare double @__exp10(double)

The pre-instcombine code works because calls to LLVM builtins are special.
Instruction selection will chose the right calling convention for the call.
However, the code after instcombine is wrong. The call to __exp10 will use
the C calling convention.

I can think of 3 options to fix this.

1. Make "C" calling convention just work since the target should know what CC
   is being used.

   This doesn't work because each function can use different CC with the "pcs"
   attribute.

2. Have Clang add the right CC keyword on the calls to LLVM builtin.

   This will work but it doesn't match the LLVM IR specification which states
   these are "Standard C Library Intrinsics".

3. Fix simplify libcall so the resulting calls to the C routines will have the
   proper CC keyword. e.g.
   %__exp10 = call arm_aapcs_vfpcc double @__exp10(double %x) #1

   This works and is the solution I implemented here.

Both solutions #2 and #3 would work. After carefully considering the pros and
cons, I decided to implement #3 for the following reasons.

1. It doesn't change the "spec" of the intrinsics.
2. It's a self-contained fix.

There are a couple of potential downsides.
1. There could be other places in the optimizer that is broken in the same way
   that's not addressed by this.
2. There could be other calling conventions that need to be propagated by
   simplify-libcall that's not handled.

But for now, this is the fix that I'm most comfortable with.

llvm-svn: 203488
2014-03-10 20:49:45 +00:00
Sebastian Pop
470d5c6a2f fix PR13550: add a cmake WITH_POLLY option
llvm-svn: 203486
2014-03-10 20:47:39 +00:00
Eli Bendersky
a3ecc3bf5a Followup to r203483 - add test.
[forgot to 'svn add' before committing r203483]

llvm-svn: 203485
2014-03-10 20:36:04 +00:00
Sasa Stankovic
37538d4bfa [mips] Implement NaCl sandboxing of loads, stores and SP changes:
* Add masking instructions before loads and stores (in MC layer).
  * Add masking instructions after SP changes (in MC layer).
  * Forbid loads, stores and SP changes in delay slots (in MI layer).

Differential Revision: http://llvm-reviews.chandlerc.com/D2904

llvm-svn: 203484
2014-03-10 20:34:23 +00:00
Eli Bendersky
82b7097fc4 Make sure NVPTX doesn't emit symbol names that aren't valid in PTX.
NVPTX, like the other backends, relies on generic symbol name sanitizing done by
MCSymbol. However, the ptxas assembler is more stringent and disallows some
additional characters in symbol names.

See PR19099 for more details.

llvm-svn: 203483
2014-03-10 20:05:42 +00:00
Tim Northover
1b5043b6fb llvm-c: expose unnamedaddr field of globals
Patch by Manuel Jacob.

llvm-svn: 203482
2014-03-10 19:24:35 +00:00
Tim Northover
bd04cde7e1 Docs: remove paragraph about manual account creation.
There's now a normal UI for that, apparently.

Patch by Manuel Jacob.

llvm-svn: 203481
2014-03-10 19:24:30 +00:00
Adam Nemet
7951eb79ea [bugpoint] Add testcase for r203343.
llvm-svn: 203472
2014-03-10 16:58:54 +00:00
Rafael Espindola
01261193ed Add a --enable-clang-plugin-support option to configure.
This will replace the now badly named CLANG_IS_PRODUCTION.

llvm-svn: 203471
2014-03-10 16:58:35 +00:00
Reed Kotler
e1cab9f9f1 Fix regression with -O0 for mips .
llvm-svn: 203469
2014-03-10 16:31:25 +00:00
JF Bastien
4c9e269281 Add test for LinkModules warning on triple, modified by r203009. Datalayout is already tested.
llvm-svn: 203468
2014-03-10 15:54:49 +00:00
Benjamin Kramer
a461fb6a91 [C++11] Modernize the IR library a bit.
No functionality change.

llvm-svn: 203465
2014-03-10 15:03:06 +00:00
Daniel Sanders
cb9a997e5e [mips][fp64] Add an implicit def to MFHC1 claiming that it reads the lower 32-bits of 64-bit FPR
Summary:
This is a white lie to workaround a widespread bug in the -mfp64
implementation.

The problem is that none of the 32-bit fpu ops mention the fact that they
clobber the upper 32-bits of the 64-bit FPR. This allows MFHC1 to be
scheduled on the wrong side of most 32-bit FPU ops. Fixing that requires a
major overhaul of the FPU implementation which can't be done right now due to
time constraints.

MFHC1 is one of two affected instructions. These instructions are the only
FPU instructions that don't read or write the lower 32-bits. We therefore
pretend that it reads the bottom 32-bits to artificially create a dependency and
prevent the scheduler changing the behaviour of the code.
The other instruction is MTHC1 which will be fixed once I've have found a failing
test case for it. 

The testcase is test-suite/SingleSource/UnitTests/Vector/simple.c when
given TARGET_CFLAGS="-mips32r2 -mfp64 -mmsa".

Reviewers: jacksprat, matheusalmeida

Reviewed By: jacksprat

Differential Revision: http://llvm-reviews.chandlerc.com/D2966

llvm-svn: 203464
2014-03-10 15:01:57 +00:00
Aaron Ballman
13c9ddc235 Removing llvm::distance and llvm::copy for iterator_range based on post-commit review feedback. Adding an explicit range-based constructor to SmallVector, which supersedes the llvm::copy functionality.
llvm-svn: 203460
2014-03-10 13:43:46 +00:00
Matheus Almeida
4fff721d3a [mips] Assembly parser must invoke the target streamer to handle .set reorder macro.
llvm-svn: 203459
2014-03-10 13:21:10 +00:00
Tim Northover
2f522988cc AArch64: fix LowerCONCAT_VECTORS for new CodeGen.
The function was making too many assumptions about its input:

1. The NEON_VDUP optimisation was far too aggressive, assuming (I
think) that the input would always be BUILD_VECTOR.

2. We were treating most unknown concats as legal (by returning Op
rather than SDValue()). I think only concats of pairs of vectors are
actually legal.

http://llvm.org/PR19094

llvm-svn: 203450
2014-03-10 09:34:07 +00:00
Chandler Carruth
a92c6a2ed3 [LCG] Make this call graph a fully regular type by giving it assignment
as well. I don't see any particular need but it imposes no cost to
support it and it makes the API cleaner.

llvm-svn: 203448
2014-03-10 08:08:59 +00:00
Chandler Carruth
ee0de313d2 [LCG] Make the iterator move constructable (and thus movable in general)
now that there is essentially no cost to doing so. Yay C++11.

llvm-svn: 203447
2014-03-10 08:08:47 +00:00
Craig Topper
2e98354909 [C++11] Remove 'virtual' keyword from methods marked with 'override' keyword.
llvm-svn: 203444
2014-03-10 05:29:18 +00:00
Craig Topper
813f30aa7e [C++11] Remove 'virtual' keyword from methods marked with 'override' keyword.
llvm-svn: 203442
2014-03-10 03:53:12 +00:00
Chandler Carruth
81d2cd22df [AArch64] Fix a use of uninitialized memory introduced in r203125,
and caught by the MSan bootstrap build bot. This should hopefully get
the bot green at long last.

llvm-svn: 203441
2014-03-10 03:52:47 +00:00
Craig Topper
8abcd5aecd De-virtualize a method since it doesn't override anything and isn't overridden itself.
llvm-svn: 203440
2014-03-10 03:22:59 +00:00
Craig Topper
1735ce1ba2 [C++11] Add 'override' keyword to virtual methods that override their base class.
llvm-svn: 203439
2014-03-10 03:19:03 +00:00
Chandler Carruth
8c51636a52 [LCG] One more formatting fix that I failed to get into the prior
commit. Sorry for the churn, just trying to keep it out of any
functionality changed.

llvm-svn: 203438
2014-03-10 02:50:21 +00:00
Chandler Carruth
8f25783c45 [TTI] There is actually no realistic way to pop TTI implementations off
the stack of the analysis group because they are all immutable passes.
This is made clear by Craig's recent work to use override
systematically -- we weren't overriding anything for 'finalizePass'
because there is no such thing.

This is kind of a lame restriction on the API -- we can no longer push
and pop things, we just set up the stack and run. However, I'm not
invested in building some better solution on top of the existing
(terrifying) immutable pass and legacy pass manager.

llvm-svn: 203437
2014-03-10 02:45:14 +00:00
NAKAMURA Takumi
e89c041912 ADT/PointerIntPairTest.cpp: Appease msc17.
- Use constructor instead of initializer list.
  - Disable ManyUnusedBits for now.

llvm-svn: 203436
2014-03-10 02:33:17 +00:00
Chandler Carruth
c65b944bd3 [LCG] Ran clang-format over this too and it pointed out some fixes.
llvm-svn: 203435
2014-03-10 02:14:14 +00:00
Chandler Carruth
6c5196f889 [PM] While I'm here, fix a few other clang-format issues. Pulls some
lines under 80-columns, etc.

llvm-svn: 203434
2014-03-10 02:12:14 +00:00
Craig Topper
e7c9ce2777 [C++11] Add 'override' keyword to virtual methods that override their base class.
llvm-svn: 203433
2014-03-10 02:09:33 +00:00
Chandler Carruth
8f137bd294 [PM] Cleanup formatting and namespace commenting. Mostly done with
clang-format, but with some modifications by me where it got things
wrong or got confused.

llvm-svn: 203432
2014-03-10 01:42:03 +00:00
Chandler Carruth
b7d8d65285 [PM] As Dave noticed in review, I had erroneously copied the move
constructors from the classes which only have a single reference member
to many other places. This resulted in them copying their single member
instead of moving. =/ Fix this.

There's really not a useful test to add sadly because these move
constructors are only called when something deep inside some standard
library implementation *needs* to move them. Many of the types aren't
even user-impacting types. Or, the objects are copyable anyways and so
the result was merely a performance problem rather than a correctness
problem.

Anyways, thanks for the review. And this is a great example of why
I wish I colud have the compiler write these for me.

llvm-svn: 203431
2014-03-10 01:32:25 +00:00
David Majnemer
3c62f51f77 MC: Appease the buildbots
This is fallout from r203429.

llvm-svn: 203430
2014-03-10 01:04:18 +00:00
David Majnemer
c247617301 MC: Cleanup MCSectionMachO::ParseSectionSpecifier
Split by comma once instead of multiple times.  Moving this upfront
makes the rest of the code considerably simpler.

No functional change.

llvm-svn: 203429
2014-03-10 00:55:07 +00:00