Commit Graph

201889 Commits

Author SHA1 Message Date
Duncan P. N. Exon Smith 03b7a1cf93 AsmPrinter: Extract DwarfStringPoolEntry from DwarfStringPool, NFC
Extract out `DwarfStringPoolEntry` and `DwarfStringPoolRef` from
`DwarfStringPool` so that downstream users can start using
`DwarfStringPool::getEntry()` directly.  This will allow users to delay
the decision between emitting a symbol or an offset until later.

llvm-svn: 238116
2015-05-24 16:33:33 +00:00
Simon Atanasyan 0b22359858 [ELF] Fix lld when no unique sections is used
Original patch of Shankar Easwaran with additional test case.
The yaml2obj does not allow to create an object file with non-unique
sections names so the fix uses a binary input object file in the test
case.

llvm-svn: 238115
2015-05-24 16:19:27 +00:00
Duncan P. N. Exon Smith 1a65e4ade4 AsmPrinter: Emit the DwarfStringPool offset directly when possible
Change `DwarfStringPool` to calculate byte offsets on-the-fly, and
update `DwarfUnit::getLocalString()` to use a `DIEInteger` instead of a
`DIEDelta` when Dwarf doesn't use relocations (i.e., Mach-O).  This
eliminates another call to `EmitLabelDifference()`, and drops memory
usage from 865 MB down to 861 MB, around 0.5%.

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

llvm-svn: 238114
2015-05-24 16:14:59 +00:00
Duncan P. N. Exon Smith 004e73420d DebugInfo: Clarify test/DebugInfo/X86/stmt-list-multiple-compile-units.ll
This test was relying on the numbering of preceding .set directives, but
an upcoming commit is going to remove some of them.  Make the CHECKs
more nuanced.

llvm-svn: 238113
2015-05-24 16:10:35 +00:00
Duncan P. N. Exon Smith 8c6499fa6d AsmPrinter: Refactor DwarfStringPool::getEntry(), NFC
Move `DwarfStringPool`'s `getEntry()` to the header (and make it a
member function) in preparation for calculating symbol offsets
on-the-fly.

llvm-svn: 238112
2015-05-24 16:06:08 +00:00
Vince Harron 13d7728c3d Remove log2 dependency when building against Android API-9 SDK
Android's API-9 SDK is missing log2 builtins. A previous commit added
support for building against this API revision but this requires log2l
to be present.  (And it doesn't seem to be defined, despite being in
the headers.)

Author: pasaulais (Pierre-Andre Saulais)

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

llvm-svn: 238111
2015-05-24 13:24:31 +00:00
Renato Golin fe54d34bc6 Move parseSubArch to ARMTargetParser. NFC
Using getCanonicalArchName() is the right way to parse ARM arch names.

Mapping ARMTargetParser IDs to Triple Arch IDs is temporary, until they
are merged into a TargetDescription class.

This was the last LLVM FIXME to move things to ARMTargetParser. Now on
to Clang and beyond.

llvm-svn: 238110
2015-05-24 11:18:44 +00:00
Evgeniy Stepanov 45328240dc [msan] Mprotect all inaccessible memory regions.
Fix 2 bugs in memory mapping setup:
- the invalid region at offset 0 was not protected because mmap at
  address 0 fails with EPERM on most Linux systems. We did not
  notice this because the check condition was flipped: the code was
  checking that mprotect has failed. And the test that was supposed
  to catch this was weakened by the mitigations in the mmap
  interceptor.
- when running without origins, the origin shadow range was left
  unprotected.

The new test ensures that mmap w/o MAP_FIXED always returns valid
application addresses.

llvm-svn: 238109
2015-05-24 02:47:59 +00:00
Matt Arsenault 65ad1602b0 Add target hook to allow merging stores of nonzero constants
On GPU targets, materializing constants is cheap and stores are
expensive, so only doing this for zero vectors was silly.

Most of the new testcases aren't optimally merged, and are for
later improvements.

llvm-svn: 238108
2015-05-24 00:51:27 +00:00
Davide Italiano dc4c87f051 [Support/ELF] Add missing DF_1_XXX bits.
In preparation for adding support for decoding DF_FLAGS_1 to
llvm-readobj.

Differential Revision:	http://reviews.llvm.org/D9955
Reviewed by:	echristo

llvm-svn: 238107
2015-05-23 23:08:28 +00:00
David Majnemer dcecd93196 [Driver] Unbreak hexagon build bots
AddHexagonTargetArgs didn't respect the driver flags by unconditionally
pushing -fno-signed-char.  Instead, add Hexagon handling to
isSignedCharDefault.

