oota-llvm.git
9 years ago[sanitizer] fix a test broken by r229940
Kostya Serebryany [Fri, 20 Feb 2015 02:12:25 +0000 (02:12 +0000)]
[sanitizer] fix a test broken by r229940

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

9 years ago[Orc][Kaleidoscope] Fix the orc/kaleidoscope tutorials on linux.
Lang Hames [Fri, 20 Feb 2015 02:03:30 +0000 (02:03 +0000)]
[Orc][Kaleidoscope] Fix the orc/kaleidoscope tutorials on linux.

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

9 years agoIR: Add getRaw() helper, NFC
Duncan P. N. Exon Smith [Fri, 20 Feb 2015 01:18:47 +0000 (01:18 +0000)]
IR: Add getRaw() helper, NFC

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

9 years agoAdd a pass for constructing gc.statepoint sequences w/explicit relocations
Philip Reames [Fri, 20 Feb 2015 01:06:44 +0000 (01:06 +0000)]
Add a pass for constructing gc.statepoint sequences w/explicit relocations

This patch consists of a single pass whose only purpose is to visit previous inserted gc.statepoints which do not have gc.relocates inserted yet, and insert them. This can be used either immediately after IR generation to perform 'early safepoint insertion' or late in the pass order to perform 'late insertion'.

This patch is setting the stage for work to continue in tree.  In particular, there are known naming and style violations in the current patch.  I'll try to get those resolved over the next week or so.  As I touch each area to make style changes, I need to make sure we have adequate testing in place.  As part of the cleanup, I will be cleaning up a collection of test cases we have out of tree and submitting them upstream. The tests included in this change are very basic and mostly to provide examples of usage.

The pass has several main subproblems it needs to address:
- First, it has identify any live pointers. In the current code, the use of address spaces to distinguish pointers to GC managed objects is hard coded, but this will become parametrizable in the near future.  Note that the current change doesn't actually contain a useful liveness analysis.  It was seperated into a followup change as the code wasn't ready to be shared.  Instead, the current implementation just considers any dominating def of appropriate pointer type to be live.
- Second, it has to identify base pointers for each live pointer. This is a fairly straight forward data flow algorithm.
- Third, the information in the previous steps is used to actually introduce rewrites. Rather than trying to do this by hand, we simply re-purpose the code behind Mem2Reg to do this for us.

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

9 years agoEH: Prune unreachable resume instructions during Dwarf EH preparation
Reid Kleckner [Fri, 20 Feb 2015 01:00:19 +0000 (01:00 +0000)]
EH: Prune unreachable resume instructions during Dwarf EH preparation

Today a simple function that only catches exceptions and doesn't run
destructor cleanups ends up containing a dead call to _Unwind_Resume
(PR20300). We can't remove these dead resume instructions during normal
optimization because inlining might introduce additional landingpads
that do have cleanups to run. Instead we can do this during EH
preparation, which is guaranteed to run after inlining.

Fixes PR20300.

Reviewers: majnemer

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

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

9 years agoRevert "AVX-512: Full implementation for VRNDSCALESS/SD instructions and intrinsics."
Eric Christopher [Fri, 20 Feb 2015 00:45:28 +0000 (00:45 +0000)]
Revert "AVX-512: Full implementation for VRNDSCALESS/SD instructions and intrinsics."

The instructions were being generated on architectures that don't support avx512.

This reverts commit r229837.

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

9 years agoAdd a license header to the AVX512 file.
Eric Christopher [Fri, 20 Feb 2015 00:36:53 +0000 (00:36 +0000)]
Add a license header to the AVX512 file.

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

9 years ago[sanitizer] when dumping the basic block trace, also dump the module names. Patch...
Kostya Serebryany [Fri, 20 Feb 2015 00:30:44 +0000 (00:30 +0000)]
[sanitizer] when dumping the basic block trace, also dump the module names. Patch by Laszlo Szekeres

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

9 years agoThis needs to be a const variable so the two sides of the ternary
Eric Christopher [Fri, 20 Feb 2015 00:03:45 +0000 (00:03 +0000)]
This needs to be a const variable so the two sides of the ternary
operator agree on type.

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

9 years ago[objc-arc-contract] We can not move retains over instructions which can not conservat...
Michael Gottesman [Fri, 20 Feb 2015 00:02:49 +0000 (00:02 +0000)]
[objc-arc-contract] We can not move retains over instructions which can not conservatively be proven to not decrement the retain's RCIdentity.

I also cleaned up the code to make it more understandable for mere mortals.

<rdar://problem/19853758>

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

9 years ago[objc-arc] Add the predicate CanDecrementRefCount.
Michael Gottesman [Fri, 20 Feb 2015 00:02:45 +0000 (00:02 +0000)]
[objc-arc] Add the predicate CanDecrementRefCount.

This is different from CanAlterRefCount since CanDecrementRefCount is
attempting to prove specifically whether or not an instruction can
decrement instead of the more general question of whether it can
decrement or increment.

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

9 years agoIR: Fix MDType fields from unsigned to uint64_t
Duncan P. N. Exon Smith [Thu, 19 Feb 2015 23:56:07 +0000 (23:56 +0000)]
IR: Fix MDType fields from unsigned to uint64_t

When trying to match the current schema with the new debug info
hierarchy, I downgraded `SizeInBits`, `AlignInBits` and `OffsetInBits`
to 32-bits (oops!).  Caught this while testing my upgrade script to move
the hierarchy into place.  Bump it back up to 64-bits and update tests.

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

9 years ago[ARM] Re-re-apply VLD1/VST1 base-update combine.
Ahmed Bougacha [Thu, 19 Feb 2015 23:52:41 +0000 (23:52 +0000)]
[ARM] Re-re-apply VLD1/VST1 base-update combine.

