Commit Graph

101034 Commits

Author SHA1 Message Date
Arnold Schwaighofer 34ac9be1d7 Fix vectorizer docs.
This example is not vectorized because LLVM does not prove no-wrapping of
"a[i*7] += ...".

llvm-svn: 203734
2014-03-12 23:23:44 +00:00
NAKAMURA Takumi 8a5a590cd1 decl-derived-member.ll: Try to unbreak. Don't add -mtriple to %llc_dwarf.
llvm-svn: 203732
2014-03-12 23:08:19 +00:00
Rafael Espindola 730df071c8 Remove projects/sample.
As an example that was not actually being used, it suffered from a slow bitrot.

The two main issues with it were that it had no cmake support and
included a copy of the autoconf directory. The reality is that
autoconf is not easily composable. The lack of composabilty is why we
have clang options in llvm's configure. Suggesting that users include
a copy of autoconf/ in their projects seems a bad idea.

We are also in the process of switching to cmake, so pushing autoconf
to new project is probably not what we want.

llvm-svn: 203728
2014-03-12 22:40:22 +00:00
David Blaikie f4ad698336 MCDwarf: Remove unused parameter
llvm-svn: 203727
2014-03-12 22:35:23 +00:00
David Blaikie a55e64f84a MCDwarf: Invert the Section+CU->LineEntries mapping so the CU is the primary dimension
This makes the mapping consistent with other CU->X mappings in the
MCContext, helping pave the way to refactor all these values into a
single data structure per CU and thus a single map.

I haven't renamed the data structure as that would make the patch churn
even higher (the MCLineSection name no longer makes sense, as this
structure now contains lines for multiple sections covered by a single
CU, rather than lines for a single section in multiple CUs) and further
refactorings will follow that may remove this type entirely.

For convenience, I also gave the MCLineSection value semantics so we
didn't have to do the lazy construction, manual delete, etc.

(& for those playing at home, refactoring the line printing into a
single data structure will eventually alow that data structure to be
reused to own the debug_line.dwo line table used for type unit file name
resolution)

llvm-svn: 203726
2014-03-12 22:28:56 +00:00
Rafael Espindola 1cf777bc12 This test need the X86 backend, move it to the X86 sub directory.
llvm-svn: 203725
2014-03-12 22:03:43 +00:00
Justin Bogner ec49f9820c Back out Profile library and dependent commits
Chandler voiced some concern with checking this in without some
discussion first. Reverting for now.

This reverts r203703, r203704, r203708, and 203709.

llvm-svn: 203723
2014-03-12 22:00:57 +00:00
Michael Zolotukhin 66806aef1e PR17473:
Don't normalize an expression during postinc transformation unless it's
invertible.

llvm-svn: 203719
2014-03-12 21:31:05 +00:00
Adam Nemet d4e56073c7 [X86] Add peephole for masked rotate amount
Extend what's currently done for shift because the HW performs this masking
implicitly:

   (rotl:i32 x, (and y, 31)) -> (rotl:i32 x, y)

I use the newly factored out multiclass that was only supporting shifts so
far.

For testing I extended my testcase for the new rotation idiom.

<rdar://problem/15295856>

llvm-svn: 203718
2014-03-12 21:20:55 +00:00
Rafael Espindola f217e099bb Fix the ocaml test to not create a alias to a declaration.
llvm-svn: 203717
2014-03-12 21:20:42 +00:00
Michael Zolotukhin 15e6e543b9 Test commit
llvm-svn: 203716
2014-03-12 21:15:56 +00:00
Justin Bogner f548af539c Profile: Avoid an unnecessary __attribute__((packed))
MSVC doesn't understand it, and it wasn't really necessary anyway.

llvm-svn: 203709
2014-03-12 20:40:14 +00:00
Justin Bogner a1f278f96c Profile: Remove an inefficient and unnecessary API function
This was leftover from an approach I abandoned, but I forgot to update
it before committing.