llvm-svn: 238106
2015-05-23 19:23:55 +00:00
David Majnemer c3658d2f24 [Driver] Handle -fno-signed-char and -fno-unsigned-char
GCC maps -fno-unsigned-char to -fsigned-char and -fno-signed-char to
-funsigned-char.

llvm-svn: 238105
2015-05-23 18:48:37 +00:00
Benjamin Kramer 1577f1f484 Bump SmallString to the minimum required amount for raw_ostream to avoid allocation.
NFC.

llvm-svn: 238104
2015-05-23 17:20:53 +00:00
Benjamin Kramer 33b4691fd0 [Mips] Prefer Twine::utohexstr over utohexstr, saves a string copy.
NFC.

llvm-svn: 238103
2015-05-23 16:53:07 +00:00
Benjamin Kramer be48c40475 [AArch64] Clean up the ELF streamer a bit.
llvm-svn: 238102
2015-05-23 16:39:10 +00:00
Benjamin Kramer 1d1b9243d5 [AArch64] Move AArch64TargetStreamer out of MCStreamer.h
It doesn't belong in the shared MC layer. NFC.

llvm-svn: 238101
2015-05-23 16:15:10 +00:00
Andrew Wilkins 4ffbbd7da7 [llgo] cmd/llgoi: use line editor
Summary:
This diff adds line-editing to llgoi, by
vendoring and using github.com/peterh/liner.
I have only implemented the basics here;
follow-ups will come later to add persisted
history, and completion,

Reviewers: pcc

Reviewed By: pcc

Subscribers: axw, llvm-commits

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

llvm-svn: 238100
2015-05-23 15:16:09 +00:00
Aaron Ballman c681c3d890 Silencing a spurious -Wreturn-type warning; NFC.
llvm-svn: 238099
2015-05-23 14:46:49 +00:00
Szabolcs Sipos 0acf19ed53 [clang-tidy] Fix for llvm.org/PR23572
misc-static-assert won't report asserts whose conditions contain calls to non constexpr functions.

llvm-svn: 238098
2015-05-23 14:21:01 +00:00
Hal Finkel 5f2a1379ef [PowerPC] Fix fast-isel when compare is split from branch
When the compare feeding a branch was in a different BB from the branch, we'd
try to "regenerate" the compare in the block with the branch, possibly trying
to make use of values not available there. Copy a page from AArch64's play book
here to fix the problem (at least in terms of correctness).

Fixes PR23640.

llvm-svn: 238097
2015-05-23 12:18:10 +00:00
NAKAMURA Takumi b558e5fb65 Update ExecutionEngine/LLVMBuild.txt, to add LLVMCodeGen.
llvm-svn: 238096
2015-05-23 10:44:30 +00:00
Craig Topper 10949ae742 Give more meaningful names than I and J to some for loop variables after converting to range-based loops.
llvm-svn: 238095
2015-05-23 08:45:10 +00:00
Craig Topper 37d0d866f4 Fix an unused variable warning in release builds.
llvm-svn: 238094
2015-05-23 08:20:33 +00:00
Craig Topper 77b9941ab9 Use range-based for loops. NFC.
llvm-svn: 238093
2015-05-23 08:01:41 +00:00
Tobias Grosser 2d7611f45e Remove unnecessary indirection through SCEV
llvm-svn: 238092
2015-05-23 05:58:30 +00:00
Tobias Grosser ab6714464a Use unique_ptr to clarify ownershop of ScopArrayInfoMap
llvm-svn: 238091
2015-05-23 05:58:27 +00:00
Tobias Grosser 679dfafd33 Use unique_ptr to clarify ownership of ScopStmt
llvm-svn: 238090
2015-05-23 05:14:09 +00:00
Greg Clayton 5df78fa35b Did some cleanup to stop us from leaking Pipe file descriptors.
The main issue was the Communication::Disconnect() was calling its Connection::Disconnect() but this wouldn't release the pipes that the ConnectionFileDescriptor was using. We also have someone that is holding a strong reference to the Process so that when you re-run, target replaces its m_process_sp, but it doesn't get destructed because someone has a strong reference to it. I need to track that down. But, even if we have a strong reference to the a process that is outstanding, we need to call Process::Finalize() to have it release as much of its resources as possible to avoid memory bloat. 

Removed the ProcessGDBRemote::SetExitStatus() override and replaced it with ProcessGDBRemote::DidExit().

Now we aren't leaking file descriptors and the stand alone test suite should run much better.