This re-applies r223862, r224198, r224203, and r224754, which were
reverted in r228129 because they exposed Clang misalignment problems
when self-hosting.

The combine caused the crashes because we turned ISD::LOAD/STORE nodes
to ARMISD::VLD1/VST1_UPD nodes.  When selecting addressing modes, we
were very lax for the former, and only emitted the alignment operand
(as in "[r1:128]") when it was larger than the standard alignment of
the memory type.

However, for ARMISD nodes, we just used the MMO alignment, no matter
what.  In our case, we turned ISD nodes to ARMISD nodes, and this
caused the alignment operands to start being emitted.

And that's how we exposed alignment problems that were ignored before
(but I believe would have been caught with SCTRL.A==1?).

To fix this, we can just mirror the hack done for ISD nodes:  only
take into account the MMO alignment when the access is overaligned.

Original commit message:
We used to only combine intrinsics, and turn them into VLD1_UPD/VST1_UPD
when the base pointer is incremented after the load/store.

We can do the same thing for generic load/stores.

Note that we can only combine the first load/store+adds pair in
a sequence (as might be generated for a v16f32 load for instance),
because other combines turn the base pointer addition chain (each
computing the address of the next load, from the address of the last
load) into independent additions (common base pointer + this load's
offset).

rdar://19717869, rdar://14062261.

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

9 years agoOnly use the initialized MCInstrInfo if it's been initialized already
Eric Christopher [Thu, 19 Feb 2015 23:52:35 +0000 (23:52 +0000)]
Only use the initialized MCInstrInfo if it's been initialized already
during SetupMachineFunction. This is also the single use of MII
and it'll be changing to TargetInstrInfo (which is MachineFunction
based) in the next commit here.

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

9 years agoDebugInfo: Match Name and DisplayName in testcase
Duncan P. N. Exon Smith [Thu, 19 Feb 2015 23:48:17 +0000 (23:48 +0000)]
DebugInfo: Match Name and DisplayName in testcase

There's no way for `DIBuilder` to create a subprogram or global variable
where `getName()` and `getDisplayName()` give different answers.  This
testcase managed to achieve the feat though.  This was probably just
left behind in some sort of upgrade along the way.

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

9 years ago[ARM] Minor cleanup to CombineBaseUpdate. NFC.
Ahmed Bougacha [Thu, 19 Feb 2015 23:30:37 +0000 (23:30 +0000)]
[ARM] Minor cleanup to CombineBaseUpdate. NFC.