llvm-svn: 203708
2014-03-12 20:26:37 +00:00
Raul E. Silvera 62f0236d36 Resubmit "[SLPV] Recognize vectorizable intrinsics during SLP vectorization ..."
This reverts commit 86cb795388643710dab34941ddcb5a9470ac39d8.
The problems previously found have been resolved through other CLs.

llvm-svn: 203707
2014-03-12 20:21:50 +00:00
Rafael Espindola b676e72d56 Add a triple to fix the test on OS X.
llvm-svn: 203706
2014-03-12 20:21:35 +00:00
Rafael Espindola f3336bc1d5 Reject alias to undefined symbols in the verifier.
On ELF and COFF an alias is just another name for a position in the file.
There is no way to refer to a position in another file, so an alias to
undefined is meaningless.

MachO currently doesn't support aliases. The spec has a N_INDR, which when
implemented will have a different set of restrictions. Adding support for
it shouldn't be harder than any other IR extension.

For now, having the IR represent what is actually possible with current
tools makes it easier to fix the design of GlobalAlias.

llvm-svn: 203705
2014-03-12 20:15:49 +00:00
Justin Bogner bfee8d49c4 llvm-profdata: Use the Profile library, implement show and generate
This replaces the llvm-profdata tool with a version that uses the
recently introduced Profile library. The new tool has the ability to
generate and summarize profdata files as well as merging them.

llvm-svn: 203704
2014-03-12 20:14:17 +00:00
Justin Bogner a2e0368994 Profile: Add a library for the instrumentation based profiling format
This provides a library to work with the instrumentation based
profiling format that is used by clang's -fprofile-instr-* options and
by the llvm-profdata tool. This is a binary format, rather than the
textual one that's currently in use.

The tests are in the subsequent commits that use this.

llvm-svn: 203703
2014-03-12 20:14:05 +00:00
Eric Christopher da6b4f028a Fix two thinkos in testcase and remove XFAIL.
llvm-svn: 203702
2014-03-12 20:12:02 +00:00
Rafael Espindola 8b35074e09 Use -std=gnu++11 on cygwin and mingw.
Without this common features like off_t and strdup are missing.
This should bring back those bots.

Configure bits by Meador Inge.

llvm-svn: 203701
2014-03-12 20:01:15 +00:00
Roman Divacky a26f9a6a42 Allow exclamation and tilde to be parsed as a part of the ppc asm operand.
llvm-svn: 203699
2014-03-12 19:25:57 +00:00
Eric Christopher bc82fe338e XFAIL this temporarily.
llvm-svn: 203698
2014-03-12 19:06:03 +00:00
Eric Christopher e9305f037f Move test to X86 only for now.
llvm-svn: 203697
2014-03-12 19:02:44 +00:00
Matt Arsenault e389dd5d68 R600: Fix trunc store from i64 to i1
llvm-svn: 203695
2014-03-12 18:45:52 +00:00
Hans Wennborg b73c0b041d Allow switch-to-lookup table for tables with holes by adding bitmask check
This allows us to generate table lookups for code such as:

  unsigned test(unsigned x) {
    switch (x) {
      case 100: return 0;
      case 101: return 1;
      case 103: return 2;
      case 105: return 3;
      case 107: return 4;
      case 109: return 5;
      case 110: return 6;
      default: return f(x);
    }
  }

Since cases 102, 104, etc. are not constants, the lookup table has holes
in those positions. We therefore guard the table lookup with a bitmask check.

Patch by Jasper Neumann!

llvm-svn: 203694
2014-03-12 18:35:40 +00:00
Eric Christopher 8cc04fc40d When computing the size of a base type be conservative if the type
is a declaration and return the size of the type.

