OSDN Git Service

android-x86/external-llvm.git
8 years ago[InstCombine][SSE] Added DemandedBits tests for MOVMSK instructions
Simon Pilgrim [Wed, 27 Apr 2016 09:53:09 +0000 (09:53 +0000)]
[InstCombine][SSE] Added DemandedBits tests for MOVMSK instructions

MOVMSK zeros the upper bits of the gpr - we should be able to use this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267686 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFixed sphinx warning from r267672
Adam Nemet [Wed, 27 Apr 2016 05:59:51 +0000 (05:59 +0000)]
Fixed sphinx warning from r267672

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267675 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LoopDist] Add llvm.loop.distribute.enable loop metadata
Adam Nemet [Wed, 27 Apr 2016 05:28:18 +0000 (05:28 +0000)]
[LoopDist] Add llvm.loop.distribute.enable loop metadata

Summary:
D19403 adds a new pragma for loop distribution.  This change adds
support for the corresponding metadata that the pragma is translated to
by the FE.

As part of this I had to rethink the flag -enable-loop-distribute.  My
goal was to be backward compatible with the existing behavior:

  A1. pass is off by default from the optimization pipeline
  unless -enable-loop-distribute is specified

  A2. pass is on when invoked directly from opt (e.g. for unit-testing)

The new pragma/metadata overrides these defaults so the new behavior is:

  B1. A1 + enable distribution for individual loop with the pragma/metadata

  B2. A2 + disable distribution for individual loop with the pragma/metadata

The default value whether the pass is on or off comes from the initiator
of the pass.  From the PassManagerBuilder the default is off, from opt
it's on.

I moved -enable-loop-distribute under the pass.  If the flag is
specified it overrides the default from above.

Then the pragma/metadata can further modifies this per loop.

As a side-effect, we can now also use -enable-loop-distribute=0 from opt
to emulate the default from the optimization pipeline.  So to be precise
this is the new behavior:

  C1. pass is off by default from the optimization pipeline
  unless -enable-loop-distribute or the pragma/metadata enables it

  C2. pass is on when invoked directly from opt
  unless -enable-loop-distribute=0 or the pragma/metadata disables it

Reviewers: hfinkel

Subscribers: joker.eph, mzolotukhin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267672 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Cloning] cloneLoopWithPreheader(): add assert to ensure no sub-loops
Vaivaswatha Nagaraj [Wed, 27 Apr 2016 05:25:09 +0000 (05:25 +0000)]
[Cloning] cloneLoopWithPreheader(): add assert to ensure no sub-loops

Summary:
cloneLoopWithPreheader() does not update LoopInfo for sub-loop of
the original loop being cloned. Add assert to ensure no sub-loops for loop being cloned.

Reviewers: anemet, ashutosh.nema, hfinkel

Subscribers: mzolotukhin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267671 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Support][X86] Add a few more Intel model numbers to getHostCPUName for airmont and...
Craig Topper [Wed, 27 Apr 2016 05:17:00 +0000 (05:17 +0000)]
[Support][X86] Add a few more Intel model numbers to getHostCPUName for airmont and knl.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267670 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Support][X86] Change the case values in the Intel family 6 code to hex so its easier...
Craig Topper [Wed, 27 Apr 2016 05:16:58 +0000 (05:16 +0000)]
[Support][X86] Change the case values in the Intel family 6 code to hex so its easier to compare with Intel's docs. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267669 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "Support "preserving" the summary information when using setModule() API in...
Mehdi Amini [Wed, 27 Apr 2016 05:11:44 +0000 (05:11 +0000)]
Revert "Support "preserving" the summary information when using setModule() API in LTOCodeGenerator"

This reverts commit r267665.
ASAN shows that there is a use of undefined value.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267668 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Support][X86] Add a couple more Broadwell CPU models numbers to getHostCPUName.
Craig Topper [Wed, 27 Apr 2016 04:40:03 +0000 (04:40 +0000)]
[Support][X86] Add a couple more Broadwell CPU models numbers to getHostCPUName.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267666 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSupport "preserving" the summary information when using setModule() API in LTOCodeGen...
Mehdi Amini [Wed, 27 Apr 2016 04:24:10 +0000 (04:24 +0000)]
Support "preserving" the summary information when using setModule() API in LTOCodeGenerator

Another attempt at r267655...

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267665 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "Support "preserving" the summary information when using setModule() API in...
Mehdi Amini [Wed, 27 Apr 2016 03:34:28 +0000 (03:34 +0000)]
Revert "Support "preserving" the summary information when using setModule() API in LTOCodeGenerator"

This reverts commit r267657, r267656, and r267655.
The test does not pass on multiple bots, I'm unsure why yet but let's unbreak them.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267664 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoThe patch fixes PR27392.
Evgeny Stupachenko [Wed, 27 Apr 2016 03:04:54 +0000 (03:04 +0000)]
The patch fixes PR27392.
Summary:
 It is incorrect to compare TripCount (which is BECount + 1)
  with extraiters (or Count) to check if we should enter unrolled
  loop or not, because TripCount can potentially overflow
  (when BECount is max unsigned integer).
 While comparing BECount with (Count - 1) is overflow safe and
  therefore correct.

