oota-llvm.git
9 years ago[Hexagon] Adding missing load instructions and removing an unused multiclass parameter.
Colin LeMahieu [Mon, 9 Feb 2015 23:45:24 +0000 (23:45 +0000)]
[Hexagon] Adding missing load instructions and removing an unused multiclass parameter.

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

9 years agoADT: Allow up to 18 arguments in hash_combine()
Duncan P. N. Exon Smith [Mon, 9 Feb 2015 23:21:05 +0000 (23:21 +0000)]
ADT: Allow up to 18 arguments in hash_combine()

I just realized that the specialized metadata node patch I'm about to
commit won't compile on old compilers.  Bump `hash_combine()`'s support
for non-variadic templates to 18 (I tested this by reversing the logic
in the #ifdef).

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

9 years agoOn Windows, we now use RaiseException to generate the kind of trap we require (one...
Aaron Ballman [Mon, 9 Feb 2015 23:11:39 +0000 (23:11 +0000)]
On Windows, we now use RaiseException to generate the kind of trap we require (one which calls our vectored exception handler), and fall back to using a volatile write to simulate a trap elsewhere.

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

9 years ago[Hexagon] Factoring classes out of some load patterns and deleting some unused ones.
Colin LeMahieu [Mon, 9 Feb 2015 23:05:44 +0000 (23:05 +0000)]
[Hexagon] Factoring classes out of some load patterns and deleting some unused ones.

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

9 years ago[Statepoint] Improve two asserts, fix some style (NFC)
Ramkumar Ramachandra [Mon, 9 Feb 2015 23:02:10 +0000 (23:02 +0000)]
[Statepoint] Improve two asserts, fix some style (NFC)

Summary:
It's important that our users immediately know what gc.safepoint_poll
is. Also fix the style of the declaration of CreateGCStatepoint, in
preparation for another change that will wrap it.

Reviewers: reames

Subscribers: llvm-commits

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

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

9 years agoPlaceSafepoints: modernize gc.result.* -> gc.result
Ramkumar Ramachandra [Mon, 9 Feb 2015 23:00:40 +0000 (23:00 +0000)]
PlaceSafepoints: modernize gc.result.* -> gc.result

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

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

9 years agoDebugInfo: Remove DW_TAG_constant
Duncan P. N. Exon Smith [Mon, 9 Feb 2015 22:48:04 +0000 (22:48 +0000)]
DebugInfo: Remove DW_TAG_constant

Remove handling for DW_TAG_constant.  We started producing it in
r110656, but reverted that in r110876 without dropping the support.
Finish the job.

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

9 years agoUpdate file comment to clarify points highlighted in review (NFC)
Philip Reames [Mon, 9 Feb 2015 22:44:03 +0000 (22:44 +0000)]
Update file comment to clarify points highlighted in review (NFC)

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

9 years agoUse range for loops in PlaceSafepoints (NFC)
Philip Reames [Mon, 9 Feb 2015 22:26:11 +0000 (22:26 +0000)]
Use range for loops in PlaceSafepoints (NFC)

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

9 years agoIR: Take uint64_t in DIBuilder::createExpression()
Duncan P. N. Exon Smith [Mon, 9 Feb 2015 22:13:27 +0000 (22:13 +0000)]
IR: Take uint64_t in DIBuilder::createExpression()

`DIExpression` deals with `uint64_t`, so it doesn't make sense that
`createExpression()` is created from `int64_t`.  Switch to `uint64_t` to
unify them.

I've temporarily left in the `int64_t` version, which forwards to the
`uint64_t` version.  I'll delete it once I've updated the callers.

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

9 years agoIntroduce more tests for PlaceSafepoints
Philip Reames [Mon, 9 Feb 2015 22:10:15 +0000 (22:10 +0000)]
Introduce more tests for PlaceSafepoints

These tests the two optimizations for backedge insertion currently implemented and the split backedge flag which is currently off by default.

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

9 years agoRevert "Raising minimum required CMake version to 2.8.12.2."
Chris Bieneman [Mon, 9 Feb 2015 22:07:49 +0000 (22:07 +0000)]
Revert "Raising minimum required CMake version to 2.8.12.2."

This reverts commit add62ac537d8249fa2161405066e318ca80e199d.

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

9 years agoRaising minimum required CMake version to 2.8.12.2.
Chris Bieneman [Mon, 9 Feb 2015 22:05:07 +0000 (22:05 +0000)]
Raising minimum required CMake version to 2.8.12.2.

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

9 years ago[Hexagon] Removing more V4 predicates since V4 is the required minimum.
Colin LeMahieu [Mon, 9 Feb 2015 21:56:37 +0000 (21:56 +0000)]
[Hexagon] Removing more V4 predicates since V4 is the required minimum.

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

9 years agoMinor test cleanup
Philip Reames [Mon, 9 Feb 2015 21:50:31 +0000 (21:50 +0000)]
Minor test cleanup

a) add gc attribute
b) remove unused param

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

9 years agoMemDerefPrinter: Require DataLayoutPass for higher accuracy
Ramkumar Ramachandra [Mon, 9 Feb 2015 21:50:03 +0000 (21:50 +0000)]
MemDerefPrinter: Require DataLayoutPass for higher accuracy

Without a valid data layout, deferenceable(N) doesn't get parsed or
propagated. Since this is the key item we are testing, add a dependency
on the pass.

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

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

9 years agoAdd basic tests for PlaceSafepoints
Philip Reames [Mon, 9 Feb 2015 21:48:05 +0000 (21:48 +0000)]
Add basic tests for PlaceSafepoints

This is just adding really simple tests which should have been part of the original submission.  When doing so, I discovered that I'd mistakenly removed required pieces when preparing the patch for upstream submission.  I fixed two such bugs in this submission.

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

9 years agoVerifier: Const-qualify Metadata, NFC
Duncan P. N. Exon Smith [Mon, 9 Feb 2015 21:30:05 +0000 (21:30 +0000)]
Verifier: Const-qualify Metadata, NFC

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

9 years agoIR: Document horrible abuse of loose DIDescriptor, NFC
Duncan P. N. Exon Smith [Mon, 9 Feb 2015 21:26:34 +0000 (21:26 +0000)]
IR: Document horrible abuse of loose DIDescriptor, NFC

I'll circle back and fix this somehow; for now I just don't want to
forget about it.

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

9 years agoIR: Remove dead code in DITemplate*
Duncan P. N. Exon Smith [Mon, 9 Feb 2015 21:23:34 +0000 (21:23 +0000)]
IR: Remove dead code in DITemplate*

These are never referenced or filled in.

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

9 years agoisDereferenceablePointer: look through gc.relocate calls
Ramkumar Ramachandra [Mon, 9 Feb 2015 21:08:03 +0000 (21:08 +0000)]
isDereferenceablePointer: look through gc.relocate calls

While a theoretical GC might change dereferenceability on collection,
there is no such known collector and no need to account for the case
with a flag yet.

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

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

9 years ago[Hexagon] Removing v2-4 flags. V4 is the minimum supported version.
Colin LeMahieu [Mon, 9 Feb 2015 21:07:35 +0000 (21:07 +0000)]
[Hexagon] Removing v2-4 flags.  V4 is the minimum supported version.

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

9 years agoReduce the LockFileManager timeout, and provide unsafeRemoveLockFile
Ben Langmuir [Mon, 9 Feb 2015 20:34:24 +0000 (20:34 +0000)]
Reduce the LockFileManager timeout, and provide unsafeRemoveLockFile

5 minutes is an eternity, so try to strike a better balance between
waiting long enough for any reasonable module build and not so long that
users kill the process because they think it's hanging.

Also give the client a way to delete the lock file after a timeout.

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

9 years ago[Hexagon] Factoring classes out of store patterns.
Colin LeMahieu [Mon, 9 Feb 2015 20:33:46 +0000 (20:33 +0000)]
[Hexagon] Factoring classes out of store patterns.

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

9 years ago[Hexagon] Formatting v5 TD file. Removing commented defs.
Colin LeMahieu [Mon, 9 Feb 2015 20:03:42 +0000 (20:03 +0000)]
[Hexagon] Formatting v5 TD file.  Removing commented defs.

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

9 years agoMemDepPrinter: cleanup a few loops (NFC)
Ramkumar Ramachandra [Mon, 9 Feb 2015 19:49:54 +0000 (19:49 +0000)]
MemDepPrinter: cleanup a few loops (NFC)

Make use of the newly introduced inst_range to clean up two loops. Clean
up a third one while at it.

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

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

9 years agoAddress post-commit review for rL228587: make it explicit that the
Sanjoy Das [Mon, 9 Feb 2015 19:39:00 +0000 (19:39 +0000)]
Address post-commit review for rL228587: make it explicit that the
<NW> bit of a SCEVAddRecExpr does not depend on the sign of the step
and the start value of the step.

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

9 years ago[Hexagon] Cleaning up definition formatting.
Colin LeMahieu [Mon, 9 Feb 2015 19:24:44 +0000 (19:24 +0000)]
[Hexagon] Cleaning up definition formatting.

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

9 years agoClarify the wording on what it means for a SCEVAddRecExpr to be <NW>.
Sanjoy Das [Mon, 9 Feb 2015 18:44:42 +0000 (18:44 +0000)]
Clarify the wording on what it means for a SCEVAddRecExpr to be <NW>.

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

9 years agoBugfix: SCEV incorrectly marks certain add recurrences as nsw
Sanjoy Das [Mon, 9 Feb 2015 18:34:55 +0000 (18:34 +0000)]
Bugfix: SCEV incorrectly marks certain add recurrences as nsw

When creating a scev for sext({X,+,Y}), scev checks if the expression
is equivalent to {sext X,+,zext Y}.  If it can prove that, it also
tags the original {X,+,Y} as <nsw>, which is not correct.

In the test case I run `-scalar-evolution` twice because the bug
manifests only once SCEV has run through and seen the `sext`
expressions (and then does a in-place mutation on {X,+,Y}).

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

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

9 years ago[Orc] Revert r228567 (GCC ICE workaround) - it doesn't seem to have helped.
Lang Hames [Mon, 9 Feb 2015 18:16:43 +0000 (18:16 +0000)]
[Orc] Revert r228567 (GCC ICE workaround) - it doesn't seem to have helped.

As far as I can tell r228568 was the right workaround, and r228567 was
unnecessary. If reverting this causes problems on the bots I'll reinstate it.

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

9 years agofixed to test features, not CPUs
Sanjay Patel [Mon, 9 Feb 2015 17:17:09 +0000 (17:17 +0000)]
fixed to test features, not CPUs

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

9 years agoThis change implements the following three logical vector operations:
Kit Barton [Mon, 9 Feb 2015 17:03:18 +0000 (17:03 +0000)]
This change implements the following three logical vector operations:

veqv (vector equivalence)
vnand
vorc
I increased the AddedComplexity for these instructions to 500 to ensure they are generated instead of issuing other VSX instructions.

Phabricator review: http://reviews.llvm.org/D7469

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

9 years agorename variable to give it some meaning; remove obvious comments; NFC
Sanjay Patel [Mon, 9 Feb 2015 16:30:58 +0000 (16:30 +0000)]
rename variable to give it some meaning; remove obvious comments; NFC

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

9 years agofix comment that didn't match the code; remove unnecessary braces; NFC
Sanjay Patel [Mon, 9 Feb 2015 16:04:52 +0000 (16:04 +0000)]
fix comment that didn't match the code; remove unnecessary braces; NFC

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

9 years agoAllow ScalarEvolution to catch more min/max cases
Johannes Doerfert [Mon, 9 Feb 2015 12:34:23 +0000 (12:34 +0000)]
Allow ScalarEvolution to catch more min/max cases

  For the attached test case different types are used in the ICmpInst
  and SelectInst that represent the min/max expressions. However, if the
  ICmpInst type is smaller a comparison with the sign/zero extended
  operands would have yielded the same result. This situation might
  arise after the instruction combination pass was applied.

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

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

9 years ago[Orc] Try another workaround for the GCC 4.7.2 ICE introduced in r228557. NFC.
Lang Hames [Mon, 9 Feb 2015 07:47:32 +0000 (07:47 +0000)]
[Orc] Try another workaround for the GCC 4.7.2 ICE introduced in r228557. NFC.

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

9 years ago[Orc] Tweak lambda capture lists to try to avoid an ICE on gcc-4.7.2. NFC.
Lang Hames [Mon, 9 Feb 2015 07:22:56 +0000 (07:22 +0000)]
[Orc] Tweak lambda capture lists to try to avoid an ICE on gcc-4.7.2. NFC.

Apparently gcc-4.7.2 is touchy about 'this' appearing in a lambda capture list
along with other captures. I've rewritten my captures to try to avoid the issue.

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

9 years agoFix a bug in DemoteRegToStack where a reload instruction was inserted into the
Akira Hatanaka [Mon, 9 Feb 2015 06:38:23 +0000 (06:38 +0000)]
Fix a bug in DemoteRegToStack where a reload instruction was inserted into the
wrong basic block.

This would happen when the result of an invoke was used by a phi instruction
in the invoke's normal destination block. An instruction to reload the invoke's
value would get inserted before the critical edge was split and a new basic
block (which is the correct insertion point for the reload) was created. This
commit fixes the bug by splitting the critical edge before all the reload
instructions are inserted.

Also, hoist up the code which computes the insertion point to the only place
that need that computation.

rdar://problem/15978721

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

9 years agoMC: Calculate intra-section symbol differences correctly for COFF
David Majnemer [Mon, 9 Feb 2015 06:31:31 +0000 (06:31 +0000)]
MC: Calculate intra-section symbol differences correctly for COFF

This fixes PR22060.

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

9 years ago[Orc] Fix the MSVC bots by using LLVM_EXPLICIT rather than explicit.
Lang Hames [Mon, 9 Feb 2015 04:46:41 +0000 (04:46 +0000)]
[Orc] Fix the MSVC bots by using LLVM_EXPLICIT rather than explicit.

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

9 years ago[X86] Remove 256-bit and 512-bit memop pattern fragments. They are no longer used.
Craig Topper [Mon, 9 Feb 2015 04:04:53 +0000 (04:04 +0000)]
[X86] Remove 256-bit and 512-bit memop pattern fragments. They are no longer used.

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

9 years ago[X86] Remove 'memop' uses from AVX512. Use 'load' instead.
Craig Topper [Mon, 9 Feb 2015 04:04:50 +0000 (04:04 +0000)]
[X86] Remove 'memop' uses from AVX512. Use 'load' instead.

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

9 years agoDeadArgElim: fix mismatch in accounting of array return types.
Tim Northover [Mon, 9 Feb 2015 01:21:00 +0000 (01:21 +0000)]
DeadArgElim: fix mismatch in accounting of array return types.

Some parts of DeadArgElim were only considering the individual fields
of StructTypes separately, but others (where insertvalue &
extractvalue instructions occur) also looked into ArrayTypes.

This one is an actual bug; the mismatch can lead to an argument being
considered used by a return sub-value that isn't being tracked (and
hence is dead by default). It then gets incorrectly eliminated.

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

9 years agoDeadArgElim: assess uses of entire return value aggregate.
Tim Northover [Mon, 9 Feb 2015 01:20:53 +0000 (01:20 +0000)]
DeadArgElim: assess uses of entire return value aggregate.

Previously, a non-extractvalue use of an aggregate return value meant
the entire return was considered live (the algorithm gave up
entirely). This was correct, but conservative. It's better to actually
look at that Use, making the analysis results apply to all sub-values
under consideration.

E.g.

  %val = call { i32, i32 } @whatever()
  [...]
  ret { i32, i32 } %val

The return is using the entire aggregate (sub-values 0 and 1). We can
still simplify @whatever if we can prove that this return is itself
unused.

Also unifies the logic slightly between aggregate and non-aggregate
cases..

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

9 years ago[Orc] Add a JITSymbol class to the Orc APIs, refactor APIs, update clients.
Lang Hames [Mon, 9 Feb 2015 01:20:51 +0000 (01:20 +0000)]
[Orc] Add a JITSymbol class to the Orc APIs, refactor APIs, update clients.

This patch refactors a key piece of the Orc APIs: It removes the
*::getSymbolAddress and *::lookupSymbolAddressIn methods, which returned target
addresses (uint64_ts), and replaces them with *::findSymbol and *::findSymbolIn
respectively, which return instances of the new JITSymbol type. Unlike the old
methods, calling findSymbol or findSymbolIn does not cause the symbol to be
immediately materialized when found. Instead, the symbol will be materialized
if/when the getAddress method is called on the returned JITSymbol. This allows
us to query for the existence of symbols without actually materializing them. In
the future I expect more information to be attached to the JITSymbol class, for
example whether the returned symbol is a weak or strong definition. This will
allow us to properly handle weak symbols and multiple definitions.

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

9 years agoInstCombine: propagate nonNull through assume
Ramkumar Ramachandra [Mon, 9 Feb 2015 01:13:13 +0000 (01:13 +0000)]
InstCombine: propagate nonNull through assume

Make assume (load (call|invoke) != null) set nonNull return attribute
for the call and invoke. Also include tests.

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

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

9 years ago[emacs] Get llvm-mode to font-lock "personality"
Ramkumar Ramachandra [Mon, 9 Feb 2015 00:30:03 +0000 (00:30 +0000)]
[emacs] Get llvm-mode to font-lock "personality"

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

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

9 years agoFix -Wuninitialized build by referencing the relevant ctor parameter instead of the...
David Blaikie [Sun, 8 Feb 2015 23:15:37 +0000 (23:15 +0000)]
Fix -Wuninitialized build by referencing the relevant ctor parameter instead of the base class member variable.

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

9 years agoMake PDBSymbol's IPDBSymbol reference const.
Zachary Turner [Sun, 8 Feb 2015 22:53:53 +0000 (22:53 +0000)]
Make PDBSymbol's IPDBSymbol reference const.

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

9 years agoBugfix: ScalarEvolution incorrectly assumes that the start of certain
Sanjoy Das [Sun, 8 Feb 2015 22:52:17 +0000 (22:52 +0000)]
Bugfix: ScalarEvolution incorrectly assumes that the start of certain
add recurrences don't overflow.

This change makes the optimization more restrictive.  It still assumes
that an overflowing `add nsw` is undefined behavior; and this change
will need revisiting once we have a consistent semantics for poison
values.

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

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

9 years ago[X86] Remove the remaining uses of memop from AVX and AVX2 instruction patterns....
Craig Topper [Sun, 8 Feb 2015 22:38:25 +0000 (22:38 +0000)]
[X86] Remove the remaining uses of memop from AVX and AVX2 instruction patterns. AVX and AVX2 can handle unaligned loads being folded so we can just use 'load'

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

9 years agoMetadata: Use <algorithm> to simplify code. NFC.
Benjamin Kramer [Sun, 8 Feb 2015 21:56:09 +0000 (21:56 +0000)]
Metadata: Use <algorithm> to simplify code. NFC.

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

9 years agofix test attributes; this is an SSE2 test, not a Nehalem test
Sanjay Patel [Sun, 8 Feb 2015 21:14:27 +0000 (21:14 +0000)]
fix test attributes; this is an SSE2 test, not a Nehalem test

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

9 years agofix test attributes; this is an x86-64 test, not a Nehalem test
Sanjay Patel [Sun, 8 Feb 2015 21:10:40 +0000 (21:10 +0000)]
fix test attributes; this is an x86-64 test, not a Nehalem test

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

9 years agofix test attributes; these are SSE2 tests, not Nehalem tests
Sanjay Patel [Sun, 8 Feb 2015 21:05:03 +0000 (21:05 +0000)]
fix test attributes; these are SSE2 tests, not Nehalem tests

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

9 years agoKaleidoscope-Orc: Reuse the IRGen utility function in later chapters, and remove...
David Blaikie [Sun, 8 Feb 2015 21:03:30 +0000 (21:03 +0000)]
Kaleidoscope-Orc: Reuse the IRGen utility function in later chapters, and remove an unused parameter.

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

9 years agoDebugInfoPDB: Make the symbol base case hold an IPDBSession ref.
Zachary Turner [Sun, 8 Feb 2015 20:58:09 +0000 (20:58 +0000)]
DebugInfoPDB: Make the symbol base case hold an IPDBSession ref.

Dumping a symbol often requires access to data that isn't inside
the symbol hierarchy, but which is only accessible through the
top-level session.  This patch is a pure interface change to give
symbols a reference to the session.

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

9 years agofix test attributes; these are SSE2 tests, not Nehalem tests
Sanjay Patel [Sun, 8 Feb 2015 20:50:58 +0000 (20:50 +0000)]
fix test attributes; these are SSE2 tests, not Nehalem tests

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

9 years agoKaleidoscope-Orc: Extract IRGen work into a utility function.
David Blaikie [Sun, 8 Feb 2015 20:29:28 +0000 (20:29 +0000)]
Kaleidoscope-Orc: Extract IRGen work into a utility function.

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

9 years agoConstify the Orc Kaleidoscope examples IRGen functions.
David Blaikie [Sun, 8 Feb 2015 20:15:01 +0000 (20:15 +0000)]
Constify the Orc Kaleidoscope examples IRGen functions.

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

9 years agofix test attributes; these are x86-64 tests, not Nehalem tests
Sanjay Patel [Sun, 8 Feb 2015 20:05:53 +0000 (20:05 +0000)]
fix test attributes; these are x86-64 tests, not Nehalem tests

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

9 years agofix test attributes; these are MMX tests, not Nehalem tests
Sanjay Patel [Sun, 8 Feb 2015 20:01:12 +0000 (20:01 +0000)]
fix test attributes; these are MMX tests, not Nehalem tests

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

9 years agofix test attributes; these are SSE2 tests, not Nehalem tests
Sanjay Patel [Sun, 8 Feb 2015 19:50:55 +0000 (19:50 +0000)]
fix test attributes; these are SSE2 tests, not Nehalem tests

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

9 years agogeneralize test; nothing Nehalem-specific here
Sanjay Patel [Sun, 8 Feb 2015 19:38:25 +0000 (19:38 +0000)]
generalize test; nothing Nehalem-specific here

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

9 years ago[Orc][Kaleidoscope] Build Kaleidoscope/Orc tutorials with warnings.
Lang Hames [Sun, 8 Feb 2015 19:15:33 +0000 (19:15 +0000)]
[Orc][Kaleidoscope] Build Kaleidoscope/Orc tutorials with warnings.

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

9 years ago[Orc][Kaleidoscope] Remove fixed sized buffers from string conversion code and
Lang Hames [Sun, 8 Feb 2015 19:14:56 +0000 (19:14 +0000)]
[Orc][Kaleidoscope] Remove fixed sized buffers from string conversion code and
further c++ify the Kaleidoscope/Orc tutorials.

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

9 years agofix typos; NFC
Sanjay Patel [Sun, 8 Feb 2015 18:54:22 +0000 (18:54 +0000)]
fix typos; NFC

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

9 years ago[X86][AVX2] AVX2 broadcast + permute memory folding tests.
Simon Pilgrim [Sun, 8 Feb 2015 18:33:13 +0000 (18:33 +0000)]
[X86][AVX2] AVX2 broadcast + permute memory folding tests.

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

9 years agoMake UTF8->UTF16 conversion null terminate output on empty input.
Zachary Turner [Sun, 8 Feb 2015 18:08:51 +0000 (18:08 +0000)]
Make UTF8->UTF16 conversion null terminate output on empty input.

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

9 years agoMoved AVX2 vbroadcast (reg) instruction foldings under the correct grouping. NFC.
Simon Pilgrim [Sun, 8 Feb 2015 17:13:54 +0000 (17:13 +0000)]
Moved AVX2 vbroadcast (reg) instruction foldings under the correct grouping. NFC.

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

9 years agoCorrectly combine alias.scope metadata by a union instead of intersecting
Bjorn Steinbrink [Sun, 8 Feb 2015 17:07:14 +0000 (17:07 +0000)]
Correctly combine alias.scope metadata by a union instead of intersecting

Summary:
The alias.scope metadata represents sets of things an instruction might
alias with. When generically combining the metadata from two
instructions the result must be the union of the original sets, because
the new instruction might alias with anything any of the original
instructions aliased with.

Reviewers: hfinkel

Subscribers: llvm-commits

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

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

9 years ago[CMake] Kaleidoscope-Orc: Update libdeps.
NAKAMURA Takumi [Sun, 8 Feb 2015 11:15:08 +0000 (11:15 +0000)]
[CMake] Kaleidoscope-Orc: Update libdeps.

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

9 years agoMasked Gather and Scatter Intrinsics.
Elena Demikhovsky [Sun, 8 Feb 2015 08:27:19 +0000 (08:27 +0000)]
Masked Gather and Scatter Intrinsics.

Gather and Scatter are new introduced intrinsics, comming after recently implemented masked load and store.
This is the first patch for Gather and Scatter intrinsics. It includes only the syntax, parsing and verification.

Gather and Scatter intrinsics allow to perform multiple memory accesses (read/write) in one vector instruction.
The intrinsics are not target specific and will have the following syntax:
Gather:
declare <16 x i32> @llvm.masked.gather.v16i32(<16 x i32*> <vector of ptrs>, i32 <alignment>, <16 x i1> <mask>, <16 x i32> <passthru>)
declare <8 x float> @llvm.masked.gather.v8f32(<8 x float*><vector of ptrs>, i32 <alignment>, <8 x i1> <mask>, <8 x float><passthru>)

Scatter:
declare void @llvm.masked.scatter.v8i32(<8 x i32><vector value to be stored> , <8 x i32*><vector of ptrs> , i32 <alignment>, <8 x i1> <mask>)
declare void @llvm.masked.scatter.v16i32(<16 x i32> <vector value to be stored> , <16 x i32*> <vector of ptrs>, i32 <alignment>, <16 x i1><mask> )

Vector of ptrs - a set of source/destination addresses, to load/store the value.
Mask - switches on/off vector lanes to prevent memory access for switched-off lanes
vector of ptrs, value and mask should have the same vector width.

These are code examples where gather / scatter should be used and will allow function vectorization
;void foo1(int * restrict A, int * restrict B, int * restrict C) {
; for (int i=0; i<SIZE; i++) {
; A[i] = B[C[i]];
; }
;}

;void foo3(int * restrict A, int * restrict B) {
; for (int i=0; i<SIZE; i++) {
; A[B[i]] = i+5;
; }
;}

Tests will come in the following patches, with CodeGen and Vectorizer.

http://reviews.llvm.org/D7433

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

9 years agoAdd CMake build support for Orc examples (& fix some clang -Werror build
David Blaikie [Sun, 8 Feb 2015 07:20:04 +0000 (07:20 +0000)]
Add CMake build support for Orc examples (& fix some clang -Werror build
breaks due to unused variables).

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

9 years ago[Orc][Kaleidoscope] Fix method-name think-o. NFC.
Lang Hames [Sun, 8 Feb 2015 04:34:13 +0000 (04:34 +0000)]
[Orc][Kaleidoscope] Fix method-name think-o. NFC.

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

9 years agoARM & AArch64: teach LowerVSETCC that output type size may differ from input.
Tim Northover [Sun, 8 Feb 2015 00:50:47 +0000 (00:50 +0000)]
ARM & AArch64: teach LowerVSETCC that output type size may differ from input.

While various DAG combines try to guarantee that a vector SETCC
operation will have the same output size as input, there's nothing
intrinsic to either creation or LegalizeTypes that actually guarantees
it, so the function needs to be ready to handle a mismatch.

Fortunately this is easy enough, just extend or truncate the naturally
compared result.

I couldn't reproduce the failure in other backends that I know have
SIMD, so it's probably only an issue for these two due to shared
heritage.

Should fix PR21645.

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

9 years agoRemoved unused function mistakenly left in, triggering -Werror.
Zachary Turner [Sun, 8 Feb 2015 00:41:31 +0000 (00:41 +0000)]
Removed unused function mistakenly left in, triggering -Werror.

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

9 years agoSome cleanup for libpdb.
Zachary Turner [Sun, 8 Feb 2015 00:29:29 +0000 (00:29 +0000)]
Some cleanup for libpdb.

This patch implements a few of the optional suggestions from the
initial patch comitting libpdb.  In particular, it implements a
virtual function out of line for each of the concrete classes.

A few other minor cleanups exist as well, such as using override
instead of virtual, etc.

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

9 years ago[X86] Add register use/def for wrmsr and rdmsr.
Craig Topper [Sat, 7 Feb 2015 23:36:51 +0000 (23:36 +0000)]
[X86] Add register use/def for wrmsr and rdmsr.

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

9 years ago[X86] Add GETSEC instruction.
Craig Topper [Sat, 7 Feb 2015 23:36:36 +0000 (23:36 +0000)]
[X86] Add GETSEC instruction.

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

9 years ago[X86][AVX2] AVX2 integer stack folding tests.
Simon Pilgrim [Sat, 7 Feb 2015 23:28:16 +0000 (23:28 +0000)]
[X86][AVX2] AVX2 integer stack folding tests.

This adds tests for the remaining AVX2 instructions that currently support memory folding.

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

9 years agoRename the 'Extending the Language: Debug Information' to 'Adding Debug Information...
David Blaikie [Sat, 7 Feb 2015 23:23:43 +0000 (23:23 +0000)]
Rename the 'Extending the Language: Debug Information' to 'Adding Debug Information' since this isn't actually modifying/extending the language.

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

9 years ago[X86][AVX] Added missing stack folding support + test for vptest ymm instruction
Simon Pilgrim [Sat, 7 Feb 2015 21:44:06 +0000 (21:44 +0000)]
[X86][AVX] Added missing stack folding support + test for vptest ymm instruction

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

9 years agoLoopIdiom: Use utility functions.
Benjamin Kramer [Sat, 7 Feb 2015 21:37:08 +0000 (21:37 +0000)]
LoopIdiom: Use utility functions.

The only difference between deleteIfDeadInstruction and
RecursivelyDeleteTriviallyDeadInstructions is that the former also
manually invalidates SCEV. That's unnecessary because SCEV automatically
gets informed when an instruction is deleted via a ValueHandle. NFC.

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

9 years agoAvoid integer overflows around realloc calls resulting in potential
Joerg Sonnenberger [Sat, 7 Feb 2015 21:24:06 +0000 (21:24 +0000)]
Avoid integer overflows around realloc calls resulting in potential
heap. Problem identified by Guido Vranken. Changes differ from original
OpenBSD sources by not depending on non-portable reallocarray.

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

9 years ago[X86][SSE] Added missing stack folding tests for (v)mpsadbw instruction
Simon Pilgrim [Sat, 7 Feb 2015 21:20:11 +0000 (21:20 +0000)]
[X86][SSE] Added missing stack folding tests for (v)mpsadbw instruction

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

9 years agoValueTracking: Make isBytewiseValue simpler and more powerful at the same time.
Benjamin Kramer [Sat, 7 Feb 2015 19:29:02 +0000 (19:29 +0000)]
ValueTracking: Make isBytewiseValue simpler and more powerful at the same time.

Turns out there is a simpler way of checking that all bytes in a word are equal
than binary decomposition.

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

9 years agoProperly update AA metadata when performing call slot optimization
Bjorn Steinbrink [Sat, 7 Feb 2015 17:54:36 +0000 (17:54 +0000)]
Properly update AA metadata when performing call slot optimization

Subscribers: llvm-commits

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

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

9 years agoFix docs typo regarding lit.local.cfg files
Jonathan Roelofs [Sat, 7 Feb 2015 17:18:26 +0000 (17:18 +0000)]
Fix docs typo regarding lit.local.cfg files

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

9 years ago[BasicAA] Try to disambiguate GEPs through arrays of structs into
Ahmed Bougacha [Sat, 7 Feb 2015 17:04:29 +0000 (17:04 +0000)]
[BasicAA] Try to disambiguate GEPs through arrays of structs into
different fields.

We can show that two GEPs off of the same (possibly multidimensional)
array of structs, into different fields, can't alias.  Quoting:

For two GEPOperators GEP1 and GEP2, if we find that:
- both GEPs begin indexing from the exact same pointer;
- the last indices in both GEPs are constants, indexing into a struct;
- said indices are different, hence,the pointed-to fields are different;
- and both GEPs only index through arrays prior to that;

this lets us determine that the struct that GEP1 indexes into and the
struct that GEP2 indexes into must either precisely overlap or be
completely disjoint.  Because they cannot partially overlap, indexing
into different non-overlapping fields of the struct will never alias.

The other BasicAA::aliasGEP rules worked in some cases, but not all
(for example, the i32x3 struct in the testcase).
We can add this simple ad-hoc rule to complement them.

rdar://19717375
Differential Revision: http://reviews.llvm.org/D7453

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

9 years agoSCEV: Compress disposition pairs.
Benjamin Kramer [Sat, 7 Feb 2015 16:41:12 +0000 (16:41 +0000)]
SCEV: Compress disposition pairs.

Composing DenseMaps and SmallVectors is still somewhat suboptimal,
but this at least halves the size of the vector elements. NFC.

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

9 years agoSmallVector: Move emplace_back to SmallVectorImpl.
Benjamin Kramer [Sat, 7 Feb 2015 16:41:02 +0000 (16:41 +0000)]
SmallVector: Move emplace_back to SmallVectorImpl.

This resolves the strange effect that emplace_back is only available
when the type contained in the vector is not trivially copyable.

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

9 years ago[X86] Force fp stack folding tests to keep to specific domain.
Simon Pilgrim [Sat, 7 Feb 2015 16:14:55 +0000 (16:14 +0000)]
[X86] Force fp stack folding tests to keep to specific domain.

General boolean instructions (AND, ANDN, OR, XOR) need to use a specific domain instruction (and not just the default).

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

9 years ago[X86][AVX2] More AVX2 integer stack folding tests.
Simon Pilgrim [Sat, 7 Feb 2015 16:07:27 +0000 (16:07 +0000)]
[X86][AVX2] More AVX2 integer stack folding tests.

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

9 years agoFix typos; NFC.
Andrea Di Biagio [Sat, 7 Feb 2015 13:56:20 +0000 (13:56 +0000)]
Fix typos; NFC.

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

9 years agoMove DebugLocs around instead of copying.
Benjamin Kramer [Sat, 7 Feb 2015 12:28:15 +0000 (12:28 +0000)]
Move DebugLocs around instead of copying.

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

9 years agoMC: Emit COFF section flags in the "proper" order
David Majnemer [Sat, 7 Feb 2015 08:26:40 +0000 (08:26 +0000)]
MC: Emit COFF section flags in the "proper" order

COFF section flags are not idempotent:
  'rd' will make a read-write section because 'd' implies write
  'dr' will make a read-only section because 'r' disables write

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

9 years agoConsistently use override rather than virtual.
Chandler Carruth [Sat, 7 Feb 2015 08:12:22 +0000 (08:12 +0000)]
Consistently use override rather than virtual.

This fixes -Winconsistent-missing-override warnings.

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

9 years ago[PowerPC] Handle loop predecessor invokes
Hal Finkel [Sat, 7 Feb 2015 07:32:58 +0000 (07:32 +0000)]
[PowerPC] Handle loop predecessor invokes

If a loop predecessor has an invoke as its terminator, and the return value
from that invoke is used to determine the loop iteration space, then we can't
insert a computation based on that value in the loop predecessor prior to the
terminator (oops). If there's such an invoke, or just no predecessor for that
matter, insert a new loop preheader.

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