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

88385 Commits

Author SHA1 Message Date
Renato Golin
1487c2a7ac Change CostTable model to be global to all targets
Moving the X86CostTable to a common place, so that other back-ends
can share the code. Also simplifying it a bit and commoning up
tables with one and two types on operations.

llvm-svn: 172658
2013-01-16 21:29:55 +00:00
Michael Gottesman
fd06af4ad6 Added test for r172599 which fixes bugzilla://14584,rdar://11744105.
llvm-svn: 172656
2013-01-16 21:07:18 +00:00
Michael J. Spencer
7fae6e33d7 [Support] Include the intrisics header and check for definition properly.
llvm-svn: 172655
2013-01-16 20:50:43 +00:00
Eric Christopher
961c3d7f24 Make this test X86 only.
llvm-svn: 172652
2013-01-16 20:31:35 +00:00
Eric Christopher
07e3b98cb9 Move this to X86.
llvm-svn: 172651
2013-01-16 20:31:32 +00:00
Eric Christopher
1a2014e917 Add testcase missed yesterday from Paul Robinson.
llvm-svn: 172646
2013-01-16 19:53:47 +00:00
Michael J. Spencer
73729ac2ac [Support] Add MSVC intrinsic for CountPopulation.
Patch by Jakub Staszak.

llvm-svn: 172645
2013-01-16 19:52:12 +00:00
Michael J. Spencer
ae07392cfc [Support] Update MSVC compiler support in Compiler.h.
llvm-svn: 172644
2013-01-16 19:51:59 +00:00
Eli Bendersky
8ee072cd7f Remove unneeded include and empty line
llvm-svn: 172642
2013-01-16 19:42:16 +00:00
Eli Bendersky
b713627125 Some small (and mostly cosmetic) fixes.
llvm-svn: 172640
2013-01-16 19:32:36 +00:00
Eli Bendersky
a9a8a1cb79 Clean up some unnecessary headers and forward declarations
llvm-svn: 172638
2013-01-16 19:00:21 +00:00
Eli Bendersky
9748b9b3ad Now that GenericAsmParser was folded into AsmParser, some methods and types can
return into the safe harbor of AsmParser's private areas.

llvm-svn: 172637
2013-01-16 18:56:50 +00:00
Daniel Dunbar
ac8f9382bc [Linker] Change module flag linking to be more extensible.
- Instead of computing a bunch of buckets of different flag types, just do an
   incremental link resolving conflicts as they arise.

 - This also has the advantage of making the link result deterministic and not
   dependent on map iteration order.

llvm-svn: 172634
2013-01-16 18:39:23 +00:00
Kevin Enderby
2e875dfb6d We want the dwarf AT_producer for assembly source files to match clang's
AT_producer.  Which includes clang's version information so we can tell
which version of the compiler was used.

This is the first of two steps to allow us to do that.  This is the llvm-mc
change to provide a method to set the AT_producer string.  The second step,
coming soon to a clang near you, will have the clang driver pass the value
of getClangFullVersion() via an flag when invoking the integrated assembler
on assembly source files.

rdar://12955296

llvm-svn: 172630
2013-01-16 17:46:23 +00:00
Peter Collingbourne
5f190b5e4e Introduce llvm::sys::getProcessTriple() function.
In r143502, we renamed getHostTriple() to getDefaultTargetTriple()
as part of work to allow the user to supply a different default
target triple at configure time.  This change also affected the JIT.
However, it is inappropriate to use the default target triple in the
JIT in most circumstances because this will not necessarily match
the current architecture used by the process, leading to illegal
instruction and other such errors at run time.

Introduce the getProcessTriple() function for use in the JIT and
its clients, and cause the JIT to use it.  On architectures with a
single bitness, the host and process triples are identical.  On other
architectures, the host triple represents the architecture of the
host CPU, while the process triple represents the architecture used
by the host CPU to interpret machine code within the current process.
For example, when executing 32-bit code on a 64-bit Linux machine,
the host triple may be 'x86_64-unknown-linux-gnu', while the process
triple may be 'i386-unknown-linux-gnu'.