In preparation for a future patch:
- rename isLoad to isLoadOp: the former is confusing, and can be taken
  to refer to the fact that the node is an ISD::LOAD.  (it isn't, yet.)
- change formatting here and there.
- add some comments.
- const-ify bools.

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

9 years agoMigrate away a use of the subtarget (and TargetMachine) from
Eric Christopher [Thu, 19 Feb 2015 23:29:42 +0000 (23:29 +0000)]
Migrate away a use of the subtarget (and TargetMachine) from
AsmPrinterDwarf since the information is on the MCRegisterInfo
via the MCContext and MMI that we already have on the AsmPrinter.

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

9 years agoIR: Add missing null operand to MDSubroutineType
Duncan P. N. Exon Smith [Thu, 19 Feb 2015 23:25:21 +0000 (23:25 +0000)]
IR: Add missing null operand to MDSubroutineType

Add missing `nullptr` from `MDSubroutineType`'s operands for
`MDCompositeTypeBase::getIdentifier()` (and add tests for all the other
unused fields).  This highlights just how crazy it is that
`MDSubroutineType` inherits from `MDCompositeTypeBase`.

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

9 years ago[CodeGen] Use ArrayRef instead of std::vector&. NFC.
Ahmed Bougacha [Thu, 19 Feb 2015 23:13:10 +0000 (23:13 +0000)]
[CodeGen] Use ArrayRef instead of std::vector&. NFC.

The former lets us use SmallVectors.  Do so in ARM and AArch64.

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

9 years agoMCTargetOptions reside on the TargetMachine that we always have via
Eric Christopher [Thu, 19 Feb 2015 21:29:51 +0000 (21:29 +0000)]
MCTargetOptions reside on the TargetMachine that we always have via
TargetOptions.

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

9 years agoRemove a call to TargetMachine::getSubtarget from the inline
Eric Christopher [Thu, 19 Feb 2015 21:24:23 +0000 (21:24 +0000)]
Remove a call to TargetMachine::getSubtarget from the inline
asm support in the asm printer. If we can get a subtarget from
the machine function then we should do so, otherwise we can
go ahead and create a default one since we're at the module
level.

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

9 years ago[Hexagon] Moving remaining methods off of HexagonMCInst in to HexagonMCInstrInfo...
Colin LeMahieu [Thu, 19 Feb 2015 21:10:50 +0000 (21:10 +0000)]
[Hexagon] Moving remaining methods off of HexagonMCInst in to HexagonMCInstrInfo and eliminating HexagonMCInst class.

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

9 years agoMC: Allow multiple comma-separated expressions on the .uleb128 directive.
Benjamin Kramer [Thu, 19 Feb 2015 20:24:04 +0000 (20:24 +0000)]
MC: Allow multiple comma-separated expressions on the .uleb128 directive.

For compatiblity with GNU as. Binutils documents this as
'.uleb128 expressions'. Subtle, isn't it?

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

9 years agoSSAUpdater: Use range-based for. NFC.
Benjamin Kramer [Thu, 19 Feb 2015 20:04:02 +0000 (20:04 +0000)]
SSAUpdater: Use range-based for. NFC.

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

9 years agoRemove unused argument from emitInlineAsmStart.
Eric Christopher [Thu, 19 Feb 2015 19:52:25 +0000 (19:52 +0000)]
Remove unused argument from emitInlineAsmStart.

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

9 years ago[objc-arc] Convert the bodies of ARCInstKind predicates into covered switches.
Michael Gottesman [Thu, 19 Feb 2015 19:51:36 +0000 (19:51 +0000)]
[objc-arc] Convert the bodies of ARCInstKind predicates into covered switches.

This is much better than the previous manner of just using
short-curcuiting booleans from:

1. A "naive" efficiency perspective: we do not have to rely on the
compiler to change the short circuiting boolean operations into a
switch.
2. An understanding perspective by making the implicit behavior of
negative predicates explicit.
3. A maintainability perspective through the covered switch flag making
it easy to know where to update code when adding new ARCInstKinds.

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

9 years ago[objc-arc] Change the InstructionClass to be an enum class called ARCInstKind.
Michael Gottesman [Thu, 19 Feb 2015 19:51:32 +0000 (19:51 +0000)]
[objc-arc] Change the InstructionClass to be an enum class called ARCInstKind.

I also renamed ObjCARCUtil.cpp -> ARCInstKind.cpp. That file only contained
items related to ARCInstKind anyways.

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

9 years agoChecking if TARGET_OS_IPHONE is defined isn't good enough for 10.7 and earlier.
Chris Bieneman [Thu, 19 Feb 2015 19:50:52 +0000 (19:50 +0000)]
Checking if TARGET_OS_IPHONE is defined isn't good enough for 10.7 and earlier.

Older versions of the TargetConditionals header always defined TARGET_OS_IPHONE to something (0 or 1), so we need to test not only for the existence but also if it is 1.

This resolves PR22631.

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

9 years ago[Hexagon] Moving more functions off of HexagonMCInst and in to HexagonMCInstrInfo.
Colin LeMahieu [Thu, 19 Feb 2015 19:49:27 +0000 (19:49 +0000)]
[Hexagon] Moving more functions off of HexagonMCInst and in to HexagonMCInstrInfo.

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

9 years ago[LoopAccesses] Change LAA:getInfo to return a constant reference
Adam Nemet [Thu, 19 Feb 2015 19:15:21 +0000 (19:15 +0000)]
[LoopAccesses] Change LAA:getInfo to return a constant reference

As expected, this required a few more const-correctness fixes.

Based on Hal's feedback on D7684.

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

9 years ago[LoopAccesses] Add -analyze support
Adam Nemet [Thu, 19 Feb 2015 19:15:19 +0000 (19:15 +0000)]
[LoopAccesses] Add -analyze support

The LoopInfo in combination with depth_first is used to enumerate the
loops.

Right now -analyze is not yet complete.  It only prints the result of
the analysis, the report and the run-time checks.  Printing the unsafe
depedences will require a bit more reshuffling which I'd like to do in a
follow-on to this patchset.  Unsafe dependences are currently checked
via -debug-only=loop-accesses in the new test.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

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

9 years ago[LoopAccesses] Split out LoopAccessReport from VectorizerReport
Adam Nemet [Thu, 19 Feb 2015 19:15:15 +0000 (19:15 +0000)]
[LoopAccesses] Split out LoopAccessReport from VectorizerReport

The only difference between these two is that VectorizerReport adds a
vectorizer-specific prefix to its messages.  When LAA is used in the
vectorizer context the prefix is added when we promote the
LoopAccessReport into a VectorizerReport via one of the constructors.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

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

9 years ago[LoopAccesses] Add missing const to APIs in VectorizationReport
Adam Nemet [Thu, 19 Feb 2015 19:15:13 +0000 (19:15 +0000)]
[LoopAccesses] Add missing const to APIs in VectorizationReport

When I split out LoopAccessReport from this, I need to create some temps
so constness becomes necessary.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

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

9 years ago[LoopAccesses] Add canAnalyzeLoop
Adam Nemet [Thu, 19 Feb 2015 19:15:10 +0000 (19:15 +0000)]
[LoopAccesses] Add canAnalyzeLoop

This allows the analysis to be attempted with any loop.  This feature
will be used with -analysis.  (LV only requests the analysis on loops
that have already satisfied these tests.)

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

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

9 years ago[LoopAccesses] Change debug messages from LV to LAA
Adam Nemet [Thu, 19 Feb 2015 19:15:07 +0000 (19:15 +0000)]
[LoopAccesses] Change debug messages from LV to LAA

Also add pass name as an argument to VectorizationReport::emitAnalysis.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

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

9 years ago[LoopAccesses] Create the analysis pass
Adam Nemet [Thu, 19 Feb 2015 19:15:04 +0000 (19:15 +0000)]
[LoopAccesses] Create the analysis pass

This is a function pass that runs the analysis on demand.  The analysis
can be initiated by querying the loop access info via LAA::getInfo.  It
either returns the cached info or runs the analysis.

Symbolic stride information continues to reside outside of this analysis
pass. We may move it inside later but it's not a priority for me right
now.  The idea is that Loop Distribution won't support run-time stride
checking at least initially.

This means that when querying the analysis, symbolic stride information
can be provided optionally.  Whether stride information is used can
invalidate the cache entry and rerun the analysis.  Note that if the
loop does not have any symbolic stride, the entry should be preserved
across Loop Distribution and LV.

Since currently the only user of the pass is LV, I just check that the
symbolic stride information didn't change when using a cached result.

On the LV side, LoopVectorizationLegality requests the info object
corresponding to the loop from the analysis pass.  A large chunk of the
diff is due to LAI becoming a pointer from a reference.

A test will be added as part of the -analyze patch.

Also tested that with AVX, we generate identical assembly output for the
testsuite (including the external testsuite) before and after.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

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

9 years ago[LoopAccesses] Cache the result of canVectorizeMemory
Adam Nemet [Thu, 19 Feb 2015 19:15:00 +0000 (19:15 +0000)]
[LoopAccesses] Cache the result of canVectorizeMemory

LAA will be an on-demand analysis pass, so we need to cache the result
of the analysis.  canVectorizeMemory is renamed to analyzeLoop which
computes the result.  canVectorizeMemory becomes the query function for
the cached result.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

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

9 years ago[LoopAccesses] Stash the report from the analysis rather than emitting it
Adam Nemet [Thu, 19 Feb 2015 19:14:56 +0000 (19:14 +0000)]
[LoopAccesses] Stash the report from the analysis rather than emitting it

The transformation passes will query this and then emit them as part of
their own report.  The currently only user LV is modified to do just
that.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

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

9 years ago[LoopAccesses] Make VectorizerParams global + fix for cyclic dep
Adam Nemet [Thu, 19 Feb 2015 19:14:52 +0000 (19:14 +0000)]
[LoopAccesses] Make VectorizerParams global + fix for cyclic dep

As LAA is becoming a pass, we can no longer pass the params to its
constructor.  This changes the command line flags to have external
storage.  These can now be accessed both from LV and LAA.

VectorizerParams is moved out of LoopAccessInfo in order to shorten the
code to access it.

This commits also has the fix (D7731) to the break dependence cycle
between the analysis and vector libraries.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

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

9 years agoRevert "Reformat."
Adam Nemet [Thu, 19 Feb 2015 19:14:34 +0000 (19:14 +0000)]
Revert "Reformat."

This reverts commit r229651.

I'd like to ultimately revert r229650 but this reformat stands in the
way.  I'll reformat the affected files once the the loop-access pass is
fully committed.

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

9 years ago[orcjit] Include CMake support for the fully_lazy example and fix the build
David Blaikie [Thu, 19 Feb 2015 19:06:04 +0000 (19:06 +0000)]
[orcjit] Include CMake support for the fully_lazy example and fix the build

Not sure if/how to make the CMake build use C++14 for the examples, so
let's stick to C++11 for now.

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

9 years ago[Hexagon] Creating HexagonMCInstrInfo namespace as landing zone for static functions...
Colin LeMahieu [Thu, 19 Feb 2015 19:00:00 +0000 (19:00 +0000)]
[Hexagon] Creating HexagonMCInstrInfo namespace as landing zone for static functions detached from HexagonMCInst.

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

9 years agoFix grammar in documentation.
Eric Christopher [Thu, 19 Feb 2015 18:46:25 +0000 (18:46 +0000)]
Fix grammar in documentation.

Patch by Ralph Campbell!

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

9 years agoUpdate and remove a few calls to TargetMachine::getSubtargetImpl
Eric Christopher [Thu, 19 Feb 2015 18:46:23 +0000 (18:46 +0000)]
Update and remove a few calls to TargetMachine::getSubtargetImpl
out of the asm printer.

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

9 years ago[fuzzer] split main() into FuzzerDriver() that takes a callback as a parameter and...
Kostya Serebryany [Thu, 19 Feb 2015 18:45:37 +0000 (18:45 +0000)]
[fuzzer] split main() into FuzzerDriver() that takes a callback as a parameter and a tiny main() in a separate file

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

9 years agoAssume the original file is created before release in LockFileManager
Ben Langmuir [Thu, 19 Feb 2015 18:22:35 +0000 (18:22 +0000)]
Assume the original file is created before release in LockFileManager

This is true in clang, and let's us remove the problematic code that
waits around for the original file and then times out if it doesn't get
created in short order.  This caused any 'dead' lock file or legitimate
time out to cause a cascade of timeouts in any processes waiting on the
same lock (even if they only just showed up).

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

9 years ago[fuzzer] properly annotate fallthrough, add one more entry to FAQ
Kostya Serebryany [Thu, 19 Feb 2015 18:21:12 +0000 (18:21 +0000)]
[fuzzer] properly annotate fallthrough, add one more entry to FAQ

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

9 years ago[Hexagon] Removing static variable holding MCInstrInfo.
Colin LeMahieu [Thu, 19 Feb 2015 17:38:39 +0000 (17:38 +0000)]
[Hexagon] Removing static variable holding MCInstrInfo.

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

9 years agoLSR: Move set instead of copying. NFC.
Benjamin Kramer [Thu, 19 Feb 2015 17:19:43 +0000 (17:19 +0000)]
LSR: Move set instead of copying. NFC.

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

9 years agoadd X86 load folding tests for unary math ops
Sanjay Patel [Thu, 19 Feb 2015 16:59:11 +0000 (16:59 +0000)]
add X86 load folding tests for unary math ops

X86 load folding is fragile; eg, the tests here
don't work without AVX even though they should. This
is because we have a mix of tablegen patterns that have
been added over time, and we have a load folding table
used by the peephole optimizer that has to be kept in
sync with the ever-changing ISA and tablegen defs.

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

9 years agoAvoid conversion to float when creating ConstantDataArray/ConstantDataVector.
Rafael Espindola [Thu, 19 Feb 2015 16:08:20 +0000 (16:08 +0000)]
Avoid conversion to float when creating ConstantDataArray/ConstantDataVector.

Patch by Raoux, Thomas F!

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

9 years agoDemote vectors to arrays. No functionality change.
Benjamin Kramer [Thu, 19 Feb 2015 15:26:17 +0000 (15:26 +0000)]
Demote vectors to arrays. No functionality change.

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

9 years ago[x86] Delete still more piles of complex code now that we have a good
Chandler Carruth [Thu, 19 Feb 2015 15:21:57 +0000 (15:21 +0000)]
[x86] Delete still more piles of complex code now that we have a good
systematic lowering of v8i16.

This required a slight strategy shift to prefer unpack lowerings in more
places. While this isn't a cut-and-dry win in every case, it is in the
overwhelming majority. There are only a few places where the old
lowering would probably be a touch faster, and then only by a small
margin.

In some cases, this is yet another significant improvement.

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

9 years ago[x86] Teach the unpack lowering how to lower with an initial unpack in
Chandler Carruth [Thu, 19 Feb 2015 15:06:13 +0000 (15:06 +0000)]
[x86] Teach the unpack lowering how to lower with an initial unpack in
addition to lowering to trees rooted in an unpack.

This saves shuffles and or registers in many various ways, lets us
handle another class of v4i32 shuffles pre SSE4.1 without domain
crosses, etc.

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

9 years ago[x86] Dramatically improve v8i16 shuffle lowering by not using its
Chandler Carruth [Thu, 19 Feb 2015 14:08:24 +0000 (14:08 +0000)]
[x86] Dramatically improve v8i16 shuffle lowering by not using its
terribly complex partial blend logic.

This code path was one of the more complex and bug prone when it first
went in and it hasn't faired much better. Ultimately, with the simpler
basis for unpack lowering and support bit-math blending, this is
completely obsolete. In the worst case without this we generate
different but equivalent instructions. However, in many cases we
generate much better code. This is especially true when blends or pshufb
is available.

This does expose one (minor) weakness of the unpack lowering that I'll
try to address.

In case you were wondering, this is actually a big part of what I've
been trying to pull off in the recent string of commits.

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

9 years ago[x86] Remove the final fallback in the v8i16 lowering that isn't really
Chandler Carruth [Thu, 19 Feb 2015 13:56:49 +0000 (13:56 +0000)]
[x86] Remove the final fallback in the v8i16 lowering that isn't really
needed, and significantly improve the SSSE3 path.

This makes the new strategy much more clear. If we can blend, we just go
with that. If we can't blend, we try to permute into an unpack so
that we handle cases where the unpack doing the blend also simplifies
the shuffle. If that fails and we've got SSSE3, we now call into
factored-out pshufb lowering code so that we leverage the fact that
pshufb can set up a blend for us while shuffling. This generates great
code, especially because we *know* we don't have a fast blend at this
point. Finally, we fall back on decomposing into permutes and blends
because we do at least have a bit-math-based blend if we need to use
that.

This pretty significantly improves some of the v8i16 code paths. We
never need to form pshufb for the single-input shuffles because we have
effective target-specific combines to form it there, but we were missing
its effectiveness in the blends.

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

9 years ago[x86] Simplify the pre-SSSE3 v16i8 lowering significantly by decomposing
Chandler Carruth [Thu, 19 Feb 2015 13:15:12 +0000 (13:15 +0000)]
[x86] Simplify the pre-SSSE3 v16i8 lowering significantly by decomposing
them into permutes and a blend with the generic decomposition logic.

This works really well in almost every case and lets the code only
manage the expansion of a single input into two v8i16 vectors to perform
the actual shuffle. The blend-based merging is often much nicer than the
pack based merging that this replaces. The only place where it isn't we
end up blending between two packs when we could do a single pack. To
handle that case, just teach the v2i64 lowering to handle these blends
by digging out the operands.

With this we're down to only really random permutations that cause an
explosion of instructions.

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

9 years ago[x86] Remove the insanely over-aggressive unpack lowering strategy for
Chandler Carruth [Thu, 19 Feb 2015 12:10:37 +0000 (12:10 +0000)]
[x86] Remove the insanely over-aggressive unpack lowering strategy for
v16i8 shuffles, and replace it with new facilities.

This uses precise patterns to match exact unpacks, and the new
generalized unpack lowering only when we detect a case where we will
have to shuffle both inputs anyways and they terminate in exactly
a blend.

This fixes all of the blend horrors that I uncovered by always lowering
blends through the vector shuffle lowering. It also removes *sooooo*
much of the crazy instruction sequences required for v16i8 lowering
previously. Much cleaner now.

The only "meh" aspect is that we sometimes use pshufb+pshufb+unpck when
it would be marginally nicer to use pshufb+pshufb+por. However, the
difference there is *tiny*. In many cases its a win because we re-use
the pshufb mask. In others, we get to avoid the pshufb entirely. I've
left a FIXME, but I'm dubious we can really do better than this. I'm
actually pretty happy with this lowering now.

For SSE2 this exposes some horrors that were really already there. Those
will have to fixed by changing a different path through the v16i8
lowering.

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

9 years ago[mips][microMIPS] Make usage of AND16, OR16 and XOR16 by code generator
Jozef Kolek [Thu, 19 Feb 2015 11:51:32 +0000 (11:51 +0000)]
[mips][microMIPS] Make usage of AND16, OR16 and XOR16 by code generator

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

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

9 years ago[x86] The SELECT x86 DAG combine also does legalization. It used to rely
Chandler Carruth [Thu, 19 Feb 2015 11:43:37 +0000 (11:43 +0000)]
[x86] The SELECT x86 DAG combine also does legalization. It used to rely
on things not being marked as either custom or legal, but we now do
custom lowering of more VSELECT nodes. To cope with this, manually
replicate the legality tests here. These have to stay in sync with the
set of tests used in the custom lowering of VSELECT.

Ideally, we wouldn't do any of this combine-based-legalization when we
have an actual custom legalization step for VSELECT, but I'm not going
to be able to rewrite all of that today.

I don't have a test case for this currently, but it was found when
compiling a number of the test-suite benchmarks. I'll try to reduce
a test case and add it.

This should at least fix the test-suite fallout on build bots.

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

9 years agoAdd few simple tests to check statepoint placement for invoke instructions.
Igor Laevsky [Thu, 19 Feb 2015 11:39:04 +0000 (11:39 +0000)]
Add few simple tests to check statepoint placement for invoke instructions.
Differential Revision: http://reviews.llvm.org/D7535

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

9 years agoReverting r229831 due to multiple ARM/PPC/MIPS build-bot failures.
Michael Kuperstein [Thu, 19 Feb 2015 11:38:11 +0000 (11:38 +0000)]
Reverting r229831 due to multiple ARM/PPC/MIPS build-bot failures.

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

9 years agoImplement invoke statepoint verification.
Igor Laevsky [Thu, 19 Feb 2015 11:28:47 +0000 (11:28 +0000)]
Implement invoke statepoint verification.
Differential Revision: http://reviews.llvm.org/D7366

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

9 years agoAdd invoke related functionality into StatepointSite classes.
Igor Laevsky [Thu, 19 Feb 2015 11:02:11 +0000 (11:02 +0000)]
Add invoke related functionality into StatepointSite classes.
Differential Revision: http://reviews.llvm.org/D7364

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

9 years agoAVX-512: Full implementation for VRNDSCALESS/SD instructions and intrinsics.
Elena Demikhovsky [Thu, 19 Feb 2015 10:48:04 +0000 (10:48 +0000)]
AVX-512: Full implementation for VRNDSCALESS/SD instructions and intrinsics.

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

9 years ago[x86] Add support for bit-wise blending and use it in the v8 and v16
Chandler Carruth [Thu, 19 Feb 2015 10:46:52 +0000 (10:46 +0000)]
[x86] Add support for bit-wise blending and use it in the v8 and v16
lowering paths. I'm going to be leveraging this to simplify a lot of the
overly complex lowering of v8 and v16 shuffles in pre-SSSE3 modes.

Sadly, this isn't profitable on v4i32 and v2i64. There, the float and
double blending instructions for pre-SSE4.1 are actually pretty good,
and we can't beat them with bit math. And once SSE4.1 comes around we
have direct blending support and this ceases to be relevant.

Also, some of the test cases look odd because the domain fixer
canonicalizes these to floating point domain. That's OK, it'll use the
integer domain when it matters and some day I may be able to update
enough of LLVM to canonicalize the other way.

This restores almost all of the regressions from teaching x86's vselect
lowering to always use vector shuffle lowering for blends. The remaining
problems are because the v16 lowering path is still doing crazy things.
I'll be re-arranging that strategy in more detail in subsequent commits
to finish recovering the performance here.

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

9 years ago[x86,sdag] Two interrelated changes to the x86 and sdag code.
Chandler Carruth [Thu, 19 Feb 2015 10:36:19 +0000 (10:36 +0000)]
[x86,sdag] Two interrelated changes to the x86 and sdag code.

First, don't combine bit masking into vector shuffles (even ones the
target can handle) once operation legalization has taken place. Custom
legalization of vector shuffles may exist for these patterns (making the
predicate return true) but that custom legalization may in some cases
produce the exact bit math this matches. We only really want to handle
this prior to operation legalization.