llvm-svn: 238089
2015-05-23 03:54:53 +00:00
Tobias Grosser ac60f4594f Enable scalar and PHI code generation for Polly
The feature itself has been committed by Johannes in r238070. As this is the
way forward, we now enable it to ensure we get test coverage.

Thank you Johannes for this nice work!

llvm-svn: 238088
2015-05-23 03:34:41 +00:00
Tobias Grosser 268205939f Make use of scalar/phi code generation explicit in the tests
This ensures we pass all tests independently of how we set the options
-disable-polly-intra-scop-scalar-to-array and -polly-model-phi-nodes.

(At least if we enable both or disable both. Enabling them individually makes
 little sense, as they will hopefully disappear soon anyhow).

llvm-svn: 238087
2015-05-23 03:34:35 +00:00
Kostya Serebryany e0d60ba876 [lib/Fuzzer] doxygen-ify the comments for the user interface
llvm-svn: 238086
2015-05-23 02:12:05 +00:00
Kostya Serebryany 05425a88cd [dfsan] ignore more __sanitizer callbacks
llvm-svn: 238085
2015-05-23 01:56:39 +00:00
Duncan P. N. Exon Smith 68b3f30778 AsmPrinter: Remove the vtable-entry from DIEValue
Remove all virtual functions from `DIEValue`, dropping the vtable
pointer from its layout.  Instead, create "impl" functions on the
subclasses, and use the `DIEValue::Type` to implement the dynamic
dispatch.

This is necessary -- obviously not sufficient -- for passing `DIEValue`s
around by value.  However, this change stands on its own: we make tons
of these.  I measured a drop in memory usage from 888 MB down to 860 MB,
or around 3.2%.

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

llvm-svn: 238084
2015-05-23 01:45:07 +00:00
David Majnemer 7800f1f5aa [Sema] Don't use dyn_cast to detect an AtomicType
An AtomicType might be hidden behind arbitrary levels of typedefs.
getAs<> will reliably walk through the sugar to get the underlying
AtomicType.

This fixes PR23638.

llvm-svn: 238083
2015-05-23 01:32:17 +00:00
Duncan P. N. Exon Smith d5aa33525c CodeGen: Remove redundant DIETypeSignature::dump(), NFC
We already have this in `DIEValue`; no reason to shadow it.

llvm-svn: 238082
2015-05-23 01:26:26 +00:00
Kostya Serebryany 7c180eafc1 [lib/Fuzzer] fully get rid of std::cerr in libFuzzer
llvm-svn: 238081
2015-05-23 01:22:35 +00:00
Akira Hatanaka ddf76aa36f Stop resetting NoFramePointerElim in TargetMachine::resetTargetOptions.
This is part of the work to remove TargetMachine::resetTargetOptions.

In this patch, instead of updating global variable NoFramePointerElim in
resetTargetOptions, its use in DisableFramePointerElim is replaced with a call
to TargetFrameLowering::noFramePointerElim. This function determines on a
per-function basis if frame pointer elimination should be disabled.

There is no change in functionality except that cl:opt option "disable-fp-elim"
can now override function attribute "no-frame-pointer-elim". 

llvm-svn: 238080
2015-05-23 01:14:08 +00:00
Akira Hatanaka bd881834c5 Simplify and rename function overrideFunctionAttributes. NFC.
This is in preparation to making changes needed to stop resetting
NoFramePointerElim in resetTargetOptions.

llvm-svn: 238079
2015-05-23 01:12:26 +00:00
Kostya Serebryany 20e9bcbfc8 [lib/Fuzzer] start getting rid of std::cerr. Sadly, these parts of C++ library used in libFuzzer badly interract with the same code used in the target function and also with dfsan. It's easier to just not use std::cerr than to defeat these issues.
llvm-svn: 238078
2015-05-23 01:07:46 +00:00
Akira Hatanaka aa115fbb7b Remove unnecessary command line option "-disable-fp-elim".
This option currently has no effect as function attribute
"no-frame-pointer-elim=false" overrides it.

llvm-svn: 238077
2015-05-23 00:31:56 +00:00
Rafael Espindola 992c6fa5db This reverts commit r238064 and r238055.
They depend on a reverted llvm commit.

llvm-svn: 238076
2015-05-23 00:30:33 +00:00
Rafael Espindola 445712264d Revert "make reciprocal estimate code generation more flexible by adding command-line options"
This reverts commit r238051.

It broke some bots:

http://lab.llvm.org:8011/builders/llvm-ppc64-linux1/builds/18190