Reviewer: hfinkel

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

From: Evgeny Stupachenko <evstupac@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267662 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LVI] Delete stale and misleading comment.
Philip Reames [Wed, 27 Apr 2016 03:03:15 +0000 (03:03 +0000)]
[LVI] Delete stale and misleading comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267661 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ppc64] fix bug in prologue that mfocrf's cr operand should be explict state instead...
Chuang-Yu Cheng [Wed, 27 Apr 2016 02:59:28 +0000 (02:59 +0000)]
[ppc64] fix bug in prologue that mfocrf's cr operand should be explict state instead of implicit

This fixes PR27414

Reviewers: kbarton mgrang tjablin

http://reviews.llvm.org/D19255

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267660 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Set AddPristinesAndCSRs to FixupBW LivePhysRegs. NFC.
Ahmed Bougacha [Wed, 27 Apr 2016 01:51:38 +0000 (01:51 +0000)]
[X86] Set AddPristinesAndCSRs to FixupBW LivePhysRegs. NFC.

We run after PEI, so we need to AddPristinesAndCSRs.
In practice, that makes no difference here, because we only ask about
liveness of super-registers of defined GR8/GR16 registers, so they
can't be pristine. Still, it's the correct thing to do.

Thanks to Quentin for noticing!

Follow-up to r267495.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267658 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix the test from r267656: Support "preserving" the summary information when using...
Mehdi Amini [Wed, 27 Apr 2016 01:49:11 +0000 (01:49 +0000)]
Fix the test from r267656: Support "preserving" the summary information when using setModule() API in LTOCodeGenerator

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267657 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd a test for r267655: Support "preserving" the summary information when using setMo...
Mehdi Amini [Wed, 27 Apr 2016 01:47:46 +0000 (01:47 +0000)]
Add a test for r267655: Support "preserving" the summary information when using setModule() API in LTOCodeGenerator

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267656 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSupport "preserving" the summary information when using setModule() API in LTOCodeGen...
Mehdi Amini [Wed, 27 Apr 2016 01:46:48 +0000 (01:46 +0000)]
Support "preserving" the summary information when using setModule() API in LTOCodeGenerator

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267655 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix typo in comment; NFC
Sanjoy Das [Wed, 27 Apr 2016 01:44:31 +0000 (01:44 +0000)]
Fix typo in comment; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267653 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Don't assume that MMX extractelts are from index 0.
Ahmed Bougacha [Wed, 27 Apr 2016 01:35:29 +0000 (01:35 +0000)]
[X86] Don't assume that MMX extractelts are from index 0.

It's probably the case for all 3 MMX users out there, but with
hand-crafted IR, you can trigger selection failures. Fix that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267652 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Re-enable MMX i32 extractelt combine.
Ahmed Bougacha [Wed, 27 Apr 2016 01:35:25 +0000 (01:35 +0000)]
[X86] Re-enable MMX i32 extractelt combine.

This effectively adds back the extractelt combine removed by r262358:
the direct case can still occur (because x86_mmx is special, see
r262446), but it's the indirect case that's now superseded by the
generic combine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267651 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDetects the SAD pattern on X86 so that much better code will be emitted once the...
Cong Hou [Wed, 27 Apr 2016 01:29:18 +0000 (01:29 +0000)]
Detects the SAD pattern on X86 so that much better code will be emitted once the pattern is matched.

Differential revision: http://reviews.llvm.org/D14840

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267649 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LVI] Add a comment explaining a subtle piece of code
Philip Reames [Wed, 27 Apr 2016 01:02:25 +0000 (01:02 +0000)]
[LVI] Add a comment explaining a subtle piece of code

Or at least, I didn't understand the implications the first several times I read it it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267648 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Docs] Try to clarify the concept of domains for noalias scope
Adam Nemet [Wed, 27 Apr 2016 00:52:48 +0000 (00:52 +0000)]
[Docs] Try to clarify the concept of domains for noalias scope

Summary:
This tries to anchor down the concept of domains a bit better.  I had
trouble initially relating this to anything.  Also talking to David
Majnemer on IRC suggested that I wasn't the only one.

Reviewers: hfinkel

Subscribers: llvm-commits, majnemer

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267647 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoThinLTO: do not promote GlobalVariable that have a specific section.
Mehdi Amini [Wed, 27 Apr 2016 00:32:13 +0000 (00:32 +0000)]
ThinLTO: do not promote GlobalVariable that have a specific section.

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267646 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSLSR: Use UnknownAddressSpace instead of 0 for pure arithmetic.
Matt Arsenault [Wed, 27 Apr 2016 00:32:09 +0000 (00:32 +0000)]
SLSR: Use UnknownAddressSpace instead of 0 for pure arithmetic.

