Commit Graph

115032 Commits

Author SHA1 Message Date
Duncan P. N. Exon Smith 0a93e2db9c PassManagerBuilder: Remove effectively dead 'StripDebug' option
`StripDebug` was only used by tools/opt/opt.cpp in
`AddStandardLinkPasses()`, but opt.cpp adds the same pass based on its
command-line flag before it calls `AddStandardLinkPasses()`.  Stripping
debug info twice isn't very useful.

llvm-svn: 232765
2015-03-19 21:37:17 +00:00
Hans Wennborg b4db1420c2 Switch lowering: extract NextBlock function. NFC.
llvm-svn: 232759
2015-03-19 20:41:48 +00:00
Krzysztof Parzyszek 02fd29452c Unxfail test/CodeGen/Generic/vector.ll now passing on Hexagon
llvm-svn: 232758
2015-03-19 20:22:17 +00:00
Peter Collingbourne 152b936683 gold: Make powerpc support optional for the tests.
Differential Revision: http://reviews.llvm.org/D8400

llvm-svn: 232744
2015-03-19 18:23:31 +00:00
Peter Collingbourne 0dbc7088da GlobalDCE: Improve performance for large modules containing comdats.
When we encounter a global with a comdat, rather than iterating over
every global in the module to find globals in the same comdat, store the
members in a multimap. This effectively lowers the complexity to O(N log N),
improving performance significantly for large modules such as might be
encountered during LTO.

It looks like we used to do something like this until r219191.

No functional change.

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

llvm-svn: 232743
2015-03-19 18:23:29 +00:00
Justin Bogner 7bf61d3139 docs: Update llvm-cov docs for the -use-color flag
llvm-svn: 232742
2015-03-19 18:22:46 +00:00
Artem Belevich 9e8a039318 Add support for __nvvm_reflect changes in libdevice in CUDA-7.0
Summary:
CUDA 7.0's libdevice uses slightly different IR to call __nvvm_reflect
and that triggers an assertion in nvvm_reflect optimization pass. This
change allows nvvm_reflect pass to deal with both old and new ways to
pass an argument to __nvvm_reflect.

Test Plan: ninja check-all

Reviewers: eliben, echristo

Subscribers: jholewinski, llvm-commits

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

llvm-svn: 232732
2015-03-19 17:05:35 +00:00
Chris Bieneman ca4f699cc2 Fixing dependencies for native tablegen.
The dependencies for cross-built tablegen were a bit confused. This fixes that. The following dependencies are now enforced:

(1) Tablegen tasks depend on the native tablegen
(2) Native tablegen depends on the cross-compiled tablegen

Although the native tablegen doesn't actually require the cross tablegen, having this dependency forces the native tablegen to rebuild whenever the cross tablegen changes.

llvm-svn: 232730
2015-03-19 16:49:44 +00:00
Hans Wennborg 783254386e Switch lowering: remove unnecessary ConstantInt casts. NFC.
llvm-svn: 232729
2015-03-19 16:42:21 +00:00
Krzysztof Parzyszek 421133470f [Hexagon] Add support for vector instructions
llvm-svn: 232728
2015-03-19 16:33:08 +00:00
Greg Bedwell 8aa3000d24 [CMake] Don't pass in MSVC warning flags as definitions.
NFC currently but required as a prerequisite for using
the Microsoft resource compiler in conjunction with
CMake's ninja generator, which knows how to filter flags
appropriately, but not definitions.

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

llvm-svn: 232727
2015-03-19 16:32:47 +00:00
Krzysztof Parzyszek c6f19333cf [Hexagon] ENDLOOP is a non-reversible conditional branch
llvm-svn: 232725
2015-03-19 15:18:57 +00:00
Benjamin Kramer 717e973a51 Internalize PEI. NFC.
llvm-svn: 232722
2015-03-19 14:09:20 +00:00
Daniel Sanders b1fbacab5f [sparc] Small fix to r232719 to make 2007-12-17-InvokeAsm.ll pass on the buildbot.
llvm-svn: 232720
2015-03-19 11:27:23 +00:00
Daniel Sanders f5d1110075 [sparc] Only support the 'm' inline assembly memory constraint. NFC.
Summary:
SPARC doesn't seem to support any additional constraints. Therefore remove
the target hook.

No functional change intended.

Reviewers: venkatra

Subscribers: llvm-commits

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

llvm-svn: 232719
2015-03-19 11:26:05 +00:00
Daniel Jasper 5add63f21e [InstCombine] Don't fold a GEP into itself through a PHI node
This can only occur (I think) through the back-edge of the loop.