However, the x86 backend, in a fit of awesome, relied on this. What it
would do is mark VSELECTs as expand, which would turn them into
arithmetic, which this would then match back into vector shuffles, which
we would then lower properly. Amazing.

Instead, the second change is to teach the x86 backend to directly form
vector shuffles from VSELECT nodes with constant conditions, and to mark
all of the vector types we support lowering blends as shuffles as custom
VSELECT lowering. We still mark the forms which actually support
variable blends as *legal* so that the custom lowering is bypassed, and
the legal lowering can even be used by the vector shuffle legalization
(yes, i know, this is confusing. but that's how the patterns are
written).

This makes the VSELECT lowering much more sensible, and in fact should
fix a bunch of bugs with it. However, as you'll see in the test cases,
right now what it does is point out the *hilarious* deficiency of the
new vector shuffle lowering when it comes to blends. Fortunately, my
very next patch fixes that. I can't submit it yet, because that patch,
somewhat obviously, forms the exact and/or pattern that the DAG combine
is matching here! Without this patch, teaching the vector shuffle
lowering to produce the right code infloops in the DAG combiner. With
this patch alone, we produce terrible code but at least lower through
the right paths. With both patches, all the regressions here should be
fixed, and a bunch of the improvements (like using 2 shufps with no
memory loads instead of 2 andps with memory loads and an orps) will
stay. Win!