In the case where isLegalAddressingMode is used for cases
not related to addressing modes, such as pure adds and muls,
it should not be using address space 0. LSR already passes -1
as the address space in these cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267645 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoLTOCodeGenerator: turns linkonce(_odr) into weak_(odr) when present "MustPreserve...
Mehdi Amini [Wed, 27 Apr 2016 00:32:02 +0000 (00:32 +0000)]
LTOCodeGenerator: turns linkonce(_odr) into weak_(odr) when present "MustPreserve" set

Summary:
If the linker requested to preserve a linkonce function, we should
honor this even if we drop all uses.

Reviewers: dexonsmith

Subscribers: llvm-commits, joker.eph

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267644 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LoopDist] Split main class. NFC
Adam Nemet [Wed, 27 Apr 2016 00:31:03 +0000 (00:31 +0000)]
[LoopDist] Split main class. NFC

This splits out the per-loop functionality from the Pass class.

With this the fact whether the loop is forced-distribute with the new
metadata/pragma can be cached in the per-loop class rather than passed
around.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267643 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LVI] Reduce compile time by lazily scanning blocks if needed
Philip Reames [Wed, 27 Apr 2016 00:30:55 +0000 (00:30 +0000)]
[LVI] Reduce compile time by lazily scanning blocks if needed

When encountering a non-local pointer, LVI would eagerly scan the block for dereferences of the given object to prove the pointer to be non null.  That's all well and good, but *then* we'd go recurse through our input blocks.  As a result, we could end up scanning each and every block we traverse, even if the final definition was obviously non null or we found a constant value somewhere up the chain.  The previous code papered over this by using the isKnownNonNull routine from value tracking.  This made the duplication less painful in the common case.

Instead, we know do the block scan only *after* we've gotten the recursive results back.  This lets us stop scanning individual blocks as soon as we've determined it to be non-null in any predecessor block and use our usual merge rules to propagate that information cheaply through successor blocks.  For a pointer which can be found non-null, this does strictly less work and sometimes substaintially so.

Note that the case where we *can't* prove something non-null is still the really expensive case.  We end up scanning each and every block looking for a dereference and never end up finding one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267642 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MachineInstrBundle] Actually set the PartialDeadDef flag only when the register
Quentin Colombet [Wed, 27 Apr 2016 00:16:29 +0000 (00:16 +0000)]
[MachineInstrBundle] Actually set the PartialDeadDef flag only when the register
is defined!

The users were checking the proper thing (Defined + PartialDeadDef), but the
information may have been wrong for other use cases, so fix that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267641 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MachineInstrBundle] Update the comment for PhysRegInfo::DeadDef.
Quentin Colombet [Tue, 26 Apr 2016 23:55:41 +0000 (23:55 +0000)]
[MachineInstrBundle] Update the comment for PhysRegInfo::DeadDef.

I missed read the comment when I commited r267621 and thought the
comment did not need update. Matthias kindly proved me wrong.
Fixing that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267638 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd optimization bisect opt-in calls for SystemZ passes
Andrew Kaylor [Tue, 26 Apr 2016 23:49:41 +0000 (23:49 +0000)]
Add optimization bisect opt-in calls for SystemZ passes

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267636 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd optimization bisect opt-in calls for NVPTX passes
Andrew Kaylor [Tue, 26 Apr 2016 23:44:31 +0000 (23:44 +0000)]
Add optimization bisect opt-in calls for NVPTX passes

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267635 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Make sure it is safe to clobber EFLAGS, if need be, when choosing
Quentin Colombet [Tue, 26 Apr 2016 23:44:14 +0000 (23:44 +0000)]
[X86] Make sure it is safe to clobber EFLAGS, if need be, when choosing
the prologue.

Do not use basic blocks that have EFLAGS live-in as prologue if we need
to realign the stack. Realigning the stack uses AND instruction and this
clobbers EFLAGS.

An other alternative would have been to save and restore EFLAGS around
the stack realignment code, but this is likely inefficient.

Fixes PR27531.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267634 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoPM: Port Reassociate to the new pass manager
Justin Bogner [Tue, 26 Apr 2016 23:39:29 +0000 (23:39 +0000)]
PM: Port Reassociate to the new pass manager

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267631 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Replace -mcpu with -mattr in several tests
Mitch Bodart [Tue, 26 Apr 2016 23:36:38 +0000 (23:36 +0000)]
[X86] Replace -mcpu with -mattr in several tests
Differential Revision: http://reviews.llvm.org/D19568

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267629 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoReassociate: Convert another functor into a lambda. NFC
Justin Bogner [Tue, 26 Apr 2016 23:32:00 +0000 (23:32 +0000)]
Reassociate: Convert another functor into a lambda. NFC

Also move the explanatory comment with it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267628 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LVI] Cut short search if we know we can't return a useful result
Philip Reames [Tue, 26 Apr 2016 23:27:33 +0000 (23:27 +0000)]
[LVI] Cut short search if we know we can't return a useful result

