Commit Graph

268827 Commits

Author SHA1 Message Date
Philip Pfaffe b24beb6f46 [NFC] ScopPass: Remove unused AnalysisKey from OwningInnerAnalysisManagerProxy
llvm-svn: 310036
2017-08-04 08:12:31 +00:00
Haojian Wu dc1c7610b8 [clang-tidy] Support initializer-list constructor cases in modernize-make-unique.
Reviewers: alexfh

Reviewed By: alexfh

Subscribers: malcolm.parsons, JDevlieghere, xazax.hun, cfe-commits

Differential Revision: https://reviews.llvm.org/D36016

llvm-svn: 310035
2017-08-04 08:07:05 +00:00
Max Kazantsev 9505470033 Do not declare a variable which is used only in assert. NFC
llvm-svn: 310034
2017-08-04 07:41:24 +00:00
Benjamin Kramer 7fba72e97b [msan] Switch the pvalloc overflow test to a lit test
The test was not passing on targets where allocator_may_return_null
defaults to true. Change the test to a lit test so that we can test both
situations.

Patch by Kostya Kortchinsky!

Differential Revision: https://reviews.llvm.org/D36302

llvm-svn: 310033
2017-08-04 07:32:10 +00:00
Max Kazantsev 2f6ae28152 [IRCE] Handle loops with step different from 1/-1
This patch generalizes IRCE to handle IV steps that are not equal to 1 or -1.

Differential Revision: https://reviews.llvm.org/D35539

llvm-svn: 310032
2017-08-04 07:01:04 +00:00
Stanislav Mekhanoshin 6c7a8d0b5f [AMDGPU] Preserve inverted bit in SI_IF in presence of SI_KILL
In case if SI_KILL is in between of the SI_IF and SI_END_CF we need
to preserve the bits actually flipped by if rather then restoring
the original mask.

Differential Revision: https://reviews.llvm.org/D36299

llvm-svn: 310031
2017-08-04 06:58:42 +00:00
NAKAMURA Takumi 8e72a07efe Revert r309984, "Use "foo-12345.o" instead of "foo.o-12345" as temporary file name."
It generates MODULE-XXXXXXXXXXXX-%%%%%%%%.pcm, then GlobalModuleIndex.cpp is confused with the suffix ".pcm"

llvm-svn: 310030
2017-08-04 06:35:32 +00:00
Max Kazantsev 6e724762b1 Avoid comparison between signed and unsigned in SCEVExitLimitForget tests
llvm-svn: 310029
2017-08-04 06:03:51 +00:00
Dylan McKay 0547447831 [AVR] Update target machine to use new constructor parameters
The required parameters were changed in r309911.

llvm-svn: 310028
2017-08-04 05:48:20 +00:00
Max Kazantsev 07da1ab23a [IRCE] Recognize loops with unsigned latch conditions
This patch enables recognition of loops with ult/ugt latch conditions.

Differential Revision: https://reviews.llvm.org/D35302

llvm-svn: 310027
2017-08-04 05:40:20 +00:00
Petr Hosek b1bb3e542e Revert "[llvm][llvm-objcopy] Added support for outputting to binary in llvm-objcopy"
This breaks the build on clang-s390x-linux.

This reverts commit r310018.

llvm-svn: 310026
2017-08-04 05:33:44 +00:00
Craig Topper c2d3c631ff [InstCombine] Move the call to foldSelectICmpAnd into foldSelectInstWithICmp. NFCI
llvm-svn: 310025
2017-08-04 05:12:37 +00:00
Craig Topper a86ca08d26 [InstCombine] Remove unnecessary casts. NFC
We're calling an overload of getOpcode that already returns Instruction::CastOps.

llvm-svn: 310024
2017-08-04 05:12:35 +00:00
Max Kazantsev ba1e70e060 Fix SCEVExitLimitForget tests to make Sanitizer happy
llvm-svn: 310023
2017-08-04 05:06:44 +00:00
Daniel Jasper 3f47a5c054 Prevent unused warning in non-assert builds (introduced in r310014).
llvm-svn: 310022
2017-08-04 05:05:29 +00:00
Victor Leschuk 56b03d0dd6 Un-revert r310014: false revert, it wasn't the cause of build break
llvm-svn: 310021
2017-08-04 04:51:15 +00:00
Victor Leschuk 21713ebfb1 Revert r310014 as it breaks build lld-x86_64-darwin13
llvm-svn: 310020
2017-08-04 04:43:54 +00:00
Vedant Kumar 0b48042a65 Revert "[coverage] Special-case calls to noreturn functions."
This reverts commit r309995. It looks like it's responsible for breaking
the stage2 coverage build:

http://green.lab.llvm.org/green/job/clang-stage2-coverage-R_build/1402

The cfe-commits discussion re: r309995 has more context.

llvm-svn: 310019
2017-08-04 04:08:23 +00:00
Petr Hosek 10fbc733d0 Reland "[llvm][llvm-objcopy] Added support for outputting to binary in llvm-objcopy"
This change adds the "-O binary" flag which directs llvm-objcopy to
output the object file to the same format as GNU objcopy does when given
the flag "-O binary". This was done by splitting the Object class into
two subclasses ObjectELF and ObjectBianry which each output a different
format but relay on the same code to read in the Object in Object.

Patch by Jake Ehrlich

Differential Revision: https://reviews.llvm.org/D34480

llvm-svn: 310018
2017-08-04 03:17:37 +00:00
Petr Hosek 83214dfb01 [Driver][Fuchsia] Pass --hash-style=gnu to the linker
The .gnu_hash format is superior, and all versions of the Fuchsia
dynamic linker support it.

Differential Revision: https://reviews.llvm.org/D36254

llvm-svn: 310017
2017-08-04 02:39:27 +00:00
Reid Kleckner 02aeadcf3d [Support] Update comments about stdout, raw_fd_ostream, and outs()
The full story is in the comments:

  // Do not attempt to close stdout or stderr. We used to try to maintain the
  // property that tools that support writing file to stdout should not also
  // write informational output to stdout, but in practice we were never able to
  // maintain this invariant. Many features have been added to LLVM and clang
  // (-fdump-record-layouts, optimization remarks, etc) that print to stdout, so
  // users must simply be aware that mixed output and remarks is a possibility.

NFC, I am just updating comments to reflect reality.

llvm-svn: 310016
2017-08-04 01:39:23 +00:00
Vedant Kumar 696e3847dd coverage: Update tests to reflect changes from r310012
llvm-svn: 310015
2017-08-04 01:22:19 +00:00
Adrian Prantl fd8c8e9fe6 Teach GlobalSRA to update the debug info for split-up globals.
This is similar to what we are doing in "regular" SROA and creates
DW_OP_LLVM_fragment operations to describe the resulting variables.

rdar://problem/33654891

llvm-svn: 310014
2017-08-04 01:19:54 +00:00
Connor Abbott 00755362b9 [AMDGPU] Add missing hazard for DPP-after-EXEC-write
Summary:
Following the docs, we need at least 5 wait states between an EXEC write
and an instruction that uses DPP.

Reviewers: tstellar, arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits

Differential Revision: https://reviews.llvm.org/D34849

llvm-svn: 310013
2017-08-04 01:09:43 +00:00
Vedant Kumar 846b985a92 [llvm-cov] Ignore unclosed line segments when setting line counts
This patch makes a slight change to the way llvm-cov determines line
execution counts. If there are multiple line segments on a line, the
line count is the max count among the regions which start *and* end on
the line. This avoids an issue posed by deferred regions which start on
the same line as a terminated region, e.g:

  if (false)
    return; //< The line count should be 0, even though a new region
            //< starts at the semi-colon.
  foo();

Another change is that counts from line segments which don't correspond
to region entries are considered. This enables the first change, and
corrects an outstanding issue (see the showLineExecutionCounts.cpp test
change).

This is related to D35925.

Testing: check-profile, llvm-cov lit tests

Differential Revision: https://reviews.llvm.org/D36014

llvm-svn: 310012
2017-08-04 00:36:24 +00:00
Vedant Kumar 8a6223887c [llvm-cov] NFC: make_unique-ify two allocations
llvm-svn: 310011
2017-08-04 00:36:24 +00:00
Vedant Kumar 85e6dce1eb [Coverage] Precise region termination with deferred regions
The current coverage implementation doesn't handle region termination
very precisely. Take for example an `if' statement with a `return':

  void f() {
    if (true) {
      return; // The `if' body's region is terminated here.
    }
    // This line gets the same coverage as the `if' condition.
  }