There is one other change worth noting here. We had hilariously wrong
vectorization cost estimates for vselect because we fell through to the
code path that assumed all "expand" vector operations are scalarized.
However, the "expand" lowering of VSELECT is vector bit math, most
definitely not scalarized. So now we go back to the correct if horribly
naive cost of "1" for "not scalarized". If anyone wants to add actual
modeling of shuffle costs, that would be cool, but this seems an
improvement on its own. Note the removal of 16 and 32 "costs" for doing
a blend. Even in SSE2 we can blend in fewer than 16 instructions. ;] Of
course, we don't right now because of OMG bad code, but I'm going to fix
that. Next patch. I promise.

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

9 years agoUse std::bitset for SubtargetFeatures
Michael Kuperstein [Thu, 19 Feb 2015 09:01:04 +0000 (09:01 +0000)]
Use std::bitset for SubtargetFeatures

Previously, subtarget features were a bitfield with the underlying type being uint64_t.
Since several targets (X86 and ARM, in particular) have hit or were very close to hitting this bound, switching the features to use a bitset.

No functional change.

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

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

9 years ago[Support/Timer] Make GetMallocUsage() aware of jemalloc.
Davide Italiano [Thu, 19 Feb 2015 07:27:14 +0000 (07:27 +0000)]
[Support/Timer] Make GetMallocUsage() aware of jemalloc.