Previously we were recursing on our operands for unary and binary operators regardless of whether we knew how to reason about the operator in question.  This has the effect of doing a potentially large amount of work, only to throw it away.  By checking whether the operation is one LVI can handle, we can cut short the search and return the (overdefined) answer more quickly.  The quality of the results produced should not change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267626 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SimplifyCFG] propagate branch metadata when creating select
Sanjay Patel [Tue, 26 Apr 2016 23:15:48 +0000 (23:15 +0000)]
[SimplifyCFG] propagate branch metadata when creating select

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267624 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Teach the expansion of copy instructions how to do proper liveness.
Quentin Colombet [Tue, 26 Apr 2016 23:14:32 +0000 (23:14 +0000)]
[X86] Teach the expansion of copy instructions how to do proper liveness.

When the simple analysis provided by MachineBasicBlock::computeRegisterLiveness
fails, fall back on the LivePhysReg utility.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267623 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MachineBasicBlock] Take advantage of the partially dead information.
Quentin Colombet [Tue, 26 Apr 2016 23:14:29 +0000 (23:14 +0000)]
[MachineBasicBlock] Take advantage of the partially dead information.

Thanks to that information we wouldn't lie on a register being live whereas it
is not.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267622 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MachineInstrBundle] Improvement the recognition of dead definitions.
Quentin Colombet [Tue, 26 Apr 2016 23:14:24 +0000 (23:14 +0000)]
[MachineInstrBundle] Improvement the recognition of dead definitions.

Now, it is possible to know that partial definitions are dead definitions and
recognize that clobbered registers are also dead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267621 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LVI] Apply transfer rule for overdefine inputs for binary operators
Philip Reames [Tue, 26 Apr 2016 23:10:35 +0000 (23:10 +0000)]
[LVI] Apply transfer rule for overdefine inputs for binary operators

As pointed out by John Regehr over in http://reviews.llvm.org/D19485, LVI was being incredibly stupid about applying its transfer rules.  Rather than gathering local facts from the expression itself, it was simply giving up entirely if one of the inputs was overdefined.  This greatly impacts the precision of the overall analysis and makes it far more fragile as well.

This patch builds on 267609 which did the same thing for unary casts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267620 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[NVPTX] Fix some usages of CodeGenOpt::None.
Jingyue Wu [Tue, 26 Apr 2016 22:59:25 +0000 (22:59 +0000)]
[NVPTX] Fix some usages of CodeGenOpt::None.

NVPTXLowerKernelArgs is required for correctness, so it should not be guarded
by CodeGenOpt::None.

NVPTXPeephole is optimization only, so it should be skipped when
CodeGenOpt::None.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267619 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LVI] A better fix for the assertion error introduced by 267609
Philip Reames [Tue, 26 Apr 2016 22:52:30 +0000 (22:52 +0000)]
[LVI] A better fix for the assertion error introduced by 267609

Essentially, I was using the wrong size function.  For types which were sized, but not primitive, I wasn't getting a useful size for the operand and failed an assert.  I fixed this, and also added a guard that the input is a sized type.  Test case is for the original mistake.  I'm not sure how to actually exercise the sized type check.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267618 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LVI] Speculative fix for assertion seen in clang bots
Philip Reames [Tue, 26 Apr 2016 22:31:53 +0000 (22:31 +0000)]
[LVI] Speculative fix for assertion seen in clang bots

I'll clean this up and add a test case shortly.  I want to make sure this does actually fix the bots; if not, I'll revert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267617 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LowerExpectIntrinsic] make default likely/unlikely ratio bigger
Sanjay Patel [Tue, 26 Apr 2016 22:23:38 +0000 (22:23 +0000)]
[LowerExpectIntrinsic] make default likely/unlikely ratio bigger

We need the default ratio to be sufficiently large that it triggers transforms
based on block frequency info (BFI) and plays well with the recently introduced
BranchProbability used by CGP.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267615 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoReassociate: Simplify using lambdas. NFC
Justin Bogner [Tue, 26 Apr 2016 22:22:18 +0000 (22:22 +0000)]
Reassociate: Simplify using lambdas. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267614 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LVI] Infer local facts from unary expressions
Philip Reames [Tue, 26 Apr 2016 21:48:16 +0000 (21:48 +0000)]
[LVI] Infer local facts from unary expressions

As pointed out by John Regehr over in http://reviews.llvm.org/D19485, LVI was being incredibly stupid about applying its transfer rules. Rather than gathering local facts from the expression itself, it was simply giving up entirely if one of the inputs was overdefined. This greatly impacts the precision of the overall analysis and makes it far more fragile as well.

