oota-llvm.git
10 years agounique_ptrify MCJIT::emitObject
David Blaikie [Wed, 3 Sep 2014 19:57:35 +0000 (19:57 +0000)]
unique_ptrify MCJIT::emitObject

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

10 years agounique_ptrify a bunch of stuff through RuntimeDyld::loadObject
David Blaikie [Wed, 3 Sep 2014 19:48:09 +0000 (19:48 +0000)]
unique_ptrify a bunch of stuff through RuntimeDyld::loadObject

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

10 years ago[x86] Make this test check everything for both SSE2 and AVX1 modes,
Chandler Carruth [Wed, 3 Sep 2014 19:39:10 +0000 (19:39 +0000)]
[x86] Make this test check everything for both SSE2 and AVX1 modes,
using a common 'all' prefix for the common test output.

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

10 years ago[FastISel] Some long overdue spring cleaning of FastISel.
Juergen Ributzka [Wed, 3 Sep 2014 18:46:45 +0000 (18:46 +0000)]
[FastISel] Some long overdue spring cleaning of FastISel.

Things got a little bit messy over the years and it is time for a little bit
spring cleaning.

This first commit is focused on the FastISel base class itself. It doxyfies all
comments, C++11fies the code where it makes sense, renames internal methods to
adhere to the coding standard, and clang-formats the files.

Reviewed by Eric

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

10 years agoFix downcasts of unaligned empty/tombstone DenseMap keys for DenseMap<AssertVH<T...
Alexey Samsonov [Wed, 3 Sep 2014 18:11:48 +0000 (18:11 +0000)]
Fix downcasts of unaligned empty/tombstone DenseMap keys for DenseMap<AssertVH<T>, Foo>.

Test Plan: llvm regression test suite

Reviewers: chandlerc, rsmith

Reviewed By: rsmith

Subscribers: llvm-commits

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

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

10 years agoAdd a regression test to sanity check the PBQP allocator.
Lang Hames [Wed, 3 Sep 2014 18:04:10 +0000 (18:04 +0000)]
Add a regression test to sanity check the PBQP allocator.

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

10 years agounique_ptrify IRObjectFile::createIRObjectFile
David Blaikie [Wed, 3 Sep 2014 17:59:23 +0000 (17:59 +0000)]
unique_ptrify IRObjectFile::createIRObjectFile

I took a guess at the changes to the gold plugin, because that doesn't
seem to build by default for me. Not sure what dependencies I might be
missing for that.

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

10 years ago[FastISel][AArch64] Move unconditional branch handling into 'SelectBranch'. NFC.
Juergen Ributzka [Wed, 3 Sep 2014 17:58:10 +0000 (17:58 +0000)]
[FastISel][AArch64] Move unconditional branch handling into 'SelectBranch'. NFC.

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

10 years agoRemoving static initializer from Debug.cpp by converting to a ManagedStatic.
Chris Bieneman [Wed, 3 Sep 2014 17:50:14 +0000 (17:50 +0000)]
Removing static initializer from Debug.cpp by converting to a ManagedStatic.

This is part of our larger effort to remove static initializers from LLVM libraries.

Reviewed by: chandlerc

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

10 years agounique_ptrify MachOUniversalBinary::create
David Blaikie [Wed, 3 Sep 2014 17:41:05 +0000 (17:41 +0000)]
unique_ptrify MachOUniversalBinary::create

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

10 years agoPreserve IR flags (nsw, nuw, exact, fast-math) in SLP vectorizer (PR20802).
Sanjay Patel [Wed, 3 Sep 2014 17:40:30 +0000 (17:40 +0000)]
Preserve IR flags (nsw, nuw, exact, fast-math) in SLP vectorizer (PR20802).

The SLP vectorizer should propagate IR-level optimization hints/flags (nsw, nuw, exact, fast-math)
when converting scalar instructions into vectors. But this isn't a simple copy - we need to take
the intersection (the logical 'and') of the sets of flags on the scalars.

The solution is further complicated because we can have non-uniform (non-SIMD) vector ops after:
http://reviews.llvm.org/D4015
http://llvm.org/viewvc/llvm-project?view=revision&revision=211339

The vast majority of changed files are existing tests that were not propagating IR flags, but I've
also added a new test file for focused testing of IR flag possibilities.

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

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

10 years agoPass a && to getLazyBitcodeModule.
Rafael Espindola [Wed, 3 Sep 2014 17:31:46 +0000 (17:31 +0000)]
Pass a && to getLazyBitcodeModule.

This forces callers to use std::move when calling it. It is somewhat odd to have
code with std::move that doesn't always move, but it is also odd to have code
without std::move that sometimes moves.

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

10 years agoEnsure ErrorOr cannot implicitly invoke explicit ctors of the underlying type.
David Blaikie [Wed, 3 Sep 2014 17:31:25 +0000 (17:31 +0000)]
Ensure ErrorOr cannot implicitly invoke explicit ctors of the underlying type.

An unpleasant surprise while migrating unique_ptrs (see changes in
lib/Object): ErrorOr<int*> was implicitly convertible to
ErrorOr<std::unique_ptr<int>>.

Keep the explicit conversions otherwise it's a pain to convert
ErrorOr<int*> to ErrorOr<std::unique_ptr<int>>.