This fixes JIT for the 32-on-64-bit (and vice versa) build on non-Apple
platforms.

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

llvm-svn: 172627
2013-01-16 17:27:22 +00:00
Eli Bendersky
d77376b63f Replace virtual hasFixups with explicit fragment type checks
llvm-svn: 172622
2013-01-16 16:52:08 +00:00
Evgeniy Stepanov
044fd8aa94 Allow vectors in CreatePointerCast of constants.
llvm-svn: 172615
2013-01-16 14:41:46 +00:00
Evgeniy Stepanov
c6431b5743 A test for r172535.
llvm-svn: 172614
2013-01-16 14:38:50 +00:00
Benjamin Kramer
9b3ce0d35a Remove unused leftover header (it moved to llvm/IR).
llvm-svn: 172612
2013-01-16 13:43:56 +00:00
Benjamin Kramer
efb9c9f20b Move test that depends on the x86 target into a target-specific directory.
Should fix the arm buildbot (which only builds the arm target).

llvm-svn: 172611
2013-01-16 13:25:56 +00:00
Alexey Samsonov
555fc1db3c ASan: wrap mapping scale and offset in a struct and make it a member of ASan passes. Add test for non-default mapping scale and offset. No functionality change
llvm-svn: 172610
2013-01-16 13:23:28 +00:00
Benjamin Kramer
5c109df93a Remove triple from this test, it makes it fail when X86 TTI is missing.
Without a triple opt falls back to NoTTI which comes closer to LSR's pre-TTI behavior.

llvm-svn: 172609
2013-01-16 13:19:59 +00:00
Michael Gottesman
56275116f2 [ObjCARC] Turn off ignoring unwind edges in ObjCARC when -fno-objc-arc-exception is enabled due to it's affect on correctness.
Specifically according to the semantics of ARC -fno-objc-arc-exception simply
states that it is expected that the unwind path out of a call *MAY* not release
objects. Thus we can have the situation where a release gets moved into a catch
block which we ignore when we remove a retain/release pair resulting in (even
though we assume the program is exiting anyways) the cleanup code path
potentially blowing up before program exit.

llvm-svn: 172599
2013-01-16 06:32:39 +00:00
Jack Carter
6e4e11b877 reverting 172579
llvm-svn: 172594
2013-01-16 01:29:10 +00:00
Eric Christopher
2cc98e5771 Define metadata interfaces for describing a static data member
of a class. Emit static data member declarations and definitions
through correctly.

Part of PR14471.

Patch by Paul Robinson!

llvm-svn: 172590
2013-01-16 01:22:23 +00:00
Eli Bendersky
039d07cadd Use the ExtensionDirectiveHandler type in other places where it makes sense.
Since we already have this type it's a shame to keep dragging a pair of object
and method around explicitly.

llvm-svn: 172584
2013-01-16 00:50:52 +00:00
David Greene
b397f03b15 Use --enable-werror
Use --enable-werror during configure time rather than
--with-extra-options.  This is cleaner and easier to read.

llvm-svn: 172581
2013-01-16 00:17:38 +00:00
Dmitri Gribenko
7668555444 Improve r172577 by using the correct type when declaring constants
llvm-svn: 172580
2013-01-16 00:14:15 +00:00
Jack Carter
d951346d6e Akira,
Hope you are feeling better.

The Mips RDHWR (Read Hardware Register) instruction was not 
tested for assembler or dissassembler consumption. This patch
adds that functionality.

Contributer: Vladimir Medic
 
llvm-svn: 172579
2013-01-16 00:07:45 +00:00
Eric Christopher
a159b6c731 Split address information for DWARF5 split dwarf proposal. This involves
using the DW_FORM_GNU_addr_index and a separate .debug_addr section which
stays in the executable and is fully linked.

Sneak in two other small changes:

a) Print out the debug_str_offsets.dwo section.
b) Change form we're expecting the entries in the debug_str_offsets.dwo
   section to take from ULEB128 to U32.