This patch implements only the unary operation case. Once this is in, I'll implement the same for the binary operations.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267609 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoOptimization bisect support in X86-specific passes
Andrew Kaylor [Tue, 26 Apr 2016 21:44:24 +0000 (21:44 +0000)]
Optimization bisect support in X86-specific passes

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267608 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CodeGen] Add getBuildVector and getSplatBuildVector helpers. NFCI.
Ahmed Bougacha [Tue, 26 Apr 2016 21:15:30 +0000 (21:15 +0000)]
[CodeGen] Add getBuildVector and getSplatBuildVector helpers. NFCI.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267606 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "[SimplifyLibCalls] sprintf doesn't copy null bytes"
David Majnemer [Tue, 26 Apr 2016 21:04:47 +0000 (21:04 +0000)]
Revert "[SimplifyLibCalls] sprintf doesn't copy null bytes"

The destination buffer that sprintf uses is restrict qualified, we do
not need to worry about derived pointers referenced via format
specifiers.

This reverts commit r267580.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267605 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoTry to get ResponseFile.ll passing on Windows after r267556.
Nico Weber [Tue, 26 Apr 2016 20:32:51 +0000 (20:32 +0000)]
Try to get ResponseFile.ll passing on Windows after r267556.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267599 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRemove more unused variables.
Zachary Turner [Tue, 26 Apr 2016 20:32:35 +0000 (20:32 +0000)]
Remove more unused variables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267598 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMasked Store in Loop Vectorizer - bugfix
Elena Demikhovsky [Tue, 26 Apr 2016 20:18:04 +0000 (20:18 +0000)]
Masked Store in Loop Vectorizer - bugfix

Fixed a bug in loop vectorization with conditional store.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267597 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoPM: Port Internalize to the new pass manager
Justin Bogner [Tue, 26 Apr 2016 20:15:52 +0000 (20:15 +0000)]
PM: Port Internalize to the new pass manager

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267596 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[llvm-pdbdump] Fix version reading on big endian systems.
Zachary Turner [Tue, 26 Apr 2016 19:48:18 +0000 (19:48 +0000)]
[llvm-pdbdump] Fix version reading on big endian systems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267595 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd optimization bisect opt-in calls for Hexagon passes
Andrew Kaylor [Tue, 26 Apr 2016 19:46:28 +0000 (19:46 +0000)]
Add optimization bisect opt-in calls for Hexagon passes

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267593 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix warnings and -Werror build on clang.
Zachary Turner [Tue, 26 Apr 2016 19:24:10 +0000 (19:24 +0000)]
Fix warnings and -Werror build on clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267589 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoParse and dump PDB DBI Stream Header Information
Zachary Turner [Tue, 26 Apr 2016 18:42:34 +0000 (18:42 +0000)]
Parse and dump PDB DBI Stream Header Information

The DBI stream contains a lot of bookkeeping information for other
streams. In particular it contains information about section contributions
and linked modules. This patch is a first attempt at parsing some of the
information out of the DBI stream. It currently only parses and dumps the
headers of the DBI stream, so none of the module data or section
contribution data is pulled out.

This is just a proof of concept that we understand the basic properties of
the DBI stream's metadata, and followup patches will try to extract more
detailed information out.

Differential Revision: http://reviews.llvm.org/D19500
Reviewed By: majnemer, ruiu

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267585 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Tail duplication] Handle source registers with subregisters
Krzysztof Parzyszek [Tue, 26 Apr 2016 18:36:34 +0000 (18:36 +0000)]
[Tail duplication] Handle source registers with subregisters

When a block is tail-duplicated, the PHI nodes from that block are
replaced with appropriate COPY instructions. When those PHI nodes
contained use operands with subregisters, the subregisters were
dropped from the COPY instructions, resulting in incorrect code.

Keep track of the subregister information and use this information
when remapping instructions from the duplicated block.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267583 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoReapply: "ARM: put correct symbol index on indirect pointers in __thread_ptr.""
Tim Northover [Tue, 26 Apr 2016 18:29:16 +0000 (18:29 +0000)]
Reapply: "ARM: put correct symbol index on indirect pointers in __thread_ptr.""

A latent bug in llvm-objdump used the wrong format specifier on 32-bit
targets, causing the test to fail. This fixes the issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267582 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoInternalize: More consistent file header and include guards. NFC
Justin Bogner [Tue, 26 Apr 2016 18:25:30 +0000 (18:25 +0000)]
Internalize: More consistent file header and include guards. NFC

Match the style here to the other headers in Transforms/IPO.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267581 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SimplifyLibCalls] sprintf doesn't copy null bytes
David Majnemer [Tue, 26 Apr 2016 18:16:49 +0000 (18:16 +0000)]
[SimplifyLibCalls] sprintf doesn't copy null bytes

sprintf doesn't read or copy the terminating null byte from it's string
operands.  sprintf will append it's own after processing all of the
format specifiers.

This fixes PR27526.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267580 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSwift Calling Convention: use %RAX for sret.
Manman Ren [Tue, 26 Apr 2016 18:08:06 +0000 (18:08 +0000)]
Swift Calling Convention: use %RAX for sret.