However, folding a GEP into itself means that the value of the previous
iteration needs to be stored in the meantime, thus requiring an
additional register variable to be live, but not actually achieving
anything (the gep still needs to be executed once per loop iteration).

The attached test case is derived from:
  typedef unsigned uint32;
  typedef unsigned char uint8;
  inline uint8 *f(uint32 value, uint8 *target) {
    while (value >= 0x80) {
      value >>= 7;
      ++target;
    }
    ++target;
    return target;
  }
  uint8 *g(uint32 b, uint8 *target) {
    target = f(b, f(42, target));
    return target;
  }

What happens is that the GEP stored in incptr2 is folded into itself
through the loop's back-edge and the phi-node stored in loopptr,
effectively incrementing the ptr by "2" in each iteration instead of "1".

In this case, it is actually increasing the number of GEPs required as
the GEP before the loop can't be folded away anymore. For comparison:

With this patch:
  define i8* @test4(i32 %value, i8* %buffer) {
  entry:
    %cmp = icmp ugt i32 %value, 127
    br i1 %cmp, label %loop.header, label %exit

  loop.header:                                      ; preds = %entry
    br label %loop.body

  loop.body:                                        ; preds = %loop.body, %loop.header
    %buffer.pn = phi i8* [ %buffer, %loop.header ], [ %loopptr, %loop.body ]
    %newval = phi i32 [ %value, %loop.header ], [ %shr, %loop.body ]
    %loopptr = getelementptr inbounds i8, i8* %buffer.pn, i64 1
    %shr = lshr i32 %newval, 7
    %cmp2 = icmp ugt i32 %newval, 16383
    br i1 %cmp2, label %loop.body, label %loop.exit

  loop.exit:                                        ; preds = %loop.body
    br label %exit

  exit:                                             ; preds = %loop.exit, %entry
    %0 = phi i8* [ %loopptr, %loop.exit ], [ %buffer, %entry ]
    %incptr3 = getelementptr inbounds i8, i8* %0, i64 2
    ret i8* %incptr3
  }

Without this patch:
  define i8* @test4(i32 %value, i8* %buffer) {
  entry:
    %incptr = getelementptr inbounds i8, i8* %buffer, i64 1
    %cmp = icmp ugt i32 %value, 127
    br i1 %cmp, label %loop.header, label %exit

  loop.header:                                      ; preds = %entry
    br label %loop.body

  loop.body:                                        ; preds = %loop.body, %loop.header
    %0 = phi i8* [ %buffer, %loop.header ], [ %loopptr, %loop.body ]
    %loopptr = phi i8* [ %incptr, %loop.header ], [ %incptr2, %loop.body ]
    %newval = phi i32 [ %value, %loop.header ], [ %shr, %loop.body ]
    %shr = lshr i32 %newval, 7
    %incptr2 = getelementptr inbounds i8, i8* %0, i64 2
    %cmp2 = icmp ugt i32 %newval, 16383
    br i1 %cmp2, label %loop.body, label %loop.exit

  loop.exit:                                        ; preds = %loop.body
    br label %exit

  exit:                                             ; preds = %loop.exit, %entry
    %ptr2 = phi i8* [ %incptr2, %loop.exit ], [ %incptr, %entry ]
    %incptr3 = getelementptr inbounds i8, i8* %ptr2, i64 1
    ret i8* %incptr3
  }

Review: http://reviews.llvm.org/D8245
llvm-svn: 232718
2015-03-19 11:05:08 +00:00
Justin Bogner 9deb1d406f llvm-cov: Rename -color={always|never} to -use-color[=0]
This is an ugly hack to fix the configure --enable-shared build. It
turns out that *every cl::opt in LLVM* shows up in *every tool* in
that configuration, which is hopelessly broken. This skirts around the
issue by not colliding with another option's name, for now.

I've also simplified the option implementation - the other "color"
option used cl::boolOrDefault and was much nicer than what I'd written
before.

llvm-svn: 232704
2015-03-19 04:45:16 +00:00
Rafael Espindola 7f45440bd9 Note that we don't support COFF on PPC.
Should bring back the windows bots.

llvm-svn: 232701
2015-03-19 02:40:56 +00:00
Justin Bogner efa427823e llvm-cov: Continue trying to appease a bot
This bot doesn't like me. I don't know why:

    http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/24425

Move the color option enum's definition out of the function that
creates the cl::opt.

llvm-svn: 232700
2015-03-19 02:00:54 +00:00
Rafael Espindola cd584a809d Split the object streamer callback in one per file format.
There are two main advantages to doing this