Add tests for all of this in the fission-cu.ll test.

llvm-svn: 172578
2013-01-15 23:56:56 +00:00
David Greene
1e3c455fda Avoid Enum Compare Warnings
Avoid a compiler warning about comparing disjoint enums but casting
them to int first.

llvm-svn: 172577
2013-01-15 23:46:58 +00:00
Nadav Rotem
24c96fa80c Teach InstCombine to optimize extract of a value from a vector add operation with a constant zero.
llvm-svn: 172576
2013-01-15 23:43:14 +00:00
Eli Bendersky
8783cf1716 Optimize the memory usage of MC bundling, by creating a new type of fragment
into which we can emit single instructions without fixups (which is most
instructions). This is an optimization required because MCDataFragment
is prety large (240 bytes on x64), with no change in functionality.

For large programs, this reduces memory usage overhead required for bundling
by 40%.

To make the code as palatable as possible, the MCEncodedFragment interface was
further fragmented (no pun intended) and MCEncodedFragmentWithFixups is used
as the interface to work against when the user expects fixups. MCDataFragment
and MCRelaxableFragment implement this interface, while the new
MCCompactEncodedInstFragment implements MCEncodeFragment.

llvm-svn: 172572
2013-01-15 23:22:09 +00:00
Chad Rosier
99207e5c20 [ms-inline asm] Address the FIXME in AsmParser.cpp.
// FIXME: Constraints are hard coded to 'm', but we need an 'r'
// constraint for addressof.  This needs to be cleaned up!

Test cases are already in place.  Specifically,
clang/test/CodeGen/ms-inline-asm.c t15(), t16(), and t24().

llvm-svn: 172569
2013-01-15 23:07:53 +00:00
Eli Bendersky
2e1c083b6f Refactor generic Asm directive parsing.
After discussing the refactoring with Jim and Daniel, the following changes were
made:

* All generic directive parsing is now done by AsmParser itself. The previous
  division between it and GenericAsmParser did not have clear boundaries and
  just produced unnatural code of GenericAsmParser juggling the internals of
  AsmParser through an interface. 
  The division of responsibilities is now clear: target-specific directives,
  other extensions (used by platform-specific parseres), and generic directives.
* Priority for directive parsing was reshuffled to ask extensions first and
  check the generic directives later.

No change in functionality.

llvm-svn: 172568
2013-01-15 22:59:42 +00:00
Michael J. Spencer
eb5c91b105 [Object][ELF] Fix -Wenum-compare.
llvm-svn: 172556
2013-01-15 22:00:16 +00:00
Shuxin Yang
36c3cb1b3b 1. Hoist minus sign as high as possible in an attempt to reveal
some optimization opportunities (in the enclosing supper-expressions).

   rule 1. (-0.0 - X ) * Y => -0.0 - (X * Y)
     if expression "-0.0 - X" has only one reference.

   rule 2. (0.0 - X ) * Y => -0.0 - (X * Y)
     if expression "0.0 - X" has only one reference, and
        the instruction is marked "noSignedZero".

2. Eliminate negation (The compiler was already able to handle these
    opt if the 0.0s are replaced with -0.0.)

   rule 3: (0.0 - X) * (0.0 - Y) => X * Y
   rule 4: (0.0 - X) * C => X * -C
   if the expr is flagged "noSignedZero".

3. 
  Rule 5: (X*Y) * X => (X*X) * Y
   if X!=Y and the expression is flagged with "UnsafeAlgebra".

   The purpose of this transformation is two-fold:
    a) to form a power expression (of X).
    b) potentially shorten the critical path: After transformation, the
       latency of the instruction Y is amortized by the expression of X*X,
       and therefore Y is in a "less critical" position compared to what it
      was before the transformation. 