Differential Revision: D7657
Reviewed by: shankarke, majnemer

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

9 years ago[Orc][Kaleidoscope] Fix typo in tutorial comment.
Lang Hames [Thu, 19 Feb 2015 05:33:30 +0000 (05:33 +0000)]
[Orc][Kaleidoscope] Fix typo in tutorial comment.

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

9 years agoProvide the same ABI regardless of NDEBUG
Dmitri Gribenko [Thu, 19 Feb 2015 05:30:16 +0000 (05:30 +0000)]
Provide the same ABI regardless of NDEBUG

For projects depending on LLVM, I find it very useful to combine a
release-no-asserts build of LLVM with a debug+asserts build of the dependent
project.  The motivation is that when developing a dependent project, you are
debugging that project itself, not LLVM.  In my usecase, a significant part of
the runtime is spent in LLVM optimization passes, so I would like to build LLVM
without assertions to get the best performance from this combination.

Currently, `lib/Support/Debug.cpp` changes the set of symbols it provides
depending on NDEBUG, while `include/llvm/Support/Debug.h` requires extra
symbols when NDEBUG is not defined.  Thus, it is not possible to enable
assertions in an external project that uses facilities of `Debug.h`.

This patch changes `Debug.cpp` and `Valgrind.cpp` to always define the symbols
that other code may depend on when #including LLVM headers without NDEBUG.

