Commit Graph

21297 Commits

Author SHA1 Message Date
Sanjay Patel
ed0b7a0b1a remove function names from comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219803 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-15 16:20:45 +00:00
Duncan P. N. Exon Smith
03631a8ad5 DI: Cleanup comments, NFC
A number of comment cleanups:

  - Remove duplicated function and class names from comments.

  - Remove duplicated comments from source file (some of which were
    out-of-sync).

  - Move any unduplicated comments from source file to header.

  - Remove some noisy comments entirely (e.g., a comment for
    `DIDescriptor::print()` saying "print descriptor" just gets in the
    way of reading the code).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219801 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-15 16:15:15 +00:00
Rafael Espindola
90ce9f70e2 Simplify handling of --noexecstack by using getNonexecutableStackSection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219799 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-15 16:12:52 +00:00
Duncan P. N. Exon Smith
5c2d60d357 DI: Use a DenseMap instead of named metadata, NFC
Remove a strange round-trip through named metadata to assign preserved
local variables to their subprograms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219798 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-15 16:11:41 +00:00
Rafael Espindola
b510f8d08c Move getNonexecutableStackSection up to the base ELF class.
The .note.GNU-stack section is not SystemZ/X86 specific.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219796 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-15 15:44:16 +00:00
Gerolf Hoflehner
2bddd7cf65 [AAarch64] Optimize CSINC-branch sequence
Peephole optimization that generates a single conditional branch
for csinc-branch sequences like in the examples below. This is
possible when the csinc sets or clears a register based on a condition
code and the branch checks that register. Also the condition
code may not be modified between the csinc and the original branch.

Examples:

1. Convert csinc w9, wzr, wzr, <CC>;tbnz w9, #0, 0x44
   to b.<invCC>

2. Convert csinc w9, wzr, wzr, <CC>; tbz w9, #0, 0x44
   to b.<CC>