I'm not sure if there should be more SFINAE on those explicit ctors (I
could check if !is_convertible && is_constructible, but since the ctor
has to be called explicitly I don't think there's any need to disable
them when !is_constructible - they'll just fail anyway. It's the
converting ctors that can create interesting ambiguities without proper
SFINAE). I had to SFINAE the explicit ones because otherwise they'd be
ambiguous with the implicit ones in an explicit context, so far as I
could tell.

The converting assignment operators seemed unnecessary (and similarly
buggy/dangerous) - just rely on the converting ctors to convert to the
right type for assignment instead.

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

10 years agoUpdate to not depend on "llvm-objdump -d -symbolize".
Rafael Espindola [Wed, 3 Sep 2014 16:16:02 +0000 (16:16 +0000)]
Update to not depend on "llvm-objdump -d -symbolize".

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

10 years agoR600/SI: Add a pattern for i64 and in a branch
Tom Stellard [Wed, 3 Sep 2014 15:22:41 +0000 (15:22 +0000)]
R600/SI: Add a pattern for i64 and in a branch

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

10 years agoR600/SI: Fix typos in SIInstrInfo::areLoadsFromSameBasePtr()
Tom Stellard [Wed, 3 Sep 2014 15:22:39 +0000 (15:22 +0000)]
R600/SI: Fix typos in SIInstrInfo::areLoadsFromSameBasePtr()

This fixes a crash in the OpenCV test:
ImgprocWarpResizeArea/Resize.Mat/16

There is no test case for this, because this failure depends on a
specific ordering of the loads, which could easily change.

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

10 years agoCheck-label a bit more specific
Renato Golin [Wed, 3 Sep 2014 13:32:08 +0000 (13:32 +0000)]
Check-label a bit more specific

Sometimes, the .file could be reordered and it'd identify the ldr in the filename as a bad match.

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

10 years agoDocument !and. Fix !shl and friends -- they provide binary operations.
Joerg Sonnenberger [Wed, 3 Sep 2014 13:17:03 +0000 (13:17 +0000)]
Document !and. Fix !shl and friends -- they provide binary operations.

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

10 years agoFix configure and make build of llvm examples.
Iain Sandoe [Wed, 3 Sep 2014 13:12:16 +0000 (13:12 +0000)]
Fix configure and make build of llvm examples.

Replaced link component 'jit' with 'mcjit'.

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

10 years agoAdd override to overriden virtual methods, remove virtual keywords.
Benjamin Kramer [Wed, 3 Sep 2014 11:41:21 +0000 (11:41 +0000)]
Add override to overriden virtual methods, remove virtual keywords.

No functionality change. Changes made by clang-tidy + some manual cleanup.

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

10 years agoFix ambiguous call to make_unique and clang-format.
Yaron Keren [Wed, 3 Sep 2014 08:22:30 +0000 (08:22 +0000)]
Fix ambiguous call to make_unique and clang-format.

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

10 years agoFollow-up for r217020: actually commit the fix for PR20800,
Alexander Potapenko [Wed, 3 Sep 2014 07:37:20 +0000 (07:37 +0000)]
Follow-up for r217020: actually commit the fix for PR20800,
revert the accidentally committed changes to LLVMSymbolize.cpp

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

10 years agoFix PR20800: correctly calculate the offset of the subq instruction when generating...
Alexander Potapenko [Wed, 3 Sep 2014 07:11:34 +0000 (07:11 +0000)]
Fix PR20800: correctly calculate the offset of the subq instruction when generating compact unwind info.

This CL replaces the constant DarwinX86AsmBackend.PushInstrSize with a method
that lets the backend account for different sizes of "push %reg" instruction
sizes.

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

10 years agoReapply r216805 "[MachineCombiner][AArch64] Use the correct register class for MADD...
Juergen Ributzka [Wed, 3 Sep 2014 07:07:10 +0000 (07:07 +0000)]
Reapply r216805 "[MachineCombiner][AArch64] Use the correct register class for MADD, SUB, and OR.""

This reapplies r216805 with a fix to a copy-past error, which resulted in an
incorrect register class.

Original commit message:
Select the correct register class for the various instructions that are
generated when combining instructions and constrain the registers to the
appropriate register class.

This fixes rdar://problem/18183707.

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

10 years agoRecommit "Use unique_ptr to manager FilterChooser ownership."
Craig Topper [Wed, 3 Sep 2014 06:07:54 +0000 (06:07 +0000)]
Recommit "Use unique_ptr to manager FilterChooser ownership."

Just using insert of a pair this time instead of emplace.

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

10 years agoRevert "Use unique_ptr to manager FilterChooser ownership."
Craig Topper [Wed, 3 Sep 2014 05:59:23 +0000 (05:59 +0000)]
Revert "Use unique_ptr to manager FilterChooser ownership."

std::map::emplace isn't working on some of the bots.

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

10 years agoUse unique_ptr to manager FilterChooser ownership.
Craig Topper [Wed, 3 Sep 2014 05:49:09 +0000 (05:49 +0000)]
Use unique_ptr to manager FilterChooser ownership.

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