4. Remove the InstCombine code about simplifiying "X * select".
   
   The reasons are following:
    a) The "select" is somewhat architecture-dependent, therefore the
       higher level optimizers are not able to precisely predict if
       the simplification really yields any performance improvement
       or not.

    b) The "select" operator is bit complicate, and tends to obscure
       optimization opportunities. It is btter to keep it as low as
       possible in expr tree, and let CodeGen to tackle the optimization.

llvm-svn: 172551
2013-01-15 21:09:32 +00:00
Daniel Dunbar
76fbc97891 [Linker] Drop asserts that are embedded in cast<> and now checked by the verifier.
llvm-svn: 172550
2013-01-15 20:52:09 +00:00
Daniel Dunbar
2b7b6ad95a [IR] Add verification for module flags with the "require" behavior.
llvm-svn: 172549
2013-01-15 20:52:06 +00:00
Nadav Rotem
3fc70ae776 LoopVectorizer cost model. Honor the user command line flag that selects the vectorization factor even if the target machine does not have any vector registers.
llvm-svn: 172544
2013-01-15 18:25:16 +00:00
David Greene
04c65cf0ca Disable Uninitialized Use Warnings for Broken gcc Versions
Some versions of gcc accept unsupported -W flags and run just fine if
there are no warnings, but die with an unsupported flag error if a
warning is encountered.  gcc 4.3 and gcc 4.4 both exhibit this
behavior for -Wno-maybe-uninitialized.  Therefore, if the flag check
for -Wno-maybe-uninitialized succeeds, only use
-Wno-maybe-uninitialized if we are using gcc version 4.7 or greater.
Use -Wno-uninitialized otherwise.

llvm-svn: 172543
2013-01-15 18:21:15 +00:00
Evgeniy Stepanov
4eadd744d9 [msan] Temporarily remove ICmpEQ tests.
They are failing on the bots.

llvm-svn: 172540
2013-01-15 17:12:04 +00:00
Evgeniy Stepanov
ffcdd9c304 [msan] Fix handling of equality comparison of pointer vectors.
Also improve test coveration of the handling of relational comparisons.

llvm-svn: 172539
2013-01-15 16:44:52 +00:00
Evgeniy Stepanov
adbeb94241 Allow vectors in CreatePointerCast.
Both underlying IR operations support vectors of pointers already.

llvm-svn: 172538
2013-01-15 16:43:00 +00:00
Evgeniy Stepanov
a263f1e883 Fix operand type conditions in one of ICmpInst constructors.
It was out of sync with the conditions in the other two constructors.

llvm-svn: 172535
2013-01-15 15:30:33 +00:00
Renato Golin
af8f3454c8 Pattern-matched variables in post-inc-icmpzero.ll
Test was failing for clang-native-arm-cortex-a9 build-bot configuration.
The reason for the failure was the test was using hardcoded names.
The attached patch fixes this failure by replacing the hard-coded variables
names with pattern-matched variable names.

Patch by Manish Verma, ARM

llvm-svn: 172534
2013-01-15 15:22:45 +00:00
Michael J. Spencer
89013e9c1c Update CODE_OWNERS.TXT.
llvm-svn: 172525
2013-01-15 09:37:45 +00:00
Michael J. Spencer
265466c97e [Object][ELF] Simplify ELFObjectFile by using ELFType.
This simplifies the usage and implementation of ELFObjectFile by using ELFType
to replace:

<endianness target_endianness, std::size_t max_alignment, bool is64Bits>

This does complicate the base ELF types as they must now use template template
parameters to partially specialize for the 32 and 64bit cases. However these
are only defined once.

llvm-svn: 172515
2013-01-15 07:44:25 +00:00
Michael J. Spencer
06c3809ddc [Support] Add LLVM_CONSTEXPR.
Marks a decl as constexpr if the compiler supports it.

llvm-svn: 172508
2013-01-15 05:01:39 +00:00
Argyrios Kyrtzidis
a1949388a1 [ADT/StringMap] Follow-up to r172455, use the correct constructor for setting the InitialSize,
previously it was calling the "StringMapImpl(unsigned itemSize)" constructor.

llvm-svn: 172500
2013-01-15 01:58:45 +00:00