If the function `f' is called, the line containing the comment will be
marked as having executed once, which is not correct.

The solution here is to create a deferred region after terminating a
region. The deferred region is completed once the start location of the
next statement is known, and is then pushed onto the region stack.
In the cases where it's not possible to complete a deferred region, it
can safely be dropped.

Testing: lit test updates, a stage2 coverage-enabled build of clang
llvm-svn: 310010
2017-08-04 00:29:20 +00:00
George Karpenkov 5bd0503680 Disable libFuzzer tests on Windows
Differential Revision: https://reviews.llvm.org/D36297

llvm-svn: 310009
2017-08-04 00:26:12 +00:00
Vitaly Buka da611dc630 Revert "[TableGen] AsmMatcher: fix OpIdx computation when HasOptionalOperands is true"
Breaks check-llvm under ubsan.

This reverts commit r309949.

llvm-svn: 310008
2017-08-04 00:25:24 +00:00
Matt Arsenault 5c921a9291 AMDGPU: Remove pointless asserts
llvm-svn: 310007
2017-08-04 00:00:13 +00:00
Akira Hatanaka b72e35a4c4 [Driver][Darwin] Pass -munwind-table when !UseSjLjExceptions.
This commit fixes a bug where clang/llvm doesn't emit an unwind table
for a function when it is marked noexcept. Without this patch, the
following code terminates with an uncaught exception on ARM64:

int foo1() noexcept {
  try {
    throw 0;
  } catch (int i) {
    return 0;
  }
  return 1;
}

int main() {
  return foo1();
}

rdar://problem/32411865

Differential Revision: https://reviews.llvm.org/D35693

llvm-svn: 310006
2017-08-03 23:55:42 +00:00
Teresa Johnson 8482e56920 Use profile summary to disable peeling for huge working sets
Summary:
Detect when the working set size of a profiled application is huge,
by comparing the number of counts required to reach the hot percentile
in the profile summary to a large threshold*.

When the working set size is determined to be huge, disable peeling
to avoid bloating the working set further.

*Note that the selected threshold (15K) is significantly larger than the
largest working set value in SPEC cpu2006 (which is gcc at around 11K).

Reviewers: davidxl

Subscribers: mehdi_amini, mzolotukhin, eraman, llvm-commits

Differential Revision: https://reviews.llvm.org/D36288

llvm-svn: 310005
2017-08-03 23:42:58 +00:00
Matt Arsenault a176cc5b93 AMDGPU: Don't use report_fatal_error for unsupported call types
llvm-svn: 310004
2017-08-03 23:32:41 +00:00
Matt Arsenault a202538bfa AMDGPU: Remove error on calls for amdgcn
Repurpose the -amdgpu-function-calls flag. Rather
than require it to emit a call, only use it to
run the always inline path or not.

llvm-svn: 310003
2017-08-03 23:24:05 +00:00
Matt Arsenault 817c253e60 AMDGPU: Fix implicitarg.ptr handling special inputs
llvm-svn: 310002
2017-08-03 23:12:44 +00:00
Martell Malone 346a5fdc9b Support: WOA64 and WOA Signals
Reviewers: rnk

Differential Revision: https://reviews.llvm.org/D21813

llvm-svn: 310001
2017-08-03 23:12:33 +00:00
Zachary Turner 5869936844 [llvm-pdbutil] Add an option to only dump specific module indices.
Often something interesting (like a symbol) is in a particular
module, and you don't want to dump symbols from all other 300
modules to see the one you want.  This adds a -modi option so that
we only dump the specified module.

llvm-svn: 310000
2017-08-03 23:11:52 +00:00
Petr Hosek b31582b196 Enable AddressSanitizer for Fuchsia targets
Patch by Roland McGrath

Differential Revision: https://reviews.llvm.org/D35922

llvm-svn: 309999
2017-08-03 23:02:22 +00:00
Matt Arsenault 8623e8d864 AMDGPU: Pass special input registers to functions
llvm-svn: 309998
2017-08-03 23:00:29 +00:00
Eric Christopher 52854dcd34 Fix typo.
llvm-svn: 309997
2017-08-03 22:41:12 +00:00
Matt Arsenault 7016f13450 AMDGPU: Add analysis pass for function argument info
This will allow only adding necessary inputs to callee functions
that need special inputs forwarded from the kernel.

llvm-svn: 309996
2017-08-03 22:30:46 +00:00
Eli Friedman 2d30c64ae3 [coverage] Special-case calls to noreturn functions.
The code after a noreturn call doesn't execute.

The pattern in the testcase is pretty common in LLVM (a switch with
a default case that calls llvm_unreachable).

Differential Revision: https://reviews.llvm.org/D36250

llvm-svn: 309995
2017-08-03 22:27:36 +00:00
Easwaran Raman 974d4eea93 [Inliner] Increase threshold for hot callsites without PGO.
Summary:
This increases the inlining threshold for hot callsites. Hotness is
defined in terms of block frequency of the callsite relative to the
caller's entry block's frequency. Since this requires BFI in the
inliner, this only affects the new PM pipeline. This is enabled by
default at -O3.

This improves the performance of some internal benchmarks. Notably, an
internal benchmark for Gipfeli compression
(https://github.com/google/gipfeli) improves by ~7%. Povray in SPEC2006
improves by ~2.5%. I am running more experiments and will update the
thread if other benchmarks show improvement/regression.

In terms of text size, LLVM test-suite shows an 1.22% text size
increase. Diving into the results, 13 of the benchmarks in the
test-suite increases by > 10%. Most of these are small, but
Adobe-C++/loop_unroll (17.6% increases) and tramp3d(20.7% size increase)
have >250K text size. On a large application, the text size increases by
2%

Reviewers: chandlerc, davidxl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D36199

llvm-svn: 309994
2017-08-03 22:23:33 +00:00
Eugene Zelenko 79220eaeec [Mips] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 309993
2017-08-03 22:12:30 +00:00
Michael Kruse 1046aa3148 [VirtualInstruction] Handle MetadataAsValue as constant.
The complication of bspatch.cc of the AOSP buildbot currently fails
presumably because the occurance of a MetadataAsValue in an operand.
This kind of value can occur as operands of intrinsics, the typical
example being the debug intrinsics.

Polly currently ignores the debug intrinsics and it is not yet clear
which other intrinic might occur. For such cases, and to unbreak the
AOSP buildbot, treat a MetadataAsValue as a constant because it can be
referenced without modification in generated code.

llvm-svn: 309992
2017-08-03 22:00:01 +00:00
Matt Arsenault a52391f2db DAG: Provide access to Pass instance from SelectionDAG
This allows accessing an analysis pass during lowering.

llvm-svn: 309991
2017-08-03 21:54:00 +00:00
Quentin Colombet 250e050a50 [GlobalISel] Make GlobalISel a non-optional library.
With this change, the GlobalISel library gets always built. In
particular, this is not possible to opt GlobalISel out of the build
using the LLVM_BUILD_GLOBAL_ISEL variable any more.

llvm-svn: 309990
2017-08-03 21:52:25 +00:00
Reid Kleckner a5d3909678 [PDB] Loosen checks for section contribution sizes
The PDB debug data directory entry has an absolute path in it. This will
make it different on every machine.

llvm-svn: 309989
2017-08-03 21:20:41 +00:00
Davide Italiano 5974c31d91 [NewGVN] Fix the case where we have a phi-of-ops which goes away.
Patch by Daniel Berlin, fixes PR33196 (and probably something else).

llvm-svn: 309988
2017-08-03 21:17:49 +00:00
Reid Kleckner 175af4bcc7 [PDB] Fix section contributions
Summary:
PDB section contributions are supposed to use output section indices and
offsets, not input section indices and offsets.

This allows the debugger to look up the index of the module that it
should look up in the modules stream for symbol information. With this
change, windbg can now find line tables, but it still cannot print local
variables.

Fixes PR34048

Reviewers: zturner

Subscribers: hiraditya, ruiu, llvm-commits

Differential Revision: https://reviews.llvm.org/D36285

llvm-svn: 309987
2017-08-03 21:15:09 +00:00