http://reviews.llvm.org/D7662

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

9 years ago[Orc][Kaleidoscope] Make the 'fully lazy' orc kaleidoscope tutorial lazier still.
Lang Hames [Thu, 19 Feb 2015 01:32:43 +0000 (01:32 +0000)]
[Orc][Kaleidoscope] Make the 'fully lazy' orc kaleidoscope tutorial lazier still.

The new JIT doesn't IRGen stubs until they're referenced.

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

9 years ago[Orc] Fix a bug in the compile callback manager: trampoline ids need to be fixed
Lang Hames [Thu, 19 Feb 2015 01:31:25 +0000 (01:31 +0000)]
[Orc] Fix a bug in the compile callback manager: trampoline ids need to be fixed
up before returning them to the available pool.

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

9 years agoRemove the local subtarget variable from the SystemZ asm printer
Eric Christopher [Thu, 19 Feb 2015 01:26:28 +0000 (01:26 +0000)]
Remove the local subtarget variable from the SystemZ asm printer
and update the two calls accordingly.

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

9 years agoRemove a few more calls to TargetMachine::getSubtarget from the
Eric Christopher [Thu, 19 Feb 2015 01:10:55 +0000 (01:10 +0000)]
Remove a few more calls to TargetMachine::getSubtarget from the
R600 port.

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

9 years agoGrab the subtarget off of the machine function for the R600
Eric Christopher [Thu, 19 Feb 2015 01:10:53 +0000 (01:10 +0000)]
Grab the subtarget off of the machine function for the R600
asm printer and clean up a bunch of uses.

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

9 years agoRemove the DisasmEnabled AsmPrinter variable and just look it
Eric Christopher [Thu, 19 Feb 2015 01:10:49 +0000 (01:10 +0000)]
Remove the DisasmEnabled AsmPrinter variable and just look it
up on the subtarget where it's set anyhow than looking it up
2-3 times in the same place.

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

9 years agoMC: Remove NullStreamer hook, as it is redundant with NullTargetStreamer.
Peter Collingbourne [Thu, 19 Feb 2015 00:45:07 +0000 (00:45 +0000)]
MC: Remove NullStreamer hook, as it is redundant with NullTargetStreamer.

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

9 years agollvm-mc: Use Target::createNullStreamer to fix crashes on target-specific asm directives.
Peter Collingbourne [Thu, 19 Feb 2015 00:45:04 +0000 (00:45 +0000)]
llvm-mc: Use Target::createNullStreamer to fix crashes on target-specific asm directives.

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

9 years agoIntroduce Target::createNullTargetStreamer and use it from IRObjectFile.
Peter Collingbourne [Thu, 19 Feb 2015 00:45:02 +0000 (00:45 +0000)]
Introduce Target::createNullTargetStreamer and use it from IRObjectFile.

A null MCTargetStreamer allows IRObjectFile to ignore target-specific
directives. Previously we were crashing.

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

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

9 years ago[objc-arc] Introduce the concept of RCIdentity and rename all relevant functions...
Michael Gottesman [Thu, 19 Feb 2015 00:42:38 +0000 (00:42 +0000)]
[objc-arc] Introduce the concept of RCIdentity and rename all relevant functions to use that name. NFC.

The RCIdentity root ("Reference Count Identity Root") of a value V is a
dominating value U for which retaining or releasing U is equivalent to
retaining or releasing V. In other words, ARC operations on V are
equivalent to ARC operations on U.

This is a useful property to ascertain since we can use this in the ARC
optimizer to make it easier to match up ARC operations by always mapping
ARC operations to RCIdentityRoots instead of pointers themselves. Then
we perform pairing of retains, releases which are applied to the same
RCIdentityRoot.

In general, the two ways that we see RCIdentical values in ObjC are via:

  1. PointerCasts
  2. Forwarding Calls that return their argument verbatim.

As such in ObjC, two RCIdentical pointers must always point to the same
memory location.

Previously this concept was implicit in the code and various methods
that dealt with this concept were given functional names that did not
conform to any name in the "ARC" model. This often times resulted in
code that was hard for the non-ARC acquanted to understand resulting in
unhappiness and confusion.

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

9 years ago[objc-arc-contract] Rename contractRelease => tryToContractReleaseIntoStoreStrong.
Michael Gottesman [Thu, 19 Feb 2015 00:42:34 +0000 (00:42 +0000)]
[objc-arc-contract] Rename contractRelease => tryToContractReleaseIntoStoreStrong.

NFC. Makes it clearer what this method is actually supposed to do.

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

9 years ago[objc-arc-contract] Refactor out tryToPeepholeInstruction into its own method. NFC.
Michael Gottesman [Thu, 19 Feb 2015 00:42:30 +0000 (00:42 +0000)]
[objc-arc-contract] Refactor out tryToPeepholeInstruction into its own method. NFC.

The main method of ObjCARCContract is really large and busy. By refactoring this
out, it becomes easier to reason about.

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