We don't need to copy the sret argument into %rax upon return.
rdar://25671494

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267579 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agotests: tweak MIR for ARM tests to correct MI issues
Saleem Abdulrasool [Tue, 26 Apr 2016 17:54:21 +0000 (17:54 +0000)]
tests: tweak MIR for ARM tests to correct MI issues

The Machine Instruction Verifier flagged some issues in the serialized MIR.
Adjust the input to correct them.

Fixes the remaining portion of PR27480.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267578 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agotest: remove some bleeding whitespace
Saleem Abdulrasool [Tue, 26 Apr 2016 17:54:16 +0000 (17:54 +0000)]
test: remove some bleeding whitespace

Kill bleeding whitespace.  NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267577 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AMDGPU] Move reserved vgpr count for trap handler usage to SIMachineFunctionInfo...
Konstantin Zhuravlyov [Tue, 26 Apr 2016 17:24:40 +0000 (17:24 +0000)]
[AMDGPU] Move reserved vgpr count for trap handler usage to SIMachineFunctionInfo + minor commenting changes

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267573 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CodeGenPrepare] use branch weight metadata to decide if a select should be turned...
Sanjay Patel [Tue, 26 Apr 2016 17:11:17 +0000 (17:11 +0000)]
[CodeGenPrepare] use branch weight metadata to decide if a select should be turned into a branch

This is part of solving PR27344:
https://llvm.org/bugs/show_bug.cgi?id=27344

CGP should undo the SimplifyCFG transform for the same reason that earlier patches have used this
same mechanism: it's possible that passes between SimplifyCFG and CGP may be able to optimize the
IR further with a select in place.

For the TLI hook default, >99% taken or not taken is chosen as the default threshold for a highly
predictable branch. Even the most limited HW branch predictors will be correct on this branch almost
all the time, so even a massive mispredict penalty perf loss would be overcome by the win from all
the times the branch was predicted correctly.

As a follow-up, we could make the default target hook less conservative by using the SchedMachineModel's
MispredictPenalty. Or we could just let targets override the default by implementing the hook with that
and other target-specific options. Note that trying to statically determine mispredict rates for
close-to-balanced profile weight data is generally impossible if the HW is sufficiently advanced. Ie,
50/50 taken/not-taken might still be 100% predictable.

Finally, note that this patch as-is will not solve PR27344 because the current __builtin_unpredictable()
branch weight default values are 4 and 64. A proposal to change that is in D19435.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267572 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix build broken due to order of initialization problem.
Zachary Turner [Tue, 26 Apr 2016 16:57:53 +0000 (16:57 +0000)]
Fix build broken due to order of initialization problem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267571 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRefactor some more PDB reading code into DebugInfoPDB.
Zachary Turner [Tue, 26 Apr 2016 16:20:00 +0000 (16:20 +0000)]
Refactor some more PDB reading code into DebugInfoPDB.

Differential Revision: http://reviews.llvm.org/D19445
Reviewed By: David Majnemer

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267564 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AMDGPU] Reserve VGPRs for trap handler usage if instructed
Konstantin Zhuravlyov [Tue, 26 Apr 2016 15:43:14 +0000 (15:43 +0000)]
[AMDGPU] Reserve VGPRs for trap handler usage if instructed

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267563 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUse gcc's rules for parsing gcc-style response files
Nico Weber [Tue, 26 Apr 2016 13:53:56 +0000 (13:53 +0000)]
Use gcc's rules for parsing gcc-style response files

In gcc, \ escapes every character in response files. It is true that this makes
it harder to mention Windows files in rsp files, but not doing this means clang
disagrees with gcc, and also disagrees with the shell (on non-Windows) which
rsp file quoting is supposed to match. clang isn't free to choose what to do
here.

In general, the idea for response files is to take bits of your command line
and write them to a file unchanged, and have things work the same way. Since
the command line would've been interpreted by the shell, things in the rsp file
need to be subject to the same shell quoting rules.

People who want to put Windows-style paths in their response files either need
to do any of:
* escape their backslashes
* or use clang-cl which uses cl.exe/cmd.exe quoting rules
* pass --rsp-quoting=windows to clang to tell it to use
  cl.exe/cmd.exe quoting rules for response files.

Fixes PR27464.
http://reviews.llvm.org/D19417

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267556 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AMDGPU] Assembler: basic support for SDWA instructions
Sam Kolton [Tue, 26 Apr 2016 13:33:56 +0000 (13:33 +0000)]
[AMDGPU] Assembler: basic support for SDWA instructions

Support for SDWA instructions for VOP1 and VOP2 encoding.
Not done yet:
  - converters for support optional operands and modifiers
  - VOPC
  - sext() modifier
  - intrinsics
  - VOP2b (see vop_dpp.s)
  - V_MAC_F32 (see vop_dpp.s)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267553 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] PR27502: Fix the LEA optimization pass.
Andrey Turetskiy [Tue, 26 Apr 2016 12:18:12 +0000 (12:18 +0000)]
[X86] PR27502: Fix the LEA optimization pass.