llvm-svn: 203690
2014-03-12 18:18:05 +00:00
Evan Cheng ad6efbfa0f Revert r203488 and r203520.
llvm-svn: 203687
2014-03-12 18:09:37 +00:00
Rafael Espindola 2e43aff460 Avoid repeated calls to CE->getOperand(0). No functionality change.
llvm-svn: 203686
2014-03-12 18:08:14 +00:00
Adam Nemet b667c3fc26 [X86] Refactor peepholes for masked shift amount into a multiclass
The peephole (shift x, (and y, 31)) -> (shift x, y) is repeated for each
integer type and each shift variant.

To improve this a new multiclass is added that covers all integer types.  The
shift patterns are now instantiated from this.  I am planning to add new
instances for rotates as well.

No functional change intended:

  * test/CodeGen/X86/shift-and.ll provides coverage

  * Compared the expanded tablegen output and matched up the defs for these
    Pat<>s before and after

llvm-svn: 203685
2014-03-12 18:02:33 +00:00
Quentin Colombet b5e41ea144 [X86] Set the scheduling resources of some of the FPStack instructions.
This is related to <rdar://problem/15607571>.

llvm-svn: 203682
2014-03-12 17:33:42 +00:00
Eric Christopher 1acdbb8856 Use values we've already computed, update comment.
No functional change.

llvm-svn: 203681
2014-03-12 17:14:46 +00:00
Eric Christopher 7924e0cca2 Turn on hashing by default for split dwarf compile units.
llvm-svn: 203680
2014-03-12 17:14:43 +00:00
Justin Bogner f404b93576 unittests: Fix -Werror build
llvm-svn: 203679
2014-03-12 17:00:52 +00:00
David Blaikie c47d084650 Correct typo ("a entry" -> "an entry")
llvm-svn: 203678
2014-03-12 16:56:05 +00:00
Rafael Espindola 3d5d464df8 Try harder to evaluate expressions when printing assembly.
When printing assembly we don't have a Layout object, but we can still
try to fold some constants.

Testcase by Ulrich Weigand.

llvm-svn: 203677
2014-03-12 16:55:59 +00:00
David Blaikie 7066f7bc39 DebugInfo: Use common line/file attribute construction code
llvm-svn: 203676
2014-03-12 16:51:06 +00:00
Eli Bendersky 95b540f221 Revive SizeOptLevel-explaining comments that were dropped in r203669
llvm-svn: 203675
2014-03-12 16:44:17 +00:00
Eli Bendersky 09a95e0b12 Add parens around && clauses in a || to appease the compiler.
Otherwise gcc 4.8.2 generates a warning.

llvm-svn: 203671
2014-03-12 16:14:53 +00:00
Hans Wennborg 6693c673a1 Add comment pointing to the binutils bugzilla entry
This is a follow-up to r203635 as suggested by Rafael.

llvm-svn: 203670
2014-03-12 16:14:23 +00:00
Eli Bendersky 49f6565267 Move duplicated code into a helper function (exposed through overload).
There's a bit of duplicated "magic" code in opt.cpp and Clang's CodeGen that
computes the inliner threshold from opt level and size opt level.

This patch moves the code to a function that lives alongside the inliner itself,
providing a convenient overload to the inliner creation.

A separate patch can be committed to Clang to use this once it's committed to
LLVM. Standalone tools that use the inlining pass can also avoid duplicating
this code and fearing it will go out of sync.

Note: this patch also restructures the conditinal logic of the computation to
be cleaner.

llvm-svn: 203669
2014-03-12 16:12:36 +00:00
Will Schmidt acae468c8e Update the datalayout string for ppc64LE.
Update the datalayout string for ppc64LE.

llvm-svn: 203664
2014-03-12 14:59:17 +00:00
Alon Mishne 07d949f39a Cloning a function now also clones its debug metadata if 'ModuleLevelChanges' is true.
llvm-svn: 203662
2014-03-12 14:42:51 +00:00
Daniel Sanders 61c76cc56f [mips][fp64] Add an implicit def to MTHC1 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 MTHC1 to be
scheduled on the wrong side of most 32-bit FPU ops, particularly MTC1.
Fixing that requires a major overhaul of the FPU implementation which can't
be done right now due to time constraints.

