Commit Graph

108915 Commits

Author SHA1 Message Date
David Blaikie
43ed8aefd3 Sink most of DwarfDebug::constructAbstractSubprogramScopeDIE down into DwarfCompileUnit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219476 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-10 06:39:26 +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
Hal Finkel
9a97f23f2f [LVI] Revert the remainder of "r218231 - Add two thresholds lvi-overdefined-BB-threshold and lvi-overdefined-threshold"
Some of r218231 was reverted with the code that used it in r218971, but not all
of it. This removes the rest (which is now dead).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219469 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-10 03:56:24 +00:00
David Blaikie
df89f0dbaa Avoid unnecessary map lookup/insertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219466 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-10 03:09:38 +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
Arnold Schwaighofer
dd8c386432 SimplifyCFG: Don't convert phis into selects if we could remove undef behavior
instead

We used to transform this:

  define void @test6(i1 %cond, i8* %ptr) {
  entry:
    br i1 %cond, label %bb1, label %bb2

  bb1:
    br label %bb2

  bb2:
    %ptr.2 = phi i8* [ %ptr, %entry ], [ null, %bb1 ]
    store i8 2, i8* %ptr.2, align 8
    ret void
  }

into this:

  define void @test6(i1 %cond, i8* %ptr) {
    %ptr.2 = select i1 %cond, i8* null, i8* %ptr
    store i8 2, i8* %ptr.2, align 8
    ret void
  }

because the simplifycfg transformation into selects would happen to happen
before the simplifycfg transformation that removes unreachable control flow
(We have 'unreachable control flow' due to the store to null which is undefined
behavior).

The existing transformation that removes unreachable control flow in simplifycfg
is:

  /// If BB has an incoming value that will always trigger undefined behavior
  /// (eg. null pointer dereference), remove the branch leading here.
  static bool removeUndefIntroducingPredecessor(BasicBlock *BB)

Now we generate:

  define void @test6(i1 %cond, i8* %ptr) {
    store i8 2, i8* %ptr.2, align 8
    ret void
  }

I did not see any impact on the test-suite + externals.

rdar://18596215

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219462 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-10 01:27:02 +00:00
Rafael Espindola
a447422da3 Fix gcc warning in gold-plugin.cpp.
Patch by Markus Trippelsdorf!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219459 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-10 00:48:13 +00:00
David Majnemer
54a3b749e1 obj2yaml, COFF: Handle long section names
Long section names are represented as a slash followed by a numeric
ASCII string.  This number is an offset into a string table.

Print the appropriate entry in the string table instead of the less
enlightening /4.

N.B.  yaml2obj already does the right thing, this test exercises both
sides of the (de-)serialization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219458 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-10 00:17:57 +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
Sanjay Patel
a4554c2897 Improve sqrt estimate algorithm (fast-math)
This patch changes the fast-math implementation for calculating sqrt(x) from:
y = 1 / (1 / sqrt(x))
to:
y = x * (1 / sqrt(x))

This has 2 benefits: less code / faster code and one less estimate instruction 
that may lose precision.