* Targets that only need to handle one of the formats specially don't have
  to worry about the others. For example, x86 now only registers a
  constructor for the COFF streamer.

* Changes to the arguments passed to one format constructor will not impact
  the other formats.

llvm-svn: 232699
2015-03-19 01:50:16 +00:00
Justin Bogner 58e2492f93 llvm-cov: Try to appease a bot
The clang-hexagon elf bot was complaining that "Option 'color'
registered more than once!":

    http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/24425

I don't understand why this error is happening, and I don't see it on
any other bots or on my own machine, so I'm kind of grasping at
straws. Try using an unscoped enum and specifying a cl::init to see if
they help.

llvm-svn: 232698
2015-03-19 01:07:22 +00:00
Hans Wennborg 5b64657e36 SelectionDAGBuilder: update comment in HandlePHINodesInSuccessorBlocks.
From what I can tell, the code is checking for PHIs that expect any value from
this block, not just constants.

llvm-svn: 232697
2015-03-19 00:57:51 +00:00
Matthias Braun a25e13aaf1 Do not track subregister liveness when it brings no benefits
Some subregisters are only to indicate different access sizes, while not
providing any way to actually divide the register up into multiple
disjunct parts. Avoid tracking subregister liveness in these cases as it
is not beneficial.

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

llvm-svn: 232695
2015-03-19 00:21:58 +00:00
Justin Bogner cfb53e49b6 llvm-cov: Only emit colour by default if the output is a tty
This replaces the -no-color flag with a -color={auto|always|never}
option, with auto as the default, which is much saner.

llvm-svn: 232693
2015-03-19 00:02:23 +00:00
Hans Wennborg 81cfeb1999 SelectionDAGIsel: Fix comment about terminators being "handled below".
That changed in r102128.

llvm-svn: 232692
2015-03-19 00:02:22 +00:00
Quentin Colombet 7bdd50d2a0 [CodeGenPrepare] Remove broken, dead, code.
NFC.

llvm-svn: 232690
2015-03-18 23:17:28 +00:00
Rafael Espindola 69244c3e78 two or more, use a for.
llvm-svn: 232688
2015-03-18 23:15:49 +00:00
Simon Pilgrim cf1d7df2e3 Fixed failing test due to missing target triple causing different results on different buildbots.
llvm-svn: 232685
2015-03-18 22:51:45 +00:00
Rafael Espindola 242548906d Teach getDefaultFormat that we only support ELF on some architectures.
This should bring the windows bots back.

It is a bit ugly, but it is better than what we had before: The triple would
say that the object format was COFF, but llc/llvm-mc would produce an ELF.

llvm-svn: 232683
2015-03-18 22:19:16 +00:00
Simon Pilgrim 5ec5c9cafe [X86][SSE] Avoid scalarization of v2i64 vector shifts (REAPPLIED)
Fixed broken tests.

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

llvm-svn: 232682
2015-03-18 22:18:51 +00:00
Bill Schmidt 1723525e01 [PowerPC] Correct typo in PPCInstrAltivec.td
llvm-svn: 232681
2015-03-18 22:13:03 +00:00
Mehdi Amini e45f94b148 Update 3.7 Release Note mentionning the non-optionality of the DataLayout
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 232677
2015-03-18 22:01:44 +00:00
Chris Bieneman 244bbf8bcb Revert "Generate targets for each lit suite."
This change broke Polly. I'll track down the failure when I have a chance and re-apply the change.

llvm-svn: 232676
2015-03-18 21:53:29 +00:00
Chris Bieneman 86ee151570 Generate targets for each lit suite.
Summary:
This change makes CMake scan for lit suites and generate a target for each lit test suite. The targets follow the format check-<project>-<suite path>.

For example:
check-llvm-unit - Runs the LLVM unit tests
check-llvm-codegen-arm - Runs the ARM codeine tests

Note: These targets are not generated during multi-configuration generators (i.e. Xcode and Visual Studio) because target clutter impacts UI usability.

Reviewers: chandlerc

Subscribers: aemerson, llvm-commits

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

llvm-svn: 232671
2015-03-18 21:19:06 +00:00
Eric Christopher 050f590a0c Revert "[X86][SSE] Avoid scalarization of v2i64 vector shifts" as it
appears to have broken tests/bots.

This reverts commit r232660.

llvm-svn: 232670
2015-03-18 21:01:00 +00:00
Eric Christopher 5ac4e120be Revert "Add a TargetMachine local MCRegisterInfo and MCInstrInfo so that"
Committed too early.