llvm-svn: 238075
2015-05-23 00:22:44 +00:00
Philip Reames 6bbe9743d1 Correct a mistaken comment from 238071 [NFC]
llvm-svn: 238074
2015-05-23 00:05:43 +00:00
Rafael Espindola 5960cee1f5 Produce a single string table in a ELF .o
Normally an ELF .o has two string tables, one for symbols, one for section
names.

With the scheme of naming sections like ".text.foo" where foo is a symbol,
there is a big potential saving in using a single one.

Building llvm+clang+lld with master and with this patch the results were:

master:                          193,267,008 bytes
patch:                           186,107,952 bytes
master non unique section names: 183,260,192 bytes
patch non unique section names:  183,118,632 bytes

So using non usique saves 10,006,816 bytes, and the patch saves 7,159,056 while
still using distinct names for the sections.

llvm-svn: 238073
2015-05-22 23:58:30 +00:00
Lang Hames 825e258fc3 [lld] Manage atom ordinals in the File class rather than using a static counter.
This is a cleaner fix for the race-condition bug that was originally papered
over by r237857.

llvm-svn: 238072
2015-05-22 23:56:44 +00:00
Philip Reames 7c78ef7dd9 Extend EarlyCSE to handle basic cases from JumpThreading and CVP
This patch extends EarlyCSE to take advantage of the information that a controlling branch gives us about the value of a Value within this and dominated basic blocks. If the current block has a single predecessor with a controlling branch, we can infer what the branch condition must have been to execute this block. The actual change to support this is downright simple because EarlyCSE's existing scoped hash table logic deals with most of the complexity around merging.

The patch actually implements two optimizations.
1) The first is analogous to JumpThreading in that it enables EarlyCSE's CSE handling to fold branches which are exactly redundant due to a previous branch to branches on constants. (It doesn't actually replace the branch or change the CFG.) This is pretty clearly a win since it enables substantial CFG simplification before we start trying to inline.
2) The second is analogous to CVP in that it exploits the knowledge gained to replace dominated *uses* of the original value. EarlyCSE does not otherwise reason about specific uses, so this is the more arguable one. It does enable further simplication and constant folding within the rest of the visit by EarlyCSE.

In both cases, the added code only handles the easy dominance based case of each optimization. The general case is deferred to the existing passes.

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

llvm-svn: 238071
2015-05-22 23:53:24 +00:00
Johannes Doerfert ecff11dcfb Add scalar and phi code generation
To reduce compile time and to allow more and better quality SCoPs in
  the long run we introduced scalar dependences and PHI-modeling. This
  patch will now allow us to generate code if one or both of those
  options are set. While the principle of demoting scalars as well as
  PHIs to memory in order to communicate their value stays the same,
  this allows to delay the demotion till the very end (the actual code
  generation). Consequently:
    - We __almost__ do not modify the code if we do not generate code
      for an optimized SCoP in the end. Thus, the early exit as well as
      the unprofitable option will now actually preven us from
      introducing regressions in case we will probably not get better
      code.
    - Polly can be used as a "pure" analyzer tool as long as the code
      generator is set to none.
    - The original SCoP is almost not touched when the optimized version
      is placed next to it. Runtime regressions if the runtime checks
      chooses the original are not to be expected and later
      optimizations do not need to revert the demotion for that part.
    - We will generate direct accesses to the demoted values, thus there
      are no "trivial GEPs" that select the first element of a scalar we
      demoted and treated as an array.

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

llvm-svn: 238070
2015-05-22 23:43:58 +00:00
Oleksiy Vyalov 755d58a463 Use target's SIGSTOP and SIGINT when making decision about continue after async packet.
http://reviews.llvm.org/D9857

llvm-svn: 238068
2015-05-22 23:14:39 +00:00
David Majnemer 4c3753c4d4 [InstCombine] Don't eagerly propagate nsw for A*B+A*C => A*(B+C)
InstCombine transforms A *nsw B +nsw A *nsw C to A *nsw (B + C).
This is incorrect -- e.g. if A = -1, B = 1, C = INT_SMAX. Then
nothing in the LHS overflows, but the multiplication in RHS overflows.

We need to first make sure that we won't multiple by INT_SMAX + 1.

Test case `add_of_mul` contributed by Sanjoy Das.

This fixes PR23635.

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

llvm-svn: 238066
2015-05-22 23:02:11 +00:00
Greg Clayton 25f82aae57 Fix this module to work with current packects and also to be able to figure out average packets speed and standard deviation.
llvm-svn: 238065
2015-05-22 23:00:59 +00:00