10 years agoImplement move constructor and remove copy constructor for Filter objects in FixedLen...
Craig Topper [Wed, 3 Sep 2014 05:49:07 +0000 (05:49 +0000)]
Implement move constructor and remove copy constructor for Filter objects in FixedLenDecoderEmitter. Also remove unused copy constructor of FilterChooser.

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

10 years ago[MCJIT] Make llvm-rtdyld process eh_frame sections in -verify mode (accidentally
Lang Hames [Wed, 3 Sep 2014 05:42:52 +0000 (05:42 +0000)]
[MCJIT] Make llvm-rtdyld process eh_frame sections in -verify mode (accidentally
left out of r217010).

Also remove a crufty debugging output statement that was accidentally left in.

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

10 years ago[MCJIT] Add a 'section_addr' builtin function to RuntimeDyldChecker.
Lang Hames [Wed, 3 Sep 2014 05:01:46 +0000 (05:01 +0000)]
[MCJIT] Add a 'section_addr' builtin function to RuntimeDyldChecker.

The syntax of the new builtin is 'section_addr(<filename>, <section-name>)'
(similar to the stub_addr builtin, but without a symbol name). It returns the
base address of the given section in the given object file. This builtin makes
it possible to refer to the contents of sections that cannot contain symbols,
e.g. sections added by the linker itself, like __eh_frame.

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

10 years ago[FastISel][AArch64] Add target-dependent instruction selection for Add/Sub.
Juergen Ributzka [Wed, 3 Sep 2014 01:38:36 +0000 (01:38 +0000)]
[FastISel][AArch64] Add target-dependent instruction selection for Add/Sub.

There is already target-dependent instruction selection support for Adds/Subs to
support compares and the intrinsics with overflow check. This takes advantage of
the existing infrastructure to also support Add/Sub, which allows the folding of
immediates, sign-/zero-extends, and shifts.

This fixes rdar://problem/18207316.

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

10 years agoFix test case to match correct llvm-objdump output
Nick Kledzik [Wed, 3 Sep 2014 01:34:58 +0000 (01:34 +0000)]
Fix test case to match correct llvm-objdump output

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

10 years agoReplace printf with outs() <<
Nick Kledzik [Wed, 3 Sep 2014 01:12:52 +0000 (01:12 +0000)]
Replace printf with outs() <<

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

10 years agoChange name of copyFlags() to copyIRFlags(). Add convenience method for logical ...
Sanjay Patel [Wed, 3 Sep 2014 01:06:50 +0000 (01:06 +0000)]
Change name of copyFlags() to copyIRFlags(). Add convenience method for logical 'and' of all flags. NFC.

Adding 'IR' to the names in an attempt to be less ambiguous about the flags we're dealing with here.

The 'and' method is needed by the SLPVectorizer (PR20802) and possibly other passes.

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

10 years ago[CFLAA] Remove one final initializer list
Hal Finkel [Wed, 3 Sep 2014 00:06:47 +0000 (00:06 +0000)]
[CFLAA] Remove one final initializer list

Maybe MSVC will be happy now...

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

10 years ago[CFLAA] And even more MSVC fixes
Hal Finkel [Tue, 2 Sep 2014 23:50:01 +0000 (23:50 +0000)]
[CFLAA] And even more MSVC fixes

Remove a couple more initializer lists and constexpr dependencies.

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

10 years agoCleaning up remaining static initializers in Signals.inc
Chris Bieneman [Tue, 2 Sep 2014 23:48:13 +0000 (23:48 +0000)]
Cleaning up remaining static initializers in Signals.inc

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

10 years ago[CFLAA] More cleanup for MSVC
Hal Finkel [Tue, 2 Sep 2014 23:29:48 +0000 (23:29 +0000)]
[CFLAA] More cleanup for MSVC

Remove more initializer lists, etc.

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

10 years agoTablegen scheduling models don't reference empty itineraries as of r216919, so don...
Pete Cooper [Tue, 2 Sep 2014 23:23:34 +0000 (23:23 +0000)]
Tablegen scheduling models don't reference empty itineraries as of r216919, so don't emit the unused itinerary variables

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

10 years ago[CFLAA] No initializer lists for MSVC
Hal Finkel [Tue, 2 Sep 2014 22:52:30 +0000 (22:52 +0000)]
[CFLAA] No initializer lists for MSVC

MSVC 2012 does not understand initializer lists; remove them.

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

10 years agoMissing test from r216989
Renato Golin [Tue, 2 Sep 2014 22:46:18 +0000 (22:46 +0000)]
Missing test from r216989

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

10 years agoOnly emit movw on ARMv6T2+
Renato Golin [Tue, 2 Sep 2014 22:45:13 +0000 (22:45 +0000)]
Only emit movw on ARMv6T2+

Fix PR18364.

Patch by Dimitry Andric.

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

10 years agounique_ptrify passing the TargetMachine to ExecutionEngine::MCJITCtor
David Blaikie [Tue, 2 Sep 2014 22:41:07 +0000 (22:41 +0000)]
unique_ptrify passing the TargetMachine to ExecutionEngine::MCJITCtor

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

10 years ago[CFLAA] Remove tautological comparison
Hal Finkel [Tue, 2 Sep 2014 22:36:58 +0000 (22:36 +0000)]
[CFLAA] Remove tautological comparison

Fixes this (the warning is right, the unsigned value is not negative):
lib/Analysis/StratifiedSets.h:689:53: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare]
  bool inbounds(StratifiedIndex N) const { return N >= 0 && N < Links.size(); }

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