Handle MachineBasicBlock as a memory displacement operand in the LEA optimization pass.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267551 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Sparc] Fix build error introduced by rL267545.
Marcin Koscielnicki [Tue, 26 Apr 2016 10:43:47 +0000 (10:43 +0000)]
[Sparc] Fix build error introduced by rL267545.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267549 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PowerPC] Add support for llvm.thread.pointer
Marcin Koscielnicki [Tue, 26 Apr 2016 10:37:22 +0000 (10:37 +0000)]
[PowerPC] Add support for llvm.thread.pointer

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267546 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SPARC] [SSP] Add support for LOAD_STACK_GUARD.
Marcin Koscielnicki [Tue, 26 Apr 2016 10:37:14 +0000 (10:37 +0000)]
[SPARC] [SSP] Add support for LOAD_STACK_GUARD.

This fixes PR22248 on sparc.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267545 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SPARC] Add support for llvm.thread.pointer.
Marcin Koscielnicki [Tue, 26 Apr 2016 10:37:01 +0000 (10:37 +0000)]
[SPARC] Add support for llvm.thread.pointer.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267544 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoThinLTOCodeGenerator: preserve linkonce when in "MustPreserved" set
Mehdi Amini [Tue, 26 Apr 2016 10:35:01 +0000 (10:35 +0000)]
ThinLTOCodeGenerator: preserve linkonce when in "MustPreserved" set

If the linker specifically requested for a linkonce to be preserved,
we need to make sure we won't drop it even if all the uses in the
current module disappear.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267543 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "ARM: put correct symbol index on indirect pointers in __thread_ptr."
Renato Golin [Tue, 26 Apr 2016 10:02:02 +0000 (10:02 +0000)]
Revert "ARM: put correct symbol index on indirect pointers in __thread_ptr."

This reverts commit r267488, as it broke some ARM buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267541 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ppc64] Reenable sibling call optimization on ppc64 since fixed tsan library tail...
Chuang-Yu Cheng [Tue, 26 Apr 2016 07:38:24 +0000 (07:38 +0000)]
[ppc64] Reenable sibling call optimization on ppc64 since fixed tsan library tail-call issue

print-stack-trace.cc test failure of compiler-rt has been fixed by
r266869 (http://reviews.llvm.org/D19148), so reenable sibling call
optimization on ppc64

Reviewers: nemanjai kbarton

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267527 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAlign case statements (whitespace-only cleanup)
Sanjoy Das [Tue, 26 Apr 2016 05:59:14 +0000 (05:59 +0000)]
Align case statements (whitespace-only cleanup)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267525 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSymbolize operand bundle blocks for bcanalyzer
Sanjoy Das [Tue, 26 Apr 2016 05:59:08 +0000 (05:59 +0000)]
Symbolize operand bundle blocks for bcanalyzer

Reviewers: joker.eph

Subscribers: mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267524 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AArch64] Expand v1i64 and v2i64 ctlz.
Craig Topper [Tue, 26 Apr 2016 05:26:51 +0000 (05:26 +0000)]
[AArch64] Expand v1i64 and v2i64 ctlz.

The default is legal, which results in 'Cannot select' errors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267522 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ARM] Expand vector ctlz_zero_undef so it becomes ctlz.
Craig Topper [Tue, 26 Apr 2016 05:04:37 +0000 (05:04 +0000)]
[ARM] Expand vector ctlz_zero_undef so it becomes ctlz.

The default is Legal, which results in 'Cannot select' errors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267521 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ARM] Expand v1i64 and v2i64 ctlz.
Craig Topper [Tue, 26 Apr 2016 05:04:33 +0000 (05:04 +0000)]
[ARM] Expand v1i64 and v2i64 ctlz.

The default is legal, which results in 'Cannot select' errors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267520 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoTune basic block annotation algorithm.
Dehao Chen [Tue, 26 Apr 2016 04:59:11 +0000 (04:59 +0000)]
Tune basic block annotation algorithm.

Summary:
Instead of using maximum IR weight as the basic block weight, this patch uses the voting algorithm to find the most likely weight for the basic block. This can effectively avoid the cases when some IRs are annotated incorrectly due to code motion of the profiled binary.

This patch also updates propagate.ll unittest to include discriminator in the input file so that it is testing something meaningful.

Reviewers: davidxl, dnovillo

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267519 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[powerpc] mark JIT tests as UNSUPPORTED on powerpc64 big endian
Bill Seurer [Tue, 26 Apr 2016 03:59:19 +0000 (03:59 +0000)]
[powerpc] mark JIT tests as UNSUPPORTED on powerpc64 big endian

Some of the JIT tests began failing with "[llvm] r266663 - [Orc] Re-commit
r266581 with fixes for MSVC, and format cleanups." on powerpc64 big endian.
To get the buildbots running I am marking these as UNSUPPORTED for now.