This reverts commit r232666.

llvm-svn: 232667
2015-03-18 20:41:44 +00:00
Eric Christopher 4e80e18e78 Add a TargetMachine local MCRegisterInfo and MCInstrInfo so that
they can be used without a subtarget in constructing subtarget
independent passes.

llvm-svn: 232666
2015-03-18 20:37:36 +00:00
Eric Christopher a0de253d27 Revert "Migrate the AArch64 TargetRegisterInfo to its TargetMachine"
as we don't necessarily need to do this yet - though we could move
the base class to the TargetMachine as it isn't subtarget dependent.

This reverts commit r232103.

llvm-svn: 232665
2015-03-18 20:37:30 +00:00
Reid Kleckner 0f9e27a371 Use WinEHPrepare to outline SEH finally blocks
No outlining is necessary for SEH catch blocks. Use the blockaddr of the
handler in place of the usual outlined function.

Reviewers: majnemer, andrew.w.kaylor

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

llvm-svn: 232664
2015-03-18 20:26:53 +00:00
Rafael Espindola 5a28f4361d Fix cmake build.
llvm-svn: 232663
2015-03-18 20:21:06 +00:00
Reid Kleckner 3e8c445c96 CMake: Disable ENABLE_EXPORTS for executables with MSVC
The MSVC linker won't produce a .lib file for an executable that doesn't
export anything, and LLVM doesn't maintain dllexport annotations or .def
files listing all C++ symbols. It also doesn't support exporting all
symbols, like binutils ld.

CMake 3.2 changed the Ninja generator to list both the .exe and .lib
files as outputs of executable build targets. Ninja would always re-link
executables with ENABLE_EXPORTS because the .lib output file was not
present, and therefore the target was out of date.

llvm-svn: 232662
2015-03-18 20:09:13 +00:00
Rafael Espindola 3d86b23511 Fix use of uninitialized valued.
Should bring the bots back.

llvm-svn: 232661
2015-03-18 19:49:29 +00:00
Simon Pilgrim 5c837edc2a [X86][SSE] Avoid scalarization of v2i64 vector shifts
Currently v2i64 vectors shifts (non-equal shift amounts) are scalarized, costing 4 x extract, 2 x x86-shifts and 2 x insert instructions - and it gets even more awkward on 32-bit targets.

This patch separately shifts the vector by both shift amounts and then shuffles the partial results back together, costing 2 x shuffles and 2 x sse-shifts instructions (+ 2 movs on pre-AVX hardware).

Note - this patch only improves the SHL / LSHR logical shifts as only these are supported in SSE hardware.

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

llvm-svn: 232660
2015-03-18 19:35:31 +00:00
Colin LeMahieu fc32b1b874 [Objdump] DumpBytes of uint8_t from ArrayRef<uint8_t> instead of char from StringRef. Removing reinterpret_casts.
llvm-svn: 232659
2015-03-18 19:27:31 +00:00
Rafael Espindola 105270f68c Add a default implementation of createObjectStreamer.
This removes duplicated code from backends that don't need to do anything
fancy.

llvm-svn: 232658
2015-03-18 19:08:20 +00:00
Krzysztof Parzyszek 36ccfa5779 [Hexagon] Use pseudo-instructions for true/false predicate values
llvm-svn: 232657
2015-03-18 19:07:53 +00:00
Krzysztof Parzyszek 7a9cd80f54 Revert "[Hexagon] Use pseudo-instructions for true/false predicate values"
This reverts r232650.

Missed a piece of code in the previous commit.

llvm-svn: 232656
2015-03-18 18:50:06 +00:00
Colin LeMahieu 916c3b423a [Objdump] Removing size limit on DumpBytes and changing to range based for loop.
llvm-svn: 232654
2015-03-18 18:41:23 +00:00
Matthias Braun 3b36533112 TableGen: Fix register class lane masks being too conservative.
When calculating the lanemask of a register class we have to include the
masks of subregisters supported by any of the class members, not just
the ones supported by all class members.

This fixes problems when coalescing towards a subclass with additional
subregisters available.

The attached testcase works fine as is, but does crash if you enable
subregister liveness on x86 without this change applied.

llvm-svn: 232652
2015-03-18 17:56:09 +00:00
Rafael Espindola 38438bae21 Handle X86::reloc_riprel_4byte in 32 bits mode.
We can get there with .code64.

Fixes pr22349.

llvm-svn: 232651
2015-03-18 17:33:40 +00:00