10 years ago[FastISel][AArch64] Use the target-dependent selection code for shifts first.
Juergen Ributzka [Tue, 2 Sep 2014 22:33:57 +0000 (22:33 +0000)]
[FastISel][AArch64] Use the target-dependent selection code for shifts first.

This uses the target-dependent selection code for shifts first, which allows us
to create better code for shifts with immediates and sign-/zero-extend folding.

Vector type are not handled yet and the code falls back to target-independent
instruction selection for these cases.

This fixes rdar://problem/17907920.

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

10 years ago[FastISel][AArch64] Use a new helper function to determine if a value type is support...
Juergen Ributzka [Tue, 2 Sep 2014 22:33:53 +0000 (22:33 +0000)]
[FastISel][AArch64] Use a new helper function to determine if a value type is supported. NFCI.

FastISel for AArch64 supports more value types than are actually legal. Use a
dedicated helper function to reflect this.

It is very similar to the isLoadStoreTypeLegal function, with the exception
that vector types are not supported yet.

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

10 years agoNuke MCAnalysis.
Sean Silva [Tue, 2 Sep 2014 22:32:20 +0000 (22:32 +0000)]
Nuke MCAnalysis.

The code is buggy and barely tested. It is also mostly boilerplate.
(This includes MCObjectDisassembler, which is the interface to that
functionality)

Following an IRC discussion with Jim Grosbach, it seems sensible to just
nuke the whole lot of functionality, and dig it up from VCS if
necessary (I hope not!).

All of this stuff appears to have been added in a huge patch dump (look
at the timeframe surrounding e.g. r182628) where almost every patch
seemed to be untested and not reviewed before being committed.
Post-review responses to the patches were never addressed. I don't think
any of it would have passed pre-commit review.

I doubt anyone is depending on this, since this code appears to be
extremely buggy. In limited testing that Michael Spencer and I did, we
couldn't find a single real-world object file that wouldn't crash the
CFG reconstruction stuff. The symbolizer stuff has O(n^2) behavior and
so is not much use to anyone anyway. It seemed simpler to remove them as
a whole. Most of this code is boilerplate, which is the only way it was
able to scrape by 60% coverage.

HEADSUP: Modules folks, some files I nuked were referenced from
include/llvm/module.modulemap; I just deleted the references. Hopefully
that is the right fix (one was a FIXME though!).

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

10 years agoReinstate "Nuke the old JIT."
Eric Christopher [Tue, 2 Sep 2014 22:28:02 +0000 (22:28 +0000)]
Reinstate "Nuke the old JIT."
Approved by Jim Grosbach, Lang Hames, Rafael Espindola.

This reinstates commits r215111, 215115, 215116, 215117, 215136.

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

10 years ago[CFLAA] LLVM_CONSTEXPR -> const
Hal Finkel [Tue, 2 Sep 2014 22:26:06 +0000 (22:26 +0000)]
[CFLAA] LLVM_CONSTEXPR -> const

The number is just a constant, and this should make MSVC happy (or at least
happier).

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

10 years ago[X86] Allow atomic operations using immediates to avoid using a register
Robin Morisset [Tue, 2 Sep 2014 22:16:29 +0000 (22:16 +0000)]
[X86] Allow atomic operations using immediates to avoid using a register

The only valid lowering of atomic stores in the X86 backend was mov from
register to memory. As a result, storing an immediate required a useless copy
of the immediate in a register. Now these can be compiled as a simple mov.

Similarily, adding/and-ing/or-ing/xor-ing an
immediate to an atomic location (but through an atomic_store/atomic_load,
not a fetch_whatever intrinsic) can now make use of an 'add $imm, x(%rip)'
instead of using a register. And the same applies to inc/dec.

This second point matches the first issue identified in
  http://llvm.org/bugs/show_bug.cgi?id=17281

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

10 years ago[CFLAA] constexpr -> LLVM_CONSTEXPR
Hal Finkel [Tue, 2 Sep 2014 22:13:00 +0000 (22:13 +0000)]
[CFLAA] constexpr -> LLVM_CONSTEXPR

Attempt to fix the MSVC build by not using constexpr.

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

10 years agoAdd pass-manager flags to use CFL AA
Hal Finkel [Tue, 2 Sep 2014 22:12:54 +0000 (22:12 +0000)]
Add pass-manager flags to use CFL AA

Add -use-cfl-aa (and -use-cfl-aa-in-codegen) to add CFL AA in the default pass
managers (for easy testing).

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

10 years agoBumpPtrAllocator: use uintptr_t when aligning addresses to avoid undefined behaviour
Hans Wennborg [Tue, 2 Sep 2014 21:51:35 +0000 (21:51 +0000)]
BumpPtrAllocator: use uintptr_t when aligning addresses to avoid undefined behaviour

In theory, alignPtr() could push a pointer beyond the end of the current slab, making
comparisons with that pointer undefined behaviour. Use an integer type to avoid this.

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