The only target that will be affected (until http://reviews.llvm.org/D5658 is approved)
is PPC. The difference in codegen for PPC is 2 less flops for a single-precision sqrtf
or vector sqrtf and 4 less flops for a double-precision sqrt. 
We also eliminate a constant load and extra register usage.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219445 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 21:26:35 +00:00
Sanjay Patel
c3d3f63e74 delete function names from comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219444 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 21:24:46 +00:00
Sanjay Patel
c160a9a56f delete function name from comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219443 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 21:23:39 +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
Samuel Antao
f75bfbea17 Fix bug in GPR to FPR moves in PPC64LE.
The current implementation of GPR->FPR register moves uses a stack slot. This mechanism writes a double word and reads a word. In big-endian the load address must be displaced by 4-bytes in order to get the right value. In little endian this is no longer required. This patch fixes the issue and adds LE regression tests to fast-isel-conversion which currently expose this problem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219441 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 20:42:56 +00:00
David Blaikie
127cb8e873 Remove unused parameter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219440 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 20:36:27 +00:00
David Blaikie
db0ec65e79 Sink DwarfDebug::createAndAddScopeChildren down into DwarfCompileUnit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219437 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 20:26:15 +00:00
David Blaikie
7cb5e0f56d Sink DwarfDebug::constructSubprogramScopeDIE down into DwarfCompileUnit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219436 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 20:21:36 +00:00
Chad Rosier
c2bf8fbdf4 [Reassociate] Don't canonicalize X - undef to X + (-undef).
Phabricator Revision: http://reviews.llvm.org/D5674
PR21205

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219434 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 20:06:29 +00:00
Benjamin Kramer
07200c4b6c Remove a compiler bug workaround from 2007. The affected versions of gcc are long gone.
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219433 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 19:50:39 +00:00
Hal Finkel
adba582bc6 Revert "[BasicAA] Revert "Revert r218714 - Make better use of zext and sign information.""
This reverts commit r219135 -- still causing miscompiles in SPEC it seems...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219432 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 19:48:12 +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
Matt Arsenault
2e3ee4ceb5 Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219429 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 19:15:15 +00:00
Tom Stellard
a8b2e6f4af R600/SI: Legalize CopyToReg during instruction selection
The instruction emitter will crash if it encounters a CopyToReg
node with a non-register operand like FrameIndex.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219428 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 19:06:00 +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
David Blaikie
5465cc6741 Sink DwarfDebug::createScopeChildrenDIE down into DwarfCompileUnit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219422 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 18:24:28 +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
Tom Stellard
d0fb5b1c11 R600/SI: Legalize INSERT_SUBREG instructions during PostISelFolding
LLVM assumes INSERT_SUBREG will always have register operands, so
we need to legalize non-register operands, like FrameIndexes, to
avoid random assertion failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219420 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 18:09:15 +00:00
David Blaikie
81a95a816b Sink DwarfDebug.cpp::constructVariableDIE into DwarfCompileUnit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219419 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 17:56:39 +00:00
David Blaikie
4710301da5 Move DwarfUnit::constructVariableDIE down to DwarfCompileUnit, since it's only needed there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219418 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 17:56:36 +00:00
Bill Schmidt
c307b3034a [PPC64] VSX indexed-form loads use wrong instruction format
The VSX instruction definitions for lxsdx, lxvd2x, lxvdsx, and lxvw4x
incorrectly use the XForm_1 instruction format, rather than the
XX1Form instruction format.  This is likely a pasto when creating
these instructions, which were based on lvx and so forth.  This patch
uses the correct format.

The existing reformatting test (test/MC/PowerPC/vsx.s) missed this
because the two formats differ only in that XX1Form has an extension
to the target register field in bit 31.  The tests for these
instructions used a target register of 7, so the default of 0 in bit
31 for XForm_1 didn't expose a problem.  For register numbers 32-63
this would be noticeable.  I've changed the test to use higher
register numbers to verify my change is effective.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219416 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 17:51:35 +00:00
David Blaikie
12a37fc6e0 Sink DwarfDebug::constructLexicalScopeDIE into DwarfCompileUnit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219414 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 17:08:42 +00:00
David Blaikie
44524f4e77 Missing reformatting
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219413 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 17:08:38 +00:00
David Blaikie
3fcb9f3ea5 Sink DwarfDebug::constructInlinedScopeDIE into DwarfCompileUnit
This introduces access to the AbstractSPDies map from DwarfDebug so
DwarfCompileUnit can access it. Eventually this'll sink down to
DwarfFile, but it'll still be generically accessible - not much
encapsulation to provide it. (constructInlinedScopeDIE could stay
further up, in DwarfFile to avoid exposing this - but I don't think
that's particularly better)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219411 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 16:50:53 +00:00
Andrea Di Biagio
c53401ee91 [InstCombine] Fix wrong folding of constant comparisons involving ashr and negative values.
This patch fixes a bug in method InstCombiner::FoldCmpCstShrCst where we
wrongly computed the distance between the highest bits set of two negative
values.

This fixes PR21222.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219406 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 12:41:49 +00:00
Kevin Qin
f73400a864 [AArch64] Enable partial & runtime unrolling on cortex-a57.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219401 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 10:13:27 +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
Robert Khasanov
340b5b9ad7 [AVX512] Extended avx512_binop_rm for AVX512VL subsets.
Added avx512_binop_rm_vl multiclass for VL subset
Added encoding tests



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219390 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 08:38:48 +00:00
David Majnemer
5b1b9844e7 Object, COFF: Cap the section contents to min(VirtualSize, SizeOfRawData)
It is not useful to return the data beyond VirtualSize it's less than
SizeOfRawData.

An implementation detail of COFF requires the section size to be rounded
up to a multiple of FileAlignment; this means that SizeOfRawData is not
representative of how large the section is.  Instead, we should cap it
to VirtualSize when this occurs as it represents the true size of the
section.

Note that this is only relevant in executable files because this
rounding doesn't occur in object files (and VirtualSize is always zero).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219388 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 07:49:28 +00:00
Eric Christopher
d9b7ba1506 Remove more calls to getSubtargetImpl from the schedulers and
remove cached or unnecessary TargetMachines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219387 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 06:28:06 +00:00
Bob Wilson
8e673570b9 Use triple's isiOS() and isOSDarwin() methods.
These methods are already used in lots of places. This makes things more
consistent. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219386 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 05:43:30 +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
939dd38a09 Remove uses of getSubtargetImpl from ResourcePriorityQueue and
replace them with calls off of the MachineFuncton.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219381 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 01:59:31 +00:00
Eric Christopher
b78fd035a2 Remove the uses of getSubtargetImpl from InstrEmitter and remove
the now unused TargetMachine variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219379 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 01:35:29 +00:00
Eric Christopher
05597e9fa3 Use the subtarget on the dag to get TargetFrameLowering rather
than off the target machine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219378 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 01:35:27 +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
David Blaikie
7ed0e6d0c6 Push DwarfDebug::attachRangesOrLowHighPC down into DwarfCompileUnit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219372 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 00:21:42 +00:00