rdar://problem/18506500



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219742 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 23:07:53 +00:00
Hal Finkel
75277b9f70 [LoopVectorize] Ignore @llvm.assume for cost estimates and legality
A few minor changes to prevent @llvm.assume from interfering with loop
vectorization. First, treat @llvm.assume like the lifetime intrinsics, which
are scalarized (but don't otherwise interfere with the legality checking).
Second, ignore the cost of ephemeral instructions in the loop (these will go
away anyway during CodeGen).

Alignment assumptions and other uses of @llvm.assume can often end up inside of
loops that should be vectorized (this is not uncommon for assumptions generated
by __attribute__((align_value(n))), for example).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219741 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 22:59:49 +00:00
Sanjay Patel
3f349b2ba8 Optimize away fabs() calls when input is squared (known positive).
Eliminate library calls and intrinsic calls to fabs when the input 
is a squared value.

Note that no unsafe-math / fast-math assumptions are needed for
this optimization.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219717 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 20:43:11 +00:00
Jan Vesely
d6315ea5a5 Reapply "R600: Add new intrinsic to read work dimensions"
This effectively reverts revert 219707. After fixing the test to work with
new function name format and renamed intrinsic.

Reviewed-by: Tom Stellard <tom@stellard.net>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219710 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 20:05:26 +00:00
Rafael Espindola
e8e8db7ff6 Revert "R600: Add new intrinsic to read work dimensions"
This reverts commit r219705.

CodeGen/R600/work-item-intrinsics.ll was failing on linux.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219707 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 18:58:04 +00:00
Rafael Espindola
d1494d5ff3 Remove unused member variable.
Fixes pr20904.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219706 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 18:53:16 +00:00
Jan Vesely
6a529850f3 R600: Add new intrinsic to read work dimensions
v2: Add SI lowering
    Add test

v3: Place work dimensions after the kernel arguments.
v4: Calculate offset while lowering arguments
v5: rebase
v6: change prefix to AMDGPU

Reviewed-by: Tom Stellard <tom@stellard.net>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219705 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 18:52:07 +00:00
NAKAMURA Takumi
65e4aa4656 Revert r219638, (r219640 and r219676), "Removing the static destructor from ManagedStatic.cpp by controlling the allocation and de-allocation of the mutex."
It caused hang-up on msc17 builder, probably deadlock.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219687 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 15:58:16 +00:00
NAKAMURA Takumi
45ed68789b Threading.h: Use \tparam for template parameters. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219676 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 09:34:16 +00:00
Eric Christopher
3788687f31 Access the subtarget off of the MachineFunction rather than
through the TargetMachine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219661 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 06:26:53 +00:00
Eric Christopher
07d392bdf2 Don't include DFAPacketizer in TargetInstrInfo, there's no reason.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219653 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 01:13:53 +00:00
Eric Christopher
8ff8c16f58 Remove the TargetMachine from DFAPacketizer since it was only
being used to grab subtarget specific things that we can grab
from the MachineFunction anyhow.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219650 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 01:03:16 +00:00
Chris Bieneman
0df98b6821 Updating documentation as per Chandler's feedback.
This goes with the earlier commit to remove the static destructor from ManagedStatic.cpp by controlling the allocation and de-allocation of the mutex.

Summary: This is part of the ongoing work to remove static constructors and destructors.

Reviewers: chandlerc, rnk

Reviewed By: rnk

Subscribers: rnk, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219640 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13 23:03:45 +00:00
Chris Bieneman
3a143ce2e7 Removing the static destructor from ManagedStatic.cpp by controlling the allocation and de-allocation of the mutex.
This patch adds a new llvm_call_once function which is used by the ManagedStatic implementation to safely initialize a global to avoid static construction and destruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219638 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13 22:37:25 +00:00
Peter Collingbourne
7adaa03f7e Remove unused debug info constants.
These became unused in r219010.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219635 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13 21:50:30 +00:00
David Majnemer
dfe81adbce InstCombine: Don't miscompile (x lshr C1) udiv C2
We have a transform that changes:
  (x lshr C1) udiv C2
into:
  x udiv (C2 << C1)

However, it is unsafe to do so if C2 << C1 discards any of C2's bits.

This fixes PR21255.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219634 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13 21:48:30 +00:00
Richard Smith
f591f3755e [modules] Stop excluding Support/Debug.h from the Support module. This header
has been modular since r206822, and excluding it was leading to workarounds
such as the one in r219592, which this change removes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219593 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13 00:41:03 +00:00
Benjamin Kramer
b85e7ae9ab [Modules] Add some missing includes to make files compile stand-alone.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219592 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-12 22:49:26 +00:00
Benjamin Kramer
5defae6504 APSInt: Simplify code to reduce the number of copies. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219586 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-12 15:36:31 +00:00
Benjamin Kramer
8daea6b323 AssumptionTracker: Don't create temporary CallbackVHs.
Those are expensive to create in cold cache scenarios. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219575 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-11 19:13:01 +00:00
Benjamin Kramer
b1bba1a339 MC: Shrink MCSymbolRefExpr by only storing the bits we need.
32 -> 16 bytes on x86_64. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219574 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-11 17:57:27 +00:00
Benjamin Kramer
fedd0e2a21 MC: Bit pack MCSymbolData.
On x86_64 this brings it from 80 bytes to 64 bytes. Also make any member
variables private and clean up uses to go through the existing accessors.

NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219573 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-11 15:07:21 +00:00
Chandler Carruth
c13c09106e [SCEV] Add some asserts to the recently improved trip count computation
routines and fix all of the bugs they expose.

I hit a test case that crashed even without these asserts due to passing
a non-exiting latch to the ExitingBlock parameter of the trip count
computation machinery. However, when I add the nice asserts, it turns
out we have plenty of coverage of these bugs, they just didn't manifest
in crashers.

The core problem seems to stem from an assumption that the latch *is*
the exiting block. While this is often true, and somewhat the "normal"
way to think about loops, it isn't necessarily true. The correct way to
call the trip count routines in a *generic* fashion (that is, without
a particular exit in mind) is to just use the loop's single exiting
block if it has one. The trip count can't be computed generically unless
it does. This works great for the loop vectorizer. The loop unroller
actually *wants* to select the latch when it has to chose between
multiple exits because for unrolling it is the latch trips that matter.
But if this is the desire, it needs to explicitly guard for non-exiting
latches and check for the generic trip count in that case.

I've added the asserts, and added convenience APIs for querying the trip
count generically that check for a single exit block. I've kept the APIs
consistent between computing trip count and trip multiples.

Thansk to Mark for the help debugging and tracking down the *right* fix
here!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219550 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-11 00:12:11 +00:00
Alexey Samsonov
fcc00a10e3 Re-land r219354: Use llvm-symbolizer to symbolize LLVM/Clang crash dumps.
In fact, symbolization is now expected to work only on Linux and
FreeBSD/NetBSD, where we have dl_iterate_phdr and can learn the
main executable name without argv0 (it will be possible on BSD systems
after http://reviews.llvm.org/D5693 lands). #ifdef-out the code for
all the rest Unix systems.

Reviewed in http://reviews.llvm.org/D5610


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219534 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-10 22:06:59 +00:00
Mark Heffernan
ed05e3703e This patch de-pessimizes the calculation of loop trip counts in
ScalarEvolution in the presence of multiple exits. Previously all
loops exits had to have identical counts for a loop trip count to be
considered computable. This pessimization was implemented by calling
getBackedgeTakenCount(L) rather than getExitCount(L, ExitingBlock)
inside of ScalarEvolution::getSmallConstantTripCount() (see the FIXME
in the comments of that function). The pessimization was added to fix
a corner case involving undefined behavior (pr/16130). This patch more
precisely handles the undefined behavior case allowing the pessimization
to be removed.

ControlsExit replaces IsSubExpr to more precisely track the case where
undefined behavior is expected to occur. Because undefined behavior is
tracked more precisely we can remove MustExit from ExitLimit. MustExit
was used to track the case where the limit was computed potentially
assuming undefined behavior even if undefined behavior didn't necessarily
occur.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219517 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-10 17:39:11 +00:00
Fariborz Jahanian
a64ffb893b Add couple of missing 'override' keyword. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219516 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-10 17:34:30 +00:00
Frederic Riss
dd2cb9cae7 [dwarfdump] Resolve also variable specifications/abstract_origins.
DW_AT_specification and DW_AT_abstract_origin resolving was only performed
on subroutine DIEs because it used the getSubroutineName method. Introduce
a more generic getName() and use it to dump the reference attributes.

Testcases have been updated to check the printed names instead of the offsets
except when the name could be ambiguous.

Reviewers: dblaikie, samsonov

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219506 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-10 15:51:02 +00:00
Benjamin Kramer
d62c4bac66 Reduce double set lookups. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219505 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-10 15:32:50 +00:00
Chandler Carruth
082e667c15 [ADT] Add an (ADL-friendly) abs free function for APFloat that returns
by value having cleared the sign bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219485 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-10 08:27:22 +00:00
David Majnemer
1e0e306deb Object, COFF: Relax aux symbols for section definitions
We, I suppose naïvely, believed the COFF specification with regard to
auxiliary symbol records which defined sections: they specified that the
symbol value should be zero.  However, dumpbin and MinGW's objdump do
not consider the symbol value as a restriction.  Relaxing this allows us
to properly dump MinGW linked executables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219479 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-10 06:58:11 +00:00
Matt Arsenault
c08f0e3743 Add minnum / maxnum to APFloat
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219475 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-10 05:21:32 +00:00
Chandler Carruth
f4ec6697b8 [ADT] Replace the logb implementation with the simpler and much closer
to what we actually want ilogb implementation. This makes everything
*much* easier to deal with and is actually what we want when using it
anyways.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219474 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-10 05:14:12 +00:00
Chandler Carruth
cb84b21243 [ADT] Add the scalbn function for APFloat.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219473 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-10 04:54:30 +00:00
Chandler Carruth
9ea4dd2eed [ADT] Implement the 'logb' functionality for APFloat. This is necessary
to implement complex division in the constant folder of Clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219471 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-10 04:17:04 +00:00
Matt Arsenault
4728073883 Add isInfinity to ConstantFP
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219463 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-10 02:15:04 +00:00
Chandler Carruth
0ffdb31af0 [ADT] Add basic operator overloads for arithmetic to APFloat to make
code using it more readable.

Also add a copySign static function that works more like the standard
function by accepting the value and sign-carying value as arguments.

No interesting logic here, but tests added to cover the basic API
additions and make sure they do something plausible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219453 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 23:26:15 +00:00
Frederic Riss
0d807ccc39 Add ApplePropertyString dump helper to Dwarf.{h|cpp}.
Reviewers: dblaikie

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219442 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 20:43:04 +00:00
Matt Arsenault
2b3bbbdf0c Remove unused field from Operand
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219430 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 19:15:18 +00:00
Lang Hames
80bfef5ce1 [PBQP] Add missing headers from r219421.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219425 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 18:36:59 +00:00
Lang Hames
54d63b4fd5 [PBQP] Replace PBQPBuilder with composable constraints (PBQPRAConstraint).
This patch removes the PBQPBuilder class and its subclasses and replaces them
with a composable constraints class: PBQPRAConstraint. This allows constraints
that are only required for optimisation (e.g. coalescing, soft pairing) to be
mixed and matched.

This patch also introduces support for target writers to supply custom
constraints for their targets by overriding a TargetSubtargetInfo method:

std::unique_ptr<PBQPRAConstraints> getCustomPBQPConstraints() const;

This patch should have no effect on allocations.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219421 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 18:20:51 +00:00
David Majnemer
06f1f357e3 Object, COFF: Move the VirtualSize/SizeOfRawData logic to getSectionSize
While getSectionContents was updated to do the right thing,
getSectionSize wasn't.  Move the logic to getSectionSize and leverage it
from getSectionContents.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219391 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 08:42:31 +00:00
Rui Ueyama
f02f03c21a Object: Add range iterators for COFF import/export table
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219383 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 02:16:38 +00:00
Eric Christopher
e6d97094b7 Remove unused argument to CreateTargetScheduleState and change
the TargetMachine to a TargetSubtargetInfo since everything
we wanted is off of that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219382 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 01:59:35 +00:00
Eric Christopher
31c9cd065a Remove uses of the TargetMachine from FunctionLoweringInfo
via caching TargetLowering and using the MachineFunction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219375 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 00:57:31 +00:00
Robin Morisset
38a670a611 Fix typo in comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219365 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-08 23:30:45 +00:00