The testcase is SingleSource/Benchmarks/Misc/oourafft.c when given
TARGET_CFLAGS='-mips32r2 mfp64 -mmsa'.

Also correct the comment added in r203464 to indicate that two
instructions were affected.

Reviewers: matheusalmeida, jacksprat

Reviewed By: matheusalmeida

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

llvm-svn: 203659
2014-03-12 13:35:43 +00:00
Daniel Sanders df22154579 [mips] BSEL's and BINS[RL] operands are reversed compared to the vselect node used in the pattern.
Summary:
Correct the match patterns and the lowerings that made the CodeGen tests pass despite the mistakes.

The original testcase that discovered the problem was SingleSource/UnitTests/SignlessType/factor.c in test-suite.
During review, we also found that some of the existing CodeGen tests were incorrect and fixed them:
* bitwise.ll: In bsel_v16i8 the IfSet/IfClear were reversed because bsel and bmnz have different operand orders and the test didn't correctly account for this. bmnz goes 'IfClear, IfSet, CondMask', while bsel goes 'CondMask, IfClear, IfSet'.
* vec.ll: In the cases where a bsel is emitted as a bmnz (they are the same operation with a different input tied to the result) the operands were in the wrong order.
* compare.ll and compare_float.ll: The bsel operand order was correct for a greater-than comparison, but a greater-than comparison instruction doesn't exist. Lowering this operation inverts the condition so the IfSet/IfClear need to be swapped to match.

The differences between BSEL, BMNZ, and BMZ and how they map to/from vselect are rather confusing. I've therefore added a note to MSA.txt to explain this in a single place in addition to the comments that explain each case.

Reviewers: matheusalmeida, jacksprat

Reviewed By: matheusalmeida

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

llvm-svn: 203657
2014-03-12 11:54:00 +00:00
Tim Northover 3cccc45a9f ARM: correct Dwarf output for non-contiguous VFP saves.
When the list of VFP registers to be saved was non-contiguous (so multiple
vpush/vpop instructions were needed) these were being ordered oddly, as in:
    vpush {d8, d9}
    vpush {d11}

This led to the layout in memory being [d11, d8, d9] which is ugly and doesn't
match the CFI_INSTRUCTIONs we're generating either (so Dwarf info would be
broken).

This switches the order of vpush/vpop (in both prologue and epilogue,
obviously) so that the Dwarf locations are correct again.

rdar://problem/16264856

llvm-svn: 203655
2014-03-12 11:29:23 +00:00
Patrik Hagglund 1da3512166 Replace '#include ValueTypes.h' with forward declarations.
In some cases the include is pushed "downstream" (or removed if
unused).

llvm-svn: 203644
2014-03-12 08:00:24 +00:00
Hans Wennborg 14863418ed [ARM] Use DWARF register numbers for CFI directives in ELF assembly
It seems gas can't handle CFI directives with VFP register names ("d12", etc.).
This broke us trying to build Chromium for Android after 201423.

A gas bug has been filed: https://sourceware.org/bugzilla/show_bug.cgi?id=16694

compnerd suggested making this conditional on whether we're using the integrated
assembler or not. I'll look into that in a follow-up patch.

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

llvm-svn: 203635
2014-03-12 03:52:34 +00:00
David Blaikie adbea1ef9f DebugInfo: Omit pubnames/pubtypes when compiling with -gmlt
llvm-svn: 203634
2014-03-12 03:34:38 +00:00
David Blaikie ce2f1cb918 DebugInfo: Do not emit pubnames/pubtypes sections if they are empty
llvm-svn: 203622
2014-03-11 23:35:06 +00:00
David Blaikie fe04abbc89 Test for empty pubnames/pubtypes
llvm-svn: 203621
2014-03-11 23:35:03 +00:00