If this is fixed remove the UNSUPPORTED flag "powerpc64-unknown-linux-gnu".

In r267516 I marked these as XFAIL but they succeed on some of the bots
on stage1.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267518 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoPass the test file in through stdin instead of by filename.
Richard Trieu [Tue, 26 Apr 2016 03:43:49 +0000 (03:43 +0000)]
Pass the test file in through stdin instead of by filename.

When passed in via filename, this test will fail if the path to the test
has the strings "f1" and "f2" in somewhere.  Pass the file through stdin
to prevent test failures due to coincidences in path names.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267517 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[powerpc] mark JIT tests as XFAIL on powerpc64 big endian
Bill Seurer [Tue, 26 Apr 2016 02:33:22 +0000 (02:33 +0000)]
[powerpc] mark JIT tests as XFAIL on powerpc64 big endian

Some of the JIT tests began failing with "[llvm] r266663 - [Orc] Re-commit
r266581 with fixes for MSVC, and format cleanups." on powerpc64 big endian.
To get the buildbots running I am marking these as XFAIL for now.

If this is fixed remove the XFAIL flag "powerpc64-unknown-linux-gnu".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267516 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SimplifyCFG] Preserve !llvm.mem.parallel_loop_access when merging
Hal Finkel [Tue, 26 Apr 2016 02:06:06 +0000 (02:06 +0000)]
[SimplifyCFG] Preserve !llvm.mem.parallel_loop_access when merging

When SimplifyCFG merges identical instructions from both sides of a diamond, it
can preserve !llvm.mem.parallel_loop_access (as it does with most of the other
metadata). There's no real data or control dependency change in this case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267515 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LoopVectorize] Don't consider conditional-load dereferenceability for marked paralle...
Hal Finkel [Tue, 26 Apr 2016 02:00:36 +0000 (02:00 +0000)]
[LoopVectorize] Don't consider conditional-load dereferenceability for marked parallel loops

I really thought we were doing this already, but we were not. Given this input:

void Test(int *res, int *c, int *d, int *p) {
  for (int i = 0; i < 16; i++)
    res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
}

we did not vectorize the loop. Even with "assume_safety" the check that we
don't if-convert conditionally-executed loads (to protect against
data-dependent deferenceability) was not elided.

One subtlety: As implemented, it will still prefer to use a masked-load
instrinsic (given target support) over the speculated load. The choice here
seems architecture specific; the best option depends on how expensive the
masked load is compared to a regular load. Ideally, using the masked load still
reduces unnecessary memory traffic, and so should be preferred. If we'd rather
do it the other way, flipping the order of the checks is easy.

The LangRef is updated to make explicit that llvm.mem.parallel_loop_access also
implies that if conversion is okay.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267514 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[lli] Fix a sign-compare warning.
Lang Hames [Tue, 26 Apr 2016 01:45:25 +0000 (01:45 +0000)]
[lli] Fix a sign-compare warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267512 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WebAssembly] Account for implicit operands when computing operand indices.
Dan Gohman [Tue, 26 Apr 2016 01:40:56 +0000 (01:40 +0000)]
[WebAssembly] Account for implicit operands when computing operand indices.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267511 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ORC] Try to work around a GCC 4.7 bug triggered by r267457.
Lang Hames [Tue, 26 Apr 2016 01:27:54 +0000 (01:27 +0000)]
[ORC] Try to work around a GCC 4.7 bug triggered by r267457.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267510 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SROA] Don't falsely report that changes have occured
David Majnemer [Tue, 26 Apr 2016 01:05:00 +0000 (01:05 +0000)]
[SROA] Don't falsely report that changes have occured

We would report that the function changed despite creating no new
allocas or performing any promotion.

This fixes PR27316.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267507 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoReverting Thumb2SizeReduction opt bisect change to fix failing buildbots.
Andrew Kaylor [Tue, 26 Apr 2016 00:56:36 +0000 (00:56 +0000)]
Reverting Thumb2SizeReduction opt bisect change to fix failing buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267506 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CodeGenPrepare] don't convert an unpredictable select into control flow
Sanjay Patel [Tue, 26 Apr 2016 00:47:39 +0000 (00:47 +0000)]
[CodeGenPrepare] don't convert an unpredictable select into control flow

Suggested in the review of D19488:
http://reviews.llvm.org/D19488

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267504 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRemove MinLatency in SchedMachineModel. NFC.
Junmo Park [Tue, 26 Apr 2016 00:37:46 +0000 (00:37 +0000)]
Remove MinLatency in SchedMachineModel. NFC.

Summary:
We don't use MinLatency any more since r184032.

Reviewers: atrick, hfinkel, mcrosier

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267502 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoPM: Port GlobalOpt to the new pass manager
Justin Bogner [Tue, 26 Apr 2016 00:28:01 +0000 (00:28 +0000)]
PM: Port GlobalOpt to the new pass manager

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267499 91177308-0d34-0410-b5e6-96231b3b80d8