9 years ago[objc-arc-contract] Reorganize the code a bit and make the debug output easier to...
Michael Gottesman [Thu, 19 Feb 2015 00:42:27 +0000 (00:42 +0000)]
[objc-arc-contract] Reorganize the code a bit and make the debug output easier to read.

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

9 years agoIR: Drop scope from MDTemplateParameter
Duncan P. N. Exon Smith [Thu, 19 Feb 2015 00:37:21 +0000 (00:37 +0000)]
IR: Drop scope from MDTemplateParameter

Follow-up to r229740, which removed `DITemplate*::getContext()` after my
upgrade script revealed that scopes are always `nullptr` for template
parameters.  This is the other shoe: drop `scope:` from
`MDTemplateParameter` and its two subclasses.  (Note: a bitcode upgrade
would be pointless, since the hierarchy hasn't been moved into place.)

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

9 years agoAvoid using a self-referential initializer and fix up uses.
Eric Christopher [Thu, 19 Feb 2015 00:22:47 +0000 (00:22 +0000)]
Avoid using a self-referential initializer and fix up uses.

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

9 years ago80-column fixups.
Eric Christopher [Thu, 19 Feb 2015 00:15:33 +0000 (00:15 +0000)]
80-column fixups.

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

9 years agoRemove all use of is64bit off of NVPTXSubtarget and clean up code
Eric Christopher [Thu, 19 Feb 2015 00:08:27 +0000 (00:08 +0000)]
Remove all use of is64bit off of NVPTXSubtarget and clean up code
accordingly. This changes the constructors of a number of classes
that don't need to know the subtarget's 64-bitness.

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

9 years agoRemove all use of getDrvInterface off of NVPTXSubtarget and clean
Eric Christopher [Thu, 19 Feb 2015 00:08:23 +0000 (00:08 +0000)]
Remove all use of getDrvInterface off of NVPTXSubtarget and clean
up code accordingly. Delete code that was checking for all cases
of an enum.

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

9 years agoMigrate the NVPTX backend asm printer to a per function subtarget.
Eric Christopher [Thu, 19 Feb 2015 00:08:14 +0000 (00:08 +0000)]
Migrate the NVPTX backend asm printer to a per function subtarget.

This involved moving two non-subtarget dependent features (64-bitness
and the driver interface) to the NVPTX target machine and updating
the uses (or migrating around the subtarget use for ease of review).
Otherwise use the cached subtarget or create a default subtarget
based on the TargetMachine cpu and feature string for the module
level assembler emission.

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

9 years ago[x86] Merge checks for a recently added test case that is the same on
Chandler Carruth [Wed, 18 Feb 2015 23:20:49 +0000 (23:20 +0000)]
[x86] Merge checks for a recently added test case that is the same on
all SSE variants and AVX variants.

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

9 years agoIR: Allow MDSubrange to have 'count: -1'
Duncan P. N. Exon Smith [Wed, 18 Feb 2015 23:17:51 +0000 (23:17 +0000)]
IR: Allow MDSubrange to have 'count: -1'

It turns out that `count: -1` is a special value indicating an empty
array, such as `Values` in:

    struct T {
      unsigned Count;
      int Values[];
    };

Handle it.

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

9 years agoAdd an IR-to-IR test for dwarf EH preparation using opt
Reid Kleckner [Wed, 18 Feb 2015 23:17:41 +0000 (23:17 +0000)]
Add an IR-to-IR test for dwarf EH preparation using opt

This tests the simple resume instruction elimination logic that we have
before making some changes to it.

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

9 years ago[Orc][Kaleidoscope] Fix a fixme - no reason we can't use C++14 in the tutorials.
Lang Hames [Wed, 18 Feb 2015 23:16:09 +0000 (23:16 +0000)]
[Orc][Kaleidoscope] Fix a fixme - no reason we can't use C++14 in the tutorials.

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

9 years ago[Orc][Kaleidoscope] Make the Orc/Kaleidoscope tutorials easier to build on
Lang Hames [Wed, 18 Feb 2015 23:08:56 +0000 (23:08 +0000)]
[Orc][Kaleidoscope] Make the Orc/Kaleidoscope tutorials easier to build on
Darwin.

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

9 years ago[Orc][Kaleidoscope] Make sure to look for the mangled name when updating the
Lang Hames [Wed, 18 Feb 2015 23:07:13 +0000 (23:07 +0000)]
[Orc][Kaleidoscope] Make sure to look for the mangled name when updating the
function body pointer in the fully lazy orc/kaleidoscope tutorial.

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

9 years ago[Objdump] Fixing crash when printing symbols in ELF sections with special types.
Colin LeMahieu [Wed, 18 Feb 2015 23:00:22 +0000 (23:00 +0000)]
[Objdump] Fixing crash when printing symbols in ELF sections with special types.

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

9 years agoStyle and formatting fixes for r229715
Andrew Kaylor [Wed, 18 Feb 2015 22:52:18 +0000 (22:52 +0000)]
Style and formatting fixes for r229715

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

9 years agoCMake: Fix add_lit_target for the case where a test suite has zero target dependencies.
Peter Collingbourne [Wed, 18 Feb 2015 22:25:35 +0000 (22:25 +0000)]
CMake: Fix add_lit_target for the case where a test suite has zero target dependencies.

This can happen with a standalone project containing a test suite with no
internal dependencies.

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

9 years agoR600/SI: Fix READLANE and WRITELANE lane select for VI
Marek Olsak [Wed, 18 Feb 2015 22:12:45 +0000 (22:12 +0000)]
R600/SI: Fix READLANE and WRITELANE lane select for VI

VOP2 declares vsrc1, but VOP3 declares src1.
We can't use the same "ins" if the operands have different names in VOP2
and VOP3 encodings.

This fixes a hang in geometry shaders which spill M0 on VI.
(BTW it doesn't look like M0 needs spilling and the spilling seems
duplicated 3 times)

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