10 years ago[asan] Assign a low branch weight to ASan's slow path, patch by Jonas Wagner. This...
Kostya Serebryany [Tue, 2 Sep 2014 21:46:51 +0000 (21:46 +0000)]
[asan]  Assign a low branch weight to ASan's slow path, patch by Jonas Wagner. This speeds up asan (at least on SPEC) by 1%-5% or more. Also fix lint in dfsan.

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

10 years agoR600/SI: Relax some ordering in tests.
Matt Arsenault [Tue, 2 Sep 2014 21:45:50 +0000 (21:45 +0000)]
R600/SI: Relax some ordering in tests.

This will help with enabling misched

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

10 years agoAdd a CFL Alias Analysis implementation
Hal Finkel [Tue, 2 Sep 2014 21:43:13 +0000 (21:43 +0000)]
Add a CFL Alias Analysis implementation

This provides an implementation of CFL alias analysis (including some
supporting data structures). Currently, we don't have any extremely fancy
features, sans some interprocedural analysis (i.e. no field sensitivity, etc.),
and we do best sitting behind BasicAA + TBAA. In such a configuration, we take
~0.6-0.8% of total compile time, and give ~7-8% NoAlias responses to queries
TBAA and BasicAA couldn't answer when bootstrapping LLVM. In testing this on
other projects, we've seen up to 10.5% of queries dropped by BasicAA+TBAA
answered with NoAlias by this algorithm.

Patch by George Burgess IV (with minor modifications by me -- mostly adapting
some BasicAA tests), thanks!

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

10 years ago[FastISel][AArch64] Move over to target-dependent instruction selection only.
Juergen Ributzka [Tue, 2 Sep 2014 21:32:54 +0000 (21:32 +0000)]
[FastISel][AArch64] Move over to target-dependent instruction selection only.

This change moves FastISel for AArch64 to target-dependent instruction selection
only. This change replicates the existing target-independent behavior, therefore
there are no changes to the unit tests or new tests.

Future changes will take advantage of this change and update functionality
and unit tests.

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

10 years ago[FastISel] Provide the option to skip target-independent instruction selection. NFC.
Juergen Ributzka [Tue, 2 Sep 2014 21:07:44 +0000 (21:07 +0000)]
[FastISel] Provide the option to skip target-independent instruction selection. NFC.

This allows the target to disable target-independent instruction selection and
jump directly into the target-dependent instruction selection code.

This can be beneficial for targets, such as AArch64, which could emit much
better code, but never got a chance to do so, because the target-independent
instruction selector was able to find an instruction sequence.

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

10 years agoGenerate extract for in-tree uses if the use is scalar operand in vectorized instruct...
Yi Jiang [Tue, 2 Sep 2014 21:00:39 +0000 (21:00 +0000)]
Generate extract for in-tree uses if the use is scalar operand in vectorized instruction. radar://18144665

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

10 years agoR600/SI: Fix hardcoded register numbers in test
Matt Arsenault [Tue, 2 Sep 2014 20:43:07 +0000 (20:43 +0000)]
R600/SI: Fix hardcoded register numbers in test

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

10 years agoRefactor LowerFABS and LowerFNEG into one function (x86) (NFC)
Sanjay Patel [Tue, 2 Sep 2014 20:24:47 +0000 (20:24 +0000)]
Refactor LowerFABS and LowerFNEG into one function (x86) (NFC)

We duplicate ~30 lines of code to lower FABS and FNEG for x86, so this patch combines them into one function.
No functional change intended, so no additional test cases. Test-suite behavior is unchanged.

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

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

10 years agocmake: Don't reject unknown cpp files that start with .
Matt Arsenault [Tue, 2 Sep 2014 20:20:43 +0000 (20:20 +0000)]
cmake: Don't reject unknown cpp files that start with .

Some editors create hidden file backups in the same
directory as the file, and it's annoying when cmake
errors on them.

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

10 years agoFix MemoryDependenceAnalysis in cases where QueryInstr is a CmpXchg or a AtomicRMW
Robin Morisset [Tue, 2 Sep 2014 20:17:52 +0000 (20:17 +0000)]
Fix MemoryDependenceAnalysis in cases where QueryInstr is a CmpXchg or a AtomicRMW

Summary:
MemoryDependenceAnalysis is currently cautious when the QueryInstr is an atomic
load or store, but I forgot to check for atomic cmpxchg/atomicrmw. This patch
is a way of fixing that, and making it less brittle (i.e. no risk that I forget
another possible kind of atomic, even if the IR ends up changing in the future),
by adding a fallback checking mayReadOrWriteFromMemory.

Thanks to Philip Reames for finding this bug and suggesting this solution in
http://reviews.llvm.org/D4845

Sadly, I don't see how to add a test for this, since the passes depending on
MemoryDependenceAnalysis won't trigger for an atomic rmw anyway. Does anyone
see a way for testing it?

Test Plan: none possible at first sight

Reviewers: jfb, reames

Subscribers: llvm-commits

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

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

10 years agoFix a logic bug when copying fast-math flags.
Sanjay Patel [Tue, 2 Sep 2014 20:03:00 +0000 (20:03 +0000)]
Fix a logic bug when copying fast-math flags.

"Setting" does not equal "copying". This bug has sat dormant for 2 reasons:
1. The unit test was not adequate.
2. Every current user of the "copyFastMathFlags" API is operating on a new instruction.
   (ie, all existing fast-math flags are off). If you copy flags to an existing
   instruction that has some flags on already, you will not necessarily turn them off
   as expected.

I uncovered this bug while trying to implement a fix for PR20802.

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

10 years agoAdd a note about AuroraUX to the release notes.
Rafael Espindola [Tue, 2 Sep 2014 19:49:39 +0000 (19:49 +0000)]
Add a note about AuroraUX to the release notes.

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

10 years agoAdd note to documentation about machine node chains.
Matt Arsenault [Tue, 2 Sep 2014 19:18:52 +0000 (19:18 +0000)]
Add note to documentation about machine node chains.

I've been assuming chain operands were always the first operand,
since the documentation says this. I was confused about why they
were missing after instruction selection. Apparently the convention
changes to using the last operand for MachineSDNodes and I've never
noticed before.

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

10 years agoR600/SI: Add failing testcase.
Matt Arsenault [Tue, 2 Sep 2014 19:12:31 +0000 (19:12 +0000)]
R600/SI: Add failing testcase.

This is broken when 64-bit add is only partially
moved to the VALU.

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

10 years agoFix interference caused by fmul 2, x -> fadd x, x
Matt Arsenault [Tue, 2 Sep 2014 19:02:53 +0000 (19:02 +0000)]
Fix interference caused by fmul 2, x -> fadd x, x

If an fmul was introduced by lowering, it wouldn't be folded
into a multiply by a constant since the earlier combine would
have replaced the fmul with the fadd.

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

10 years agoCode review tweaks
Nick Kledzik [Tue, 2 Sep 2014 18:50:24 +0000 (18:50 +0000)]
Code review tweaks

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

10 years agoFix crash when looking up the addrspace of GEPs with vector types
Matt Arsenault [Tue, 2 Sep 2014 18:47:54 +0000 (18:47 +0000)]
Fix crash when looking up the addrspace of GEPs with vector types

Patch by Björn Steinbrink

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

10 years agoCodeGen: Handle va_start in the entry block
Reid Kleckner [Tue, 2 Sep 2014 18:42:44 +0000 (18:42 +0000)]
CodeGen: Handle va_start in the entry block

Also fix a small copy-paste bug in X86ISelLowering where Chain should
have been used in place of DAG.getEntryToken().

Fixes PR20828.

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

10 years agoFix comment and unnecessary check for FP build_vectors.
Matt Arsenault [Tue, 2 Sep 2014 18:33:51 +0000 (18:33 +0000)]
Fix comment and unnecessary check for FP build_vectors.

This was copy-paste from the integer version, but
FP build_vectors don't truncate.

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

10 years agounique_ptrify LTOCodeGenerator::NativeObjectFile
David Blaikie [Tue, 2 Sep 2014 18:21:06 +0000 (18:21 +0000)]
unique_ptrify LTOCodeGenerator::NativeObjectFile

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

10 years agounique_ptrify the result of SpecialCaseList::create
David Blaikie [Tue, 2 Sep 2014 18:13:54 +0000 (18:13 +0000)]
unique_ptrify the result of SpecialCaseList::create

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

10 years agoMCSchedule.h: fix VS2012 build after r216919
Hans Wennborg [Tue, 2 Sep 2014 18:00:00 +0000 (18:00 +0000)]
MCSchedule.h: fix VS2012 build after r216919

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

10 years agounique_ptrify FileOutputBuffer::FileOutputBuffer
David Blaikie [Tue, 2 Sep 2014 17:49:23 +0000 (17:49 +0000)]
unique_ptrify FileOutputBuffer::FileOutputBuffer

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

10 years agoFix left shifts of negative values in MipsDisassembler.
Alexey Samsonov [Tue, 2 Sep 2014 17:49:16 +0000 (17:49 +0000)]
Fix left shifts of negative values in MipsDisassembler.

This bug was reported by UBSan.

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

10 years agoChange MCSchedModel to be a struct of statically initialized data.
Pete Cooper [Tue, 2 Sep 2014 17:43:54 +0000 (17:43 +0000)]
Change MCSchedModel to be a struct of statically initialized data.

This removes static initializers from the backends which generate this data, and also makes this struct match the other Tablegen generated structs in behaviour

Reviewed by Andy Trick and Chandler C

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

10 years agounique_ptrify PBQPBuilder::build
David Blaikie [Tue, 2 Sep 2014 17:42:01 +0000 (17:42 +0000)]
unique_ptrify PBQPBuilder::build

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

10 years agoFix signed integer overflow in PPCInstPrinter.
Alexey Samsonov [Tue, 2 Sep 2014 17:38:34 +0000 (17:38 +0000)]
Fix signed integer overflow in PPCInstPrinter.

This bug was reported by UBSan.

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

10 years agoCorrect unique_ptr passing in MCObjectDisassembler::setFallbackRegion
David Blaikie [Tue, 2 Sep 2014 17:29:51 +0000 (17:29 +0000)]
Correct unique_ptr passing in MCObjectDisassembler::setFallbackRegion

Rather than passing by lvalue reference, pass by value to ensure that
the caller provides an rvalue (and use move assignment, rather than
release+reset, to assign to the member variable)

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

10 years agoFix left shifts by too large exponents in MCParser
Alexey Samsonov [Tue, 2 Sep 2014 17:25:29 +0000 (17:25 +0000)]
Fix left shifts by too large exponents in MCParser
(which happened only on error recovery path).

This bug was reported by UBSan.

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

10 years agoRevert: [APFloat] Fixed a bug in method 'fusedMultiplyAdd'.
Andrea Di Biagio [Tue, 2 Sep 2014 17:22:49 +0000 (17:22 +0000)]
Revert: [APFloat] Fixed a bug in method 'fusedMultiplyAdd'.

This reverts revision 216913; the new test added at revision 216913
caused regression failures on a couple of buildbots.

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

10 years ago[APFloat] Fixed a bug in method 'fusedMultiplyAdd'.
Andrea Di Biagio [Tue, 2 Sep 2014 16:44:56 +0000 (16:44 +0000)]
[APFloat] Fixed a bug in method 'fusedMultiplyAdd'.

When folding a fused multiply-add builtin call, make sure that we propagate the
correct result in the case where the addend is zero, and the two other operands
are finite non-zero.

Example:
  define double @test() {
    %1 = call double @llvm.fma.f64(double 7.0, double 8.0, double 0.0)
    ret double %1
  }

Before this patch, the instruction simplifier wrongly folded the builtin call
in function @test to constant 'double 7.0'.
With this patch, method 'fusedMultiplyAdd' correctly evaluates the multiply and
propagates the expected result (i.e. 56.0).

Added test fold-builtin-fma.ll with the reproducible from PR20832 plus extra
test cases to verify the behavior of method 'fusedMultiplyAdd' in the presence
of NaN/Inf operands.

This fixes PR20832.

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

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

10 years agoAdd missing override on ARMAsmBackend's dtor.
JF Bastien [Tue, 2 Sep 2014 16:26:55 +0000 (16:26 +0000)]
Add missing override on ARMAsmBackend's dtor.

Test Plan: ninja check && ninja clang-test

Subscribers: aemerson

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

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

10 years agoLICM: Don't crash when an instruction is used by an unreachable BB
David Majnemer [Tue, 2 Sep 2014 16:22:00 +0000 (16:22 +0000)]
LICM: Don't crash when an instruction is used by an unreachable BB

Summary:
BBs might contain non-LCSSA'd values after the LCSSA pass is run if they
are unreachable from the entry block.

Normally, the users of the instruction would be PHIs but the unreachable
BBs have normal users; rewrite their uses to be undef values.

An alternative fix could involve fixing this at LCSSA but that would
require this invariant to hold after subsequent transforms.  If a BB
created an unreachable block, they would be in violation of this.

This fixes PR19798.

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

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

10 years agoFix left shifts of negative integers in AArch64 InstPrinter/Disassembler
Alexey Samsonov [Tue, 2 Sep 2014 16:19:41 +0000 (16:19 +0000)]
Fix left shifts of negative integers in AArch64 InstPrinter/Disassembler

Summary:
Left shift of negative integer is an undefined behavior, and
is reported by UBSan. It's ok for imm values to be negative, so we can
just replace left shifts with multiplications.

Test Plan: check-llvm test suite

Reviewers: t.p.northover

Reviewed By: t.p.northover

Subscribers: aemerson, mcrosier, llvm-commits

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

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

10 years agoEnable splitting indexing from loads with TargetConstants
Hal Finkel [Tue, 2 Sep 2014 16:05:23 +0000 (16:05 +0000)]
Enable splitting indexing from loads with TargetConstants

When I recommitted r208640 (in r216898) I added an exclusion for TargetConstant
offsets, as there is no guarantee that a backend can handle them on generic
ADDs (even if it generates them during address-mode matching) -- and,
specifically, applying this transformation directly with TargetConstants caused
a self-hosting failure on PPC64. Ignoring all TargetConstants, however, is less
than ideal. Instead, for non-opaque constants, we can convert them into regular
constants for use with the generated ADD (or SUB).

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

10 years agoReplace -use-init-array with -use-ctors.
Rafael Espindola [Tue, 2 Sep 2014 13:54:53 +0000 (13:54 +0000)]
Replace -use-init-array with -use-ctors.

We have been using .init-array for most systems for quiet some time,
but tools like llc are still defaulting to .ctors because the old
option was never changed.

This patch makes llc default to .init-array and changes the option to
be -use-ctors.

Clang is not affected by this. It has its own fancier logic.

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

10 years agoSilencing an MSVC C4334 warning ('<<' : result of 32-bit shift implicitly converted...
Aaron Ballman [Tue, 2 Sep 2014 12:19:02 +0000 (12:19 +0000)]
Silencing an MSVC C4334 warning ('<<' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)). NFC.

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

10 years agoMerge Extend and Shift into a UBFX
David Xu [Tue, 2 Sep 2014 09:33:56 +0000 (09:33 +0000)]
Merge Extend and Shift into a UBFX

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

10 years agoRevert "Revert '[DAGCombiner] Split up an indexed load if only the base pointer value...
Hal Finkel [Tue, 2 Sep 2014 06:24:04 +0000 (06:24 +0000)]
Revert "Revert '[DAGCombiner] Split up an indexed load if only the base pointer value is live'"

I reverted r208640 in r209747 because r208640 broke self-hosting on PPC64. The
underlying cause of the failure is that pre-inc loads with increments
represented by ISD::TargetConstants were being transformed into ISD:::ADDs with
ISD::TargetConstant operands. PPC doesn't have a pattern for those, and so they
were selected as invalid r+r adds.

This recommits r208640, rebased and with an exclusion for ISD::TargetConstant
increments. This behavior seems correct, although in the future we might want
to ask the target to split out the indexing that uses ISD::TargetConstants.

Unfortunately, I don't yet have small test case where the relevant invalid
'add' instruction is not itself dead (and thus eliminated by
DeadMachineInstructionElim -- sometimes bugpoint is too good at removing things)

Original commit message (by Adam Nemet):

Right now the load may not get DCE'd because of the side-effect of updating
the base pointer.

This can happen if we lower a read-modify-write of an illegal larger type
(e.g. i48) such that the modification only affects one of the subparts (the
lower i32 part but not the higher i16 part).  See the testcase.

In order to spot the dead load we need to revisit it when SimplifyDemandedBits
decided that the value of the load is masked off.  This is the
CommitTargetLoweringOpt piece.

I checked compile time with ARM64 by sending SPEC bitcode files through llc.
No measurable change.

Fixes <rdar://problem/16031651>

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

10 years ago[PowerPC] Guard against illegal selection of add for TargetConstant operands
Hal Finkel [Tue, 2 Sep 2014 06:23:54 +0000 (06:23 +0000)]
[PowerPC] Guard against illegal selection of add for TargetConstant operands

r208640 was reverted because it caused a self-hosting failure on ppc64. The
underlying cause was the formation of ISD::ADD nodes with ISD::TargetConstant
operands. Because we have no patterns for 'add' taking 'timm' nodes, these are
selected as r+r add instructions (which is a miscompile). Guard against this
kind of behavior in the future by making the backend crash should this occur
(instead of silently generating invalid output).

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

10 years agoCodeGen: indicate Windows unwind data format
Saleem Abdulrasool [Mon, 1 Sep 2014 23:48:39 +0000 (23:48 +0000)]
CodeGen: indicate Windows unwind data format

The structures for Windows unwinding are shared across multiple platforms.
Indicate the encoding to be used for the particular target.  Use this to switch
the unwind emitter instantiated by the AsmPrinter.

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

10 years agoCodeGen: split out the Win64Exception emitter
Saleem Abdulrasool [Mon, 1 Sep 2014 23:48:34 +0000 (23:48 +0000)]
CodeGen: split out the Win64Exception emitter

Move the Windows unwind information emitter into a separate header.  This is not
related to DWARF based emission.  NFC.

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

10 years agoMC: remove unnecessary enumeration prefix
Saleem Abdulrasool [Mon, 1 Sep 2014 23:48:29 +0000 (23:48 +0000)]
MC: remove unnecessary enumeration prefix

This is an enum class, and will be appropriately prefixed, making the encoding
type prefix redundant.  No change to any uses as the use of this was not yet
introduced.

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

10 years agoSROA: Don't insert instructions before a PHI
David Majnemer [Mon, 1 Sep 2014 21:20:14 +0000 (21:20 +0000)]
SROA: Don't insert instructions before a PHI

SROA may decide that it needs to insert a bitcast and would set it's
insertion point before a PHI.  This will create an invalid module
right quick.

Instead, choose the first insertion point in the basic block that holds
our PHI.

This fixes PR20822.

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

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

10 years agoRevert "Revert two GEP-related InstCombine commits"
David Majnemer [Mon, 1 Sep 2014 21:10:02 +0000 (21:10 +0000)]
Revert "Revert two GEP-related InstCombine commits"

This reverts commit r216698 which reverted r216523 and r216598.

We would attempt to perform the transformation even if the match()
failed because, as a side effect, it would set V.  This would trick us
into believing that we correctly found a place to correctly apply the
transform.

An additional test case was added to getelementptr.ll so that we might
not regress in the future.

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

10 years agoUse an integer constant for FABS / FNEG (x86).
Sanjay Patel [Mon, 1 Sep 2014 19:01:47 +0000 (19:01 +0000)]
Use an integer constant for FABS / FNEG (x86).

This change will ease refactoring LowerFABS() and LowerFNEG()
since they have a lot of overlap.

Remove the creation of a floating point constant from an integer
because it's going to be used for a bitwise integer op anyway.

No change to codegen expected, but the verbose comment string
for asm output may change from float values to hex (integer),
depending on whether the constant already exists or not.

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

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

10 years agoAdd a convenience method to copy wrapping, exact, and fast-math flags (NFC).
Sanjay Patel [Mon, 1 Sep 2014 18:44:57 +0000 (18:44 +0000)]
Add a convenience method to copy wrapping, exact, and fast-math flags (NFC).

The loop vectorizer preserves wrapping, exact, and fast-math properties of scalar instructions.
This patch adds a convenience method to make that operation easier because we need to do this
in the loop vectorizer, SLP vectorizer, and possibly other places.

Although this is a 'no functional change' patch, I've added a testcase to verify that the exact
flag is preserved by the loop vectorizer. The wrapping and fast-math flags are already checked
in existing testcases.

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

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