platform/upstream/llvm.git
9 years agoAssert in isl expression builder if id can not be found [NFC]
Tobias Grosser [Tue, 10 Mar 2015 22:35:43 +0000 (22:35 +0000)]
Assert in isl expression builder if id can not be found [NFC]

llvm-svn: 231865

9 years agoCopy data files to the remote runner.
Dan Albert [Tue, 10 Mar 2015 22:31:49 +0000 (22:31 +0000)]
Copy data files to the remote runner.

Summary:
The data files for any given test will be in the same directory as the
source with a file name that matches *.dat. To make these available to
tests running remotely (such as over adb or ssh), copy them into the
test's remote working directory.

Note that we will perform more copies than we actually need. The data
files in the directory may only be used by one of the tests, but will
be copied for all tests in the same directory.

This patch also moves the remote test binary into the working
directory (previously it was only invoked from the working directory
rather than existing in it).

Reviewers: EricWF, jroelofs

Reviewed By: jroelofs

Subscribers: cfe-commits

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

llvm-svn: 231864

9 years ago[analyzer] Make getCheckIfTracked() return either leak or regular checker.
Anton Yartsev [Tue, 10 Mar 2015 22:24:21 +0000 (22:24 +0000)]
[analyzer] Make getCheckIfTracked() return either leak or regular checker.

llvm-svn: 231863

9 years agoUpdate clang for llvm r231861.
Eric Christopher [Tue, 10 Mar 2015 22:03:27 +0000 (22:03 +0000)]
Update clang for llvm r231861.

llvm-svn: 231862

9 years agoRemove the use of the subtarget in MCCodeEmitter creation and
Eric Christopher [Tue, 10 Mar 2015 22:03:14 +0000 (22:03 +0000)]
Remove the use of the subtarget in MCCodeEmitter creation and
update all ports accordingly. Required a couple of small rewrites
in handling subtarget features during creation in PPC.

llvm-svn: 231861

9 years agoCreate symbols marking the start of a section earlier.
Rafael Espindola [Tue, 10 Mar 2015 22:00:25 +0000 (22:00 +0000)]
Create symbols marking the start of a section earlier.

This lets us pass the symbol to the constructor and avoid the mutable field.

This also opens the way for outputting the symbol only when needed, instead
of outputting them at the start of the file.

llvm-svn: 231859

9 years agoAdd =shlibs-added/=shlibs-removed notifications (MI)
Ilia K [Tue, 10 Mar 2015 21:59:55 +0000 (21:59 +0000)]
Add =shlibs-added/=shlibs-removed notifications (MI)

Summary:
This patch adds =shlibs-added/=shlibs-removed notifications in lldb-mi. In more detail:
# Add Target::ModulesDidLoad/ModulesDidUnload notifications
# Improve Target::TargetEventData:
## Refactoring
## Move it back to include/lldb/Target/Target.h
## Add Target::{GetModuleListFromEvent,GetModuleList}; Add Target::m_module_list
# Add SBModule::{GetSymbolVendorMainFileSpec,GetObjectFileHeaderAddress}
# Add SBTarget::{EventIsTaretEvent,GetTargetFromEvent,GetNumModulesFromEvent,GetModuleAtIndexFromEvent}

All tests pass on OS X.

Reviewers: abidh, zturner, jingham, clayborg

Reviewed By: clayborg

Subscribers: jingham, zturner, lldb-commits, clayborg, abidh

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

llvm-svn: 231858

9 years agoRemove createAMDGPUMCCodeEmitter and instead just register the correct
Eric Christopher [Tue, 10 Mar 2015 21:57:34 +0000 (21:57 +0000)]
Remove createAMDGPUMCCodeEmitter and instead just register the correct
MCCodeEmitter creation routine based on TargetMachine since the only
64-bit R600 gpus are part of the GCN target.

llvm-svn: 231856

9 years ago[CodeGenPrepare] Refine the cost model provided by the promotion helper.
Quentin Colombet [Tue, 10 Mar 2015 21:48:15 +0000 (21:48 +0000)]
[CodeGenPrepare] Refine the cost model provided by the promotion helper.
- Use TargetLowering to check for the actual cost of each extension.
- Provide a factorized method to check for the cost of an extension:
  TargetLowering::isExtFree.
- Provide a virtual method TargetLowering::isExtFreeImpl for targets to be able
  to tune the cost of non-free extensions.

This refactoring offers a better granularity to model what really happens on
different targets.

No performance changes and very few code differences.

Part of <rdar://problem/19267165>

llvm-svn: 231855

9 years ago[LoopAccesses] Add debug message to indicate the result of the analysis
Adam Nemet [Tue, 10 Mar 2015 21:47:39 +0000 (21:47 +0000)]
[LoopAccesses] Add debug message to indicate the result of the analysis

The debug message was pretty confusing here.  It only reported the
situation with memchecks without the result of the dependence analysis.

Now it prints whether the loop is safe from the POV of the dependence
analysis and if yes, whether we need memchecks.

llvm-svn: 231854

9 years agoMove a non-trivial virtual function out of line.
Rafael Espindola [Tue, 10 Mar 2015 21:35:16 +0000 (21:35 +0000)]
Move a non-trivial virtual function out of line.

llvm-svn: 231853

9 years agoRemove unneeded const_cast in readPointerHelper. Pointed out by jroelofs
Eric Fiselier [Tue, 10 Mar 2015 21:32:53 +0000 (21:32 +0000)]
Remove unneeded const_cast in readPointerHelper. Pointed out by jroelofs

llvm-svn: 231852

9 years ago[Objective-C Sema]. Remove -Wreceiver-is-weak warning.
Fariborz Jahanian [Tue, 10 Mar 2015 21:28:33 +0000 (21:28 +0000)]
[Objective-C Sema]. Remove -Wreceiver-is-weak warning.
It is incorrect and better warning is issued under
-Warc-repeated-use-of-weak. rdar://16316934.

llvm-svn: 231851

9 years ago[Hexagon] Adding frame index + add load/store patterns.
Colin LeMahieu [Tue, 10 Mar 2015 21:24:13 +0000 (21:24 +0000)]
[Hexagon] Adding frame index + add load/store patterns.

llvm-svn: 231850

9 years agoAdd SymbolVendor::GetMainFileSpec and simplify CommandObjectTargetModulesList::PrintM...
Ilia K [Tue, 10 Mar 2015 21:18:59 +0000 (21:18 +0000)]
Add SymbolVendor::GetMainFileSpec and simplify CommandObjectTargetModulesList::PrintModule

Summary:
Add SymbolVendor::GetMainFileSpec and simplify CommandObjectTargetModulesList::PrintModule.

All tests pass on OS X.

Reviewers: abidh, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, clayborg, abidh

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

llvm-svn: 231849

9 years agoclang-format code that is about to change.
Rafael Espindola [Tue, 10 Mar 2015 21:16:18 +0000 (21:16 +0000)]
clang-format code that is about to change.

llvm-svn: 231848

9 years ago[Hexagon] Simplifying deallocret definitions.
Colin LeMahieu [Tue, 10 Mar 2015 21:12:32 +0000 (21:12 +0000)]
[Hexagon] Simplifying deallocret definitions.

llvm-svn: 231847

9 years agoclang-format these declarations. NFC.
Rafael Espindola [Tue, 10 Mar 2015 21:05:09 +0000 (21:05 +0000)]
clang-format these declarations. NFC.

llvm-svn: 231846

9 years agoDon't repeat names in comments. NFC.
Rafael Espindola [Tue, 10 Mar 2015 21:01:50 +0000 (21:01 +0000)]
Don't repeat names in comments. NFC.

llvm-svn: 231845

9 years ago[Hexagon] Separating InstHexagon from OpcodeHexagon.
Colin LeMahieu [Tue, 10 Mar 2015 20:56:22 +0000 (20:56 +0000)]
[Hexagon] Separating InstHexagon from OpcodeHexagon.

llvm-svn: 231844

9 years agoAdd support for part-word atomics for PPC
Nemanja Ivanovic [Tue, 10 Mar 2015 20:51:07 +0000 (20:51 +0000)]
Add support for part-word atomics for PPC
http://reviews.llvm.org/D8090#inline-67337

llvm-svn: 231843

9 years agoAdd new LLVM_OPTIMIZED_TABLEGEN build setting which configures, builds and uses a...
Chris Bieneman [Tue, 10 Mar 2015 20:48:02 +0000 (20:48 +0000)]
Add new LLVM_OPTIMIZED_TABLEGEN build setting which configures, builds and uses a release tablegen build when LLVM is configured with assertions enabled.

Summary: This change leverages the cross-compiling functionality in the build system to build a release tablegen executable for use during the build.

Reviewers: resistor, rnk

Reviewed By: rnk

Subscribers: rnk, joker.eph, llvm-commits

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

llvm-svn: 231842

9 years agoUse generic feature name for sanitizers that replace new and delete
Eric Fiselier [Tue, 10 Mar 2015 20:46:04 +0000 (20:46 +0000)]
Use generic feature name for sanitizers that replace new and delete

llvm-svn: 231841

9 years ago[AArch64] Avoid going through GPRs for across-vector instructions.
Ahmed Bougacha [Tue, 10 Mar 2015 20:45:38 +0000 (20:45 +0000)]
[AArch64] Avoid going through GPRs for across-vector instructions.

This adds new node types for each intrinsic.
For instance, for addv, we have AArch64ISD::UADDV, such that:
  (v4i32 (uaddv ...))
is the same as
  (v4i32 (scalar_to_vector (i32 (int_aarch64_neon_uaddv ...))))
that is,
  (v4i32 (INSERT_SUBREG (v4i32 (IMPLICIT_DEF)),
           (i32 (int_aarch64_neon_uaddv ...)), ssub)

In a combine, we transform all such across-vector-lanes intrinsics to:

  (i32 (extract_vector_elt (uaddv ...), 0))

This has one big advantage: by making the extract_element explicit, we
enable the existing patterns for lane-aware instructions to fire.
This lets us avoid needlessly going through the GPRs.  Consider:

    uint32x4_t test_mul(uint32x4_t a, uint32x4_t b) {
        return vmulq_n_u32(a, vaddvq_u32(b));
    }

We now generate:
    addv.4s  s1, v1
    mul.4s   v0, v0, v1[0]
instead of the previous:
    addv.4s  s1, v1
    fmov     w8, s1
    dup.4s   v1, w8
    mul.4s   v0, v1, v0

rdar://20044838

llvm-svn: 231840

9 years ago[libcxx] Fix PR21580 - Undefined behavior in readEncodedPointer()
Eric Fiselier [Tue, 10 Mar 2015 20:43:34 +0000 (20:43 +0000)]
[libcxx] Fix PR21580 - Undefined behavior in readEncodedPointer()

Summary: This patch fixes a bug in `readEncodedPointer()` where it would read from memory that was not suitably aligned. This patch fixes it by using memcpy.

Reviewers: danalbert, echristo, compnerd, mclow.lists

Reviewed By: compnerd, mclow.lists

Subscribers: cfe-commits

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

llvm-svn: 231839

9 years ago[AArch64] Remove integer INSvi*lane patterns. NFCI.
Ahmed Bougacha [Tue, 10 Mar 2015 20:37:19 +0000 (20:37 +0000)]
[AArch64] Remove integer INSvi*lane patterns.  NFCI.

Most are redundant, and they never seem to fire.

The V128 integer patterns already exist in the INS multiclass.
The duplicates only fire when the vector index type isn't i64,
because they accept "imm" instead of an explicit "i64", as the
instruction definition patterns do.

TLI::getVectorIdxTy is i64 on AArch64, so this should never happen.
Also, one of them had a typo: for i64, INSvi32lane was used.
I noticed because I mistakenly used an explicit i32 as the idx type,
and got ins.s for an i64 vector_insert.

The V64 patterns also don't seem to ever fire, as V64 vector
extract/insert are legalized to V128.

The equivalent float patterns are unique and useful, so keep them.

No functional change intended;  none exhibited on the LIT and LNT tests.

llvm-svn: 231838

9 years agoDon't evaluate rend() on every iteration of the loop.
Chad Rosier [Tue, 10 Mar 2015 20:29:59 +0000 (20:29 +0000)]
Don't evaluate rend() on every iteration of the loop.

llvm-svn: 231837

9 years agoLoopAccessAnalysis: Silence -Wreturn-type diagnostic from GCC
David Majnemer [Tue, 10 Mar 2015 20:23:29 +0000 (20:23 +0000)]
LoopAccessAnalysis: Silence -Wreturn-type diagnostic from GCC

llvm-svn: 231836

9 years agoEnsure the functions in our GPURuntime are visible
Tobias Grosser [Tue, 10 Mar 2015 20:23:14 +0000 (20:23 +0000)]
Ensure the functions in our GPURuntime are visible

llvm-svn: 231835

9 years agoDon't use LLVM_LIBRARY_VISIBILITY in cpp files.
Benjamin Kramer [Tue, 10 Mar 2015 20:07:44 +0000 (20:07 +0000)]
Don't use LLVM_LIBRARY_VISIBILITY in cpp files.

llvm-svn: 231831

9 years ago[AsmPrinter][TLOF] Reintroduce AArch64 test
Bruno Cardoso Lopes [Tue, 10 Mar 2015 20:05:23 +0000 (20:05 +0000)]
[AsmPrinter][TLOF] Reintroduce AArch64 test

Follow up from r231505.

Fix the non-determinism by using a MapVector and reintroduce the AArch64
testcase. Defer deleting the got candidates up to the end and remove
them in a bulk, avoiding linear time removal of each element.

Thanks to Renato Golin for trying it out on other platforms.

llvm-svn: 231830

9 years ago[Hexagon] Adding nodes for PIC support.
Colin LeMahieu [Tue, 10 Mar 2015 20:04:44 +0000 (20:04 +0000)]
[Hexagon] Adding nodes for PIC support.

llvm-svn: 231829

9 years ago[Hexagon] Adding DuplexInst instruction format and duplex class defs.
Colin LeMahieu [Tue, 10 Mar 2015 19:53:14 +0000 (19:53 +0000)]
[Hexagon] Adding DuplexInst instruction format and duplex class defs.

llvm-svn: 231828

9 years agoChange the generation of the vmuluwm instruction to be based on the MUL opcode.
Kit Barton [Tue, 10 Mar 2015 19:49:38 +0000 (19:49 +0000)]
Change the generation of the vmuluwm instruction to be based on the MUL opcode.

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

llvm-svn: 231827

9 years agoremove function names from comments; NFC
Sanjay Patel [Tue, 10 Mar 2015 19:42:57 +0000 (19:42 +0000)]
remove function names from comments; NFC

llvm-svn: 231826

9 years ago[Hexagon] Adding nodes for vector insert/extract lowering.
Colin LeMahieu [Tue, 10 Mar 2015 19:40:03 +0000 (19:40 +0000)]
[Hexagon] Adding nodes for vector insert/extract lowering.

llvm-svn: 231825

9 years ago[Hexagon] Renaming HexagonJT to JT and adding CP for constantpool.
Colin LeMahieu [Tue, 10 Mar 2015 19:29:53 +0000 (19:29 +0000)]
[Hexagon] Renaming HexagonJT to JT and adding CP for constantpool.

llvm-svn: 231824

9 years agoChange the datatype of DwarfExpression::Emit(Un)Signed to (u)int64_t
Adrian Prantl [Tue, 10 Mar 2015 19:23:37 +0000 (19:23 +0000)]
Change the datatype of DwarfExpression::Emit(Un)Signed to (u)int64_t
so it matches the one used by ByteStreamer::Emit(U|S)LEB128.

llvm-svn: 231823

9 years agoNVPTX: move NVPTXAllocaHoisting into the cpp file
Benjamin Kramer [Tue, 10 Mar 2015 19:20:52 +0000 (19:20 +0000)]
NVPTX: move NVPTXAllocaHoisting into the cpp file

Also initialize without using static initialization.

llvm-svn: 231822

9 years ago[LAA-memchecks] Comment improvement
Adam Nemet [Tue, 10 Mar 2015 19:12:41 +0000 (19:12 +0000)]
[LAA-memchecks] Comment improvement

I forgot to roll this into r231816.  It was requested by Hal in D8122.

llvm-svn: 231821

9 years agoEnable loop-rotate before loop-vectorize by default
Michael Zolotukhin [Tue, 10 Mar 2015 19:07:41 +0000 (19:07 +0000)]
Enable loop-rotate before loop-vectorize by default

llvm-svn: 231820

9 years agoMS ABI: Mangle the location of the catchable type into it's name
David Majnemer [Tue, 10 Mar 2015 19:01:51 +0000 (19:01 +0000)]
MS ABI: Mangle the location of the catchable type into it's name

Because the catchable type has a reference to its name, mangle the
location to ensure that two catchable types with different locations are
distinct.

llvm-svn: 231819

9 years ago[LAA-memchecks 3/3] Introduce pointer partitions for memchecks
Adam Nemet [Tue, 10 Mar 2015 18:54:26 +0000 (18:54 +0000)]
[LAA-memchecks 3/3] Introduce pointer partitions for memchecks

This is the final patch that actually introduces the new parameter of
partition mapping to RuntimePointerCheck::needsChecking.

Another API (LAI::getInstructionsForAccess) is also exposed that helps
to map pointers to instructions because ultimately we partition
instructions.

The WIP version of the Loop Distribution pass in D6930 has been adapted
to use all this.  See for example, how
InstrPartitionContainer::computePartitionSetForPointers sets up the
partitions using the above API and then calls to LAI::addRuntimeCheck
with the pointer partitions.

llvm-svn: 231818

9 years ago[LAA-memchecks 2/3] Move number of memcheck threshold checking to LV
Adam Nemet [Tue, 10 Mar 2015 18:54:23 +0000 (18:54 +0000)]
[LAA-memchecks 2/3] Move number of memcheck threshold checking to LV

Now the analysis won't "fail" if the memchecks exceed the threshold.  It
is the transform pass' responsibility to perform the check.

This allows the transform pass to further analyze/eliminate the
memchecks.  E.g. in Loop distribution we only need to check pointers
that end up in different partitions.

Note that there is a slight change of functionality here.  The logic in
analyzeLoop is that if dependence checking fails due to non-constant
distance between the pointers, another attempt is made to prove safety
of the dependences purely using run-time checks.

Before this patch we could fail the loop due to exceeding the memcheck
threshold after the first step, now we only check the threshold in the
client after the full analysis.  There is no measurable compile-time
effect but I wanted to record this here.

llvm-svn: 231817

9 years ago[LAA-memchecks 1/3] Split out NumComparisons checks. NFC
Adam Nemet [Tue, 10 Mar 2015 18:54:19 +0000 (18:54 +0000)]
[LAA-memchecks 1/3] Split out NumComparisons checks. NFC

The check for the number of memchecks will be moved to the client of
this analysis.  Besides allowing for transform-specific thresholds, this
also lets Loop Distribution post-process the memchecks; Loop
Distribution only needs memchecks between pointers of different
partitions.

The motivation for this first patch is to untangle the CanDoRT check
from the NumComparison check before moving the NumComparison part.
CanDoRT means that we couldn't determine the bounds for the pointer.
Note that NumComparison is set independent of this flag.

llvm-svn: 231816

9 years agoFactor out RemoteExecutor from SSHExecutor.
Dan Albert [Tue, 10 Mar 2015 18:43:16 +0000 (18:43 +0000)]
Factor out RemoteExecutor from SSHExecutor.

Summary:
A lot of the pieces of SSHExecutor can be shared with my AdbExecutor
(https://android-review.googlesource.com/#/c/138807/).

Reviewers: EricWF, jroelofs

Reviewed By: jroelofs

Subscribers: cfe-commits

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

llvm-svn: 231815

9 years agoRecognize objc_bridge(id) on bridged casts to CF types.
John McCall [Tue, 10 Mar 2015 18:41:23 +0000 (18:41 +0000)]
Recognize objc_bridge(id) on bridged casts to CF types.

Fixes <rdar://20107345>.

llvm-svn: 231814

9 years agoremove names from comments; NFC
Sanjay Patel [Tue, 10 Mar 2015 18:41:22 +0000 (18:41 +0000)]
remove names from comments; NFC

llvm-svn: 231813

9 years agofix typos; NFC
Sanjay Patel [Tue, 10 Mar 2015 18:37:05 +0000 (18:37 +0000)]
fix typos; NFC

llvm-svn: 231812

9 years agoMake helper functions static. NFC.
Benjamin Kramer [Tue, 10 Mar 2015 18:24:01 +0000 (18:24 +0000)]
Make helper functions static. NFC.

llvm-svn: 231811

9 years agoNVPTX: Remove copy of LLVMInitializeNVPTXAsmPrinter.
Benjamin Kramer [Tue, 10 Mar 2015 18:19:24 +0000 (18:19 +0000)]
NVPTX: Remove copy of LLVMInitializeNVPTXAsmPrinter.

If anyone is using this for some strange reason,
LLVMInitializeNVPTXAsmPrinter does exactly the same thing and is what
other LLVM tools are calling.

llvm-svn: 231810

9 years agoHexagon: Remove unused InstrMapping.
Benjamin Kramer [Tue, 10 Mar 2015 18:19:16 +0000 (18:19 +0000)]
Hexagon: Remove unused InstrMapping.

llvm-svn: 231809

9 years agoAdd Debugger::InitializeForLLGS to allow ref counted LLGS initialization.
Robert Flack [Tue, 10 Mar 2015 18:07:47 +0000 (18:07 +0000)]
Add Debugger::InitializeForLLGS to allow ref counted LLGS initialization.

After http://reviews.llvm.org/D8133 landed as r231550 process launch on remote platform stopped working.

This adds Debugger::InitializeForLLGS and tracks whether one or both of Initialize and InitializeForLLGS have been called, calling only the corresponding lldb_private::Terminate* methods as necessary. Since lldb_private::Terminate calls lldb_private::TerminateForLLGS, the latter method may be called twice if Initialize was called for both however the terminate methods ensure they are only called once after being initialized.

This still maintains the reduced binary size, though it does now technically link in lldb_private::Terminate on lldb-server even though this should never be called.

This should resolve the issue raised in http://reviews.llvm.org/D8133 where Debugger::Terminate assumed that there were 0 references to debugger and terminated early.

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

llvm-svn: 231808

9 years ago[LoopAccesses 3/3] Print the dependences with -analyze
Adam Nemet [Tue, 10 Mar 2015 17:40:43 +0000 (17:40 +0000)]
[LoopAccesses 3/3] Print the dependences with -analyze

The dependences are now expose through the new getInterestingDependences
API so we can use that with -analyze too and fix the FIXME.

This lets us remove the test that relied on -debug to check the
dependences.

llvm-svn: 231807

9 years ago[LoopAccesses 2/3] Allow querying of interesting dependences
Adam Nemet [Tue, 10 Mar 2015 17:40:37 +0000 (17:40 +0000)]
[LoopAccesses 2/3] Allow querying of interesting dependences

Gather an array of interesting dependences rather than just failing
after the first unsafe one and regarding the loop unsafe.  Loop
Distribution needs to be able to collect all dependences in order to
isolate the dependence cycles into their own partition.

Since the dependence checking algorithm is quadratic in terms of
accesses sharing the same underlying pointer, I am applying a cut-off
threshold (MaxInterestingDependence).  Exceeding that, the logic reverts
back to the original approach deeming the loop unsafe upon encountering
the first unsafe dependence.

The main idea of the patch is to split isDepedent from directly
answering the question whether the dep is safe for vectorization to
return a dependence type which then gets mapped to old boolean result
using Dependence::isSafeForVectorization.

Tested that this was compile-time neutral on SpecINT2006 LTO bitcode
inputs.  No assembly change on the testsuite including external.

llvm-svn: 231806

9 years ago[LoopAccesses 1/3] Expose MemoryDepChecker to LAA users
Adam Nemet [Tue, 10 Mar 2015 17:40:34 +0000 (17:40 +0000)]
[LoopAccesses 1/3] Expose MemoryDepChecker to LAA users

LoopDistribution needs to query various results of the dependence
analysis.  This series will expose some more APIs and state of the
dependence checker.

This patch is a simple one to just expose the DepChecker instance.  The
set is compile-time neutral measured with LTO bitcode files of
SpecINT2006.  Also there is no assembly change on the testsuite.

llvm-svn: 231805

9 years agoFix a comment for ValueObject::GetValueDidChange after r231526
Ilia K [Tue, 10 Mar 2015 17:24:32 +0000 (17:24 +0000)]
Fix a comment for ValueObject::GetValueDidChange after r231526

Summary:
Fix a comment for ValueObject::GetValueDidChange after r231526.

This fix was requested by @jingham.

Reviewers: jingham, ki.stfu

Reviewed By: ki.stfu

Subscribers: lldb-commits, jingham

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

llvm-svn: 231804

9 years agoThe semantic spelling enumeration should retain values to the spelling list indexes...
Aaron Ballman [Tue, 10 Mar 2015 17:19:18 +0000 (17:19 +0000)]
The semantic spelling enumeration should retain values to the spelling list indexes used by the attribute. The only attribute affected by this in practice is the OpenCLImageAccessAttr, which has duplicate semantic spellings that are automatically stripped.

We do not implicitly create an OpenCLImageAccessAttr, so this change only affects out of tree users. There is no way to test this behavior specifically that I can see, since this only affects implicit creation of attributes.

Fixes PR22403.

llvm-svn: 231803

9 years agoStore an optional section start label in MCSection.
Rafael Espindola [Tue, 10 Mar 2015 16:58:10 +0000 (16:58 +0000)]
Store an optional section start label in MCSection.

This makes code that uses section relative expressions (debug info) simpler and
less brittle.

This is still a bit awkward as the symbol is created late and has to be
stored in a mutable field.

I will move the symbol creation earlier in the next patch.

llvm-svn: 231802

9 years agoremove function names from comments; NFC
Sanjay Patel [Tue, 10 Mar 2015 16:42:24 +0000 (16:42 +0000)]
remove function names from comments; NFC

llvm-svn: 231801

9 years agoTeach lowering to correctly handle invoke statepoint and gc results tied to them...
Igor Laevsky [Tue, 10 Mar 2015 16:26:48 +0000 (16:26 +0000)]
Teach lowering to correctly handle invoke statepoint and gc results tied to them. Note that we still can not lower gc.relocates for invoke statepoints.
Also it extracts getCopyFromRegs helper function in SelectionDAGBuilder as we need to be able to customize type of the register exported from basic block during lowering of the gc.result.
(Resubmitting this change after not being able to reproduce buildbot failure)

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

llvm-svn: 231800

9 years ago[BranchFolding] Remove MMOs during tail merge to preserve dependencies.
Chad Rosier [Tue, 10 Mar 2015 16:22:52 +0000 (16:22 +0000)]
[BranchFolding] Remove MMOs during tail merge to preserve dependencies.

When tail merging it may be necessary to remove MMOs from memory operations to
ensures later passes (e.g., MI sched) conservatively compute dependencies.
Currently, we only remove the MMO from the common tail if the MMO doesn't match
with the relative instruction in the non-common tail(s).

A more robust solution would be to add multiple MMOs from the duplicate MIs to
the new MI. Currently ScheduleDAGInstrs.cpp ignores all MMOs on instructions
with multiple MMOs, so this solution is equivalent for the time being.

No test case included as this is incredibly difficult to reproduce.

Patch was a collaborative effort between Ana Pazos and myself.
Phabricator: http://reviews.llvm.org/D7769

llvm-svn: 231799

9 years agoR600/SI: Add _IDXEN and _BOTHEN variants for buffer_store
Tom Stellard [Tue, 10 Mar 2015 16:16:51 +0000 (16:16 +0000)]
R600/SI: Add _IDXEN and _BOTHEN variants for buffer_store

llvm-svn: 231798

9 years agoR600/SI: Re-order MUBUF operands to match asm strings.
Tom Stellard [Tue, 10 Mar 2015 16:16:49 +0000 (16:16 +0000)]
R600/SI: Re-order MUBUF operands to match asm strings.

llvm-svn: 231797

9 years agoR600/SI: Move kill flag to second instruction when splitting SMRD
Tom Stellard [Tue, 10 Mar 2015 16:16:48 +0000 (16:16 +0000)]
R600/SI: Move kill flag to second instruction when splitting SMRD

This fixes a machine verifier error in the salu-to-valu.ll, which
would have been exposed by a future commit.

llvm-svn: 231796

9 years agoR600/SI: Add 32-bit encoding of v_cndmask_b32
Tom Stellard [Tue, 10 Mar 2015 16:16:44 +0000 (16:16 +0000)]
R600/SI: Add 32-bit encoding of v_cndmask_b32

This was done by refactoring the v_cndmask_b32 tablegen definition
to use inherit from VOP2Inst.

llvm-svn: 231795

9 years ago[X86, AVX] replace vinsertf128 intrinsics with generic shuffles
Sanjay Patel [Tue, 10 Mar 2015 16:08:36 +0000 (16:08 +0000)]
[X86, AVX] replace vinsertf128 intrinsics with generic shuffles

We want to replace as much custom x86 shuffling via intrinsics
as possible because pushing the code down the generic shuffle
optimization path allows for better codegen and less complexity
in LLVM.

This is the sibling patch for the Clang half of this change:
http://reviews.llvm.org/D8088

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

llvm-svn: 231794

9 years agoFix compilation after DataLayout was added to ScevExpander
Tobias Grosser [Tue, 10 Mar 2015 15:24:33 +0000 (15:24 +0000)]
Fix compilation after DataLayout was added to ScevExpander

The corresponding LLVM commit is 231740.

llvm-svn: 231793

9 years ago[X86, AVX] Replace vinsertf128 intrinsics with generic shuffles.
Sanjay Patel [Tue, 10 Mar 2015 15:19:26 +0000 (15:19 +0000)]
[X86, AVX] Replace vinsertf128 intrinsics with generic shuffles.

We want to replace as much custom x86 shuffling via intrinsics
as possible because pushing the code down the generic shuffle
optimization path allows for better codegen and less complexity
in LLVM.

This is the sibling patch for the LLVM half of this change:
http://reviews.llvm.org/D8086

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

llvm-svn: 231792

9 years agoHexagon: Remove pass that does nothing at all
Benjamin Kramer [Tue, 10 Mar 2015 15:06:38 +0000 (15:06 +0000)]
Hexagon: Remove pass that does nothing at all

llvm-svn: 231791

9 years agoRemove effectively dead code.
Rafael Espindola [Tue, 10 Mar 2015 14:48:01 +0000 (14:48 +0000)]
Remove effectively dead code.

Switching back and forth between sections does nothing (other than producing
larger .s files).

llvm-svn: 231790

9 years agoDocument __has_feature(modules) in LanguageExtensions
Ben Langmuir [Tue, 10 Mar 2015 14:39:26 +0000 (14:39 +0000)]
Document __has_feature(modules) in LanguageExtensions

Fixes PR18985

Patch by Vassil Vassilev!

llvm-svn: 231789

9 years agoFix a memory corruption in Dependency Analysis.
Karthik Bhat [Tue, 10 Mar 2015 14:32:02 +0000 (14:32 +0000)]
Fix a memory corruption in Dependency Analysis.
This crash occurs due to memory corruption when trying to update dependency
direction based on Constraints.

This crash was observed during lnt regression of Polybench benchmark test case dynprog.

Review: http://reviews.llvm.org/D8059
llvm-svn: 231788

9 years agoAllow -target= and --target options
Renato Golin [Tue, 10 Mar 2015 13:58:33 +0000 (13:58 +0000)]
Allow -target= and --target options

Using clang as a cross-compiler with the 'target' option could be confusing
for those inexperienced in the realm of cross compiling.

This patch would allow the use of all these four variants of the target option:
-target <triple>
--target <triple>
-target=<triple>
--target=<triple>

Patch by Gabor Ballabas.

llvm-svn: 231787

9 years agoDon't repeat names and clang-format this file.
Rafael Espindola [Tue, 10 Mar 2015 13:56:44 +0000 (13:56 +0000)]
Don't repeat names and clang-format this file.

llvm-svn: 231786

9 years agoRemoving dead code to silence warning C4060: switch statement contains no 'case'...
Aaron Ballman [Tue, 10 Mar 2015 13:56:28 +0000 (13:56 +0000)]
Removing dead code to silence warning C4060: switch statement contains no 'case' or 'default' labels; NFC.

llvm-svn: 231785

9 years agoFix a crash in Dependency Analysis.
Karthik Bhat [Tue, 10 Mar 2015 13:31:03 +0000 (13:31 +0000)]
Fix a crash in Dependency Analysis.
This crash in Dependency analysis is because we assume here that in case of UsefulGEP
both source and destination have the same number of operands which may not be true.
This incorrect assumption results in crash while populating Pairs. Fix the same.

This crash was observed during lnt regression for code such as-
  struct s{
    int A[10][10];
    int C[10][10][10];
  } S;
  void dep_constraint_crash_test(int k,int N)  {
     for( int i=0;i<N;i++)
       for( int j=0;j<N;j++)
         S.A[0][0] = S.C[0][0][k];
  }
Review: http://reviews.llvm.org/D8162

llvm-svn: 231784

9 years agoThe operand flag word used in ISD::INLINEASM is an i32 not a pointer. NFC.
Daniel Sanders [Tue, 10 Mar 2015 10:42:59 +0000 (10:42 +0000)]
The operand flag word used in ISD::INLINEASM is an i32 not a pointer. NFC.

Summary:
This is part of the work to support memory constraints that behave
differently to 'm'. The subsequent patches will expand on the existing
encoding (which is a 32-bit int) and as a result in some flag words will no
longer fit into an i16. This problem only affected the MSP430 target which
appears to have 16-bit pointers.

Reviewers: hfinkel

Reviewed By: hfinkel

Subscribers: hfinkel, llvm-commits

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

llvm-svn: 231783

9 years agoasan: fix leak test for power platform
Dmitry Vyukov [Tue, 10 Mar 2015 10:36:06 +0000 (10:36 +0000)]
asan: fix leak test for power platform

Power is 64-bit but does not support leak detection,
so this test fails. Use the more robust leak-detection
predicate instead.

llvm-svn: 231782

9 years agofix for broken commit 231774
Andrey Churbanov [Tue, 10 Mar 2015 10:14:57 +0000 (10:14 +0000)]
fix for broken commit 231774

llvm-svn: 231781

9 years agoAlso use LC_C_LOCALE on CloudABI.
Ed Schouten [Tue, 10 Mar 2015 09:35:22 +0000 (09:35 +0000)]
Also use LC_C_LOCALE on CloudABI.

Before I discovered that NetBSD provides a permanent handle to the C
locale called LC_C_LOCALE, I also added support for this to CloudABI
under the name LC_POSIX_LOCALE. I've renamed it to LC_C_LOCALE to
improve compatibility.

llvm-svn: 231780

9 years agoissuing of incorrect warning fixed
Andrey Churbanov [Tue, 10 Mar 2015 09:34:38 +0000 (09:34 +0000)]
issuing of incorrect warning fixed

llvm-svn: 231779

9 years agocleanup: removed unused function __kmp_change_thread_affinity_mask
Andrey Churbanov [Tue, 10 Mar 2015 09:31:21 +0000 (09:31 +0000)]
cleanup: removed unused function __kmp_change_thread_affinity_mask

llvm-svn: 231778

9 years agoEnable _LIBCPP_LOCALE__L_EXTENSIONS on CloudABI.
Ed Schouten [Tue, 10 Mar 2015 09:26:38 +0000 (09:26 +0000)]
Enable _LIBCPP_LOCALE__L_EXTENSIONS on CloudABI.

CloudABI provides the _l() functions that are part of POSIX.1-2008, but
also the extensions that are available on systems like OS X and *BSD
(scanf_l, printf_l, etc).

llvm-svn: 231777

9 years agoproc_bind_disabled enum value removed, its usage replased with proc_bind_false
Andrey Churbanov [Tue, 10 Mar 2015 09:19:47 +0000 (09:19 +0000)]
proc_bind_disabled enum value removed, its usage replased with proc_bind_false

llvm-svn: 231776

9 years agocleanup: usages of mask size wrapped into macros
Andrey Churbanov [Tue, 10 Mar 2015 09:15:26 +0000 (09:15 +0000)]
cleanup: usages of mask size wrapped into macros

llvm-svn: 231775

9 years agoAdding some 8-bit atomic operations for future use
Andrey Churbanov [Tue, 10 Mar 2015 09:03:42 +0000 (09:03 +0000)]
Adding some 8-bit atomic operations for future use

llvm-svn: 231774

9 years agochanged unsigned types to signed - caused by comments of Hal Finkel on one of earlier...
Andrey Churbanov [Tue, 10 Mar 2015 09:00:36 +0000 (09:00 +0000)]
changed unsigned types to signed - caused by comments of Hal Finkel on one of earlier patches

llvm-svn: 231773

9 years agoThe LLD tests require 'llvm-nm' to run as well, ensure that this is
Chandler Carruth [Tue, 10 Mar 2015 08:08:58 +0000 (08:08 +0000)]
The LLD tests require 'llvm-nm' to run as well, ensure that this is
built before running the test suite.

llvm-svn: 231770

9 years agoDon't write output to 'a.out', write it to a temporary file. This fixes
Chandler Carruth [Tue, 10 Mar 2015 08:06:49 +0000 (08:06 +0000)]
Don't write output to 'a.out', write it to a temporary file. This fixes
the test when run frem a read-only checkout of the source tree.

llvm-svn: 231769

9 years agoDon't include <sys/sysctl.h> on CloudABI.
Ed Schouten [Tue, 10 Mar 2015 08:01:10 +0000 (08:01 +0000)]
Don't include <sys/sysctl.h> on CloudABI.

As CloudABI does not provide sysctl(), this header is not present. Make
thread.cpp build correctly (and pass all tests) by not including the header.

llvm-svn: 231768

9 years agoPrint log/error messages on stderr, not stdout
Ed Schouten [Tue, 10 Mar 2015 07:57:43 +0000 (07:57 +0000)]
Print log/error messages on stderr, not stdout

There are a couple of places where libc++ prints log/error messages to
stdout on its own. This may of course interfere with the output
generated with applications. Log/error messages should be directed to
stderr instead.

Differential Revision: http://reviews.llvm.org/D8135
Reviewed by: marshall

llvm-svn: 231767

9 years agoFix the local variable naming I used in r231765 to follow the LLD coding
Chandler Carruth [Tue, 10 Mar 2015 07:54:34 +0000 (07:54 +0000)]
Fix the local variable naming I used in r231765 to follow the LLD coding
conventions. Sorry for missing this before I committed the patch!

llvm-svn: 231766

9 years agoFix a bug where the code would use subscript a std::vector with the size
Chandler Carruth [Tue, 10 Mar 2015 07:53:02 +0000 (07:53 +0000)]
Fix a bug where the code would use subscript a std::vector with the size
of the vector. For a vector 'v', '&v[v.size()]' isn't a valid way to
compute a pointer one-past-the-end of the vector. Instead, write the
loop in terms of iterators and save the beginning iterator. Once we have
that we can compute the beginning pointer from the beginning iterator,
and compute the distance which we should increment the beginning pointer
by subtracting the iterators.

What might be simpler would be to convert the function accepting a raw
pointer for begin and end to accept iterators or a range or some other
construct, but I wanted to keep this to a minimal bug-fix change.

This fixes a crash on any debug STL implementation which checks for
indexing out of bounds.

llvm-svn: 231765

9 years agoAdd support for arc4random() to random_device.
Ed Schouten [Tue, 10 Mar 2015 07:46:06 +0000 (07:46 +0000)]
Add support for arc4random() to random_device.

Nuxi CloudABI (https://github.com/NuxiNL/cloudlibc) does not allow
processes to access the global filesystem namespace. This breaks
random_device, as it attempts to use /dev/{u,}random. This change adds
support for arc4random(), which is present on CloudABI.

In my opinion it would also make sense to use arc4random() on other
operating systems, such as *BSD and Mac OS X, but I'd rather leave that
to the maintainers of the respective platforms. Switching to
arc4random() does change the ABI.

This change also attempts to make some cleanups to the code. It adds a
single #define for every random interface, instead of testing against
operating systems explicitly.

As discussed, also validate the token argument to be equal to
"/dev/urandom" on all systems that only provide pseudo-random numbers.
This should cause little to no breakage, as "/dev/urandom" is also the
default argument value.

Reviewed by: jfb
Differential Revision: http://reviews.llvm.org/D8134

llvm-svn: 231764

9 years agoTeach raw_ostream to accept SmallString.
Yaron Keren [Tue, 10 Mar 2015 07:33:23 +0000 (07:33 +0000)]
Teach raw_ostream to accept SmallString.

Saves adding .str() call to any raw_ostream << SmallString usage
and a small step towards making .str() consistent in the ADTs by
removing one of the SmallString::str() use cases, discussion at

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20141013/240026.html

I'll update the Phabricator patch http://reviews.llvm.org/D6372
for review of the Twine SmallString support, it's more complex
than this one.

llvm-svn: 231763

9 years ago[OPENMP] Initial codegen for 'omp task' directive.
Alexey Bataev [Tue, 10 Mar 2015 07:28:44 +0000 (07:28 +0000)]
[OPENMP] Initial codegen for 'omp task' directive.
The task region is emmitted in several steps:

Emit a call to kmp_task_t *__kmpc_omp_task_alloc(ident_t *, kmp_int32 gtid, kmp_int32 flags, size_t sizeof_kmp_task_t, size_t sizeof_shareds, kmp_routine_entry_t *task_entry).
Here task_entry is a pointer to the function:
kmp_int32 .omp_task_entry.(kmp_int32 gtid, kmp_task_t *tt) {
    TaskFunction(gtid, tt->part_id, tt->shareds);
      return 0;
}
Copy a list of shared variables to field shareds of the resulting structure kmp_task_t returned by the previous call (if any).
Copy a pointer to destructions function to field destructions of the resulting structure kmp_task_t.
Emit a call to kmp_int32 __kmpc_omp_task(ident_t *, kmp_int32 gtid, kmp_task_t *new_task), where new_task is a resulting structure from previous items.
Differential Revision: http://reviews.llvm.org/D7560

llvm-svn: 231762

9 years agoFix a crash in InstCombine where we could try to truncate a switch comparison to...
Owen Anderson [Tue, 10 Mar 2015 06:51:39 +0000 (06:51 +0000)]
Fix a crash in InstCombine where we could try to truncate a switch comparison to zero width.

llvm-svn: 231761

9 years agoFix a stack overflow in the assembler when checking that GEPs must be over sized...
Owen Anderson [Tue, 10 Mar 2015 06:34:57 +0000 (06:34 +0000)]
Fix a stack overflow in the assembler when checking that GEPs must be over sized types.

We failed to use a marking set to properly handle recursive types, which caused use
to recurse infinitely and eventually overflow the stack.

llvm-svn: 231760

9 years agoFix an issue in the verifier where we could try to read information out of a malforme...
Owen Anderson [Tue, 10 Mar 2015 05:58:21 +0000 (05:58 +0000)]
Fix an issue in the verifier where we could try to read information out of a malformed statepoint intrinsic.

In this situation we would always have already flagged an error on the statepoint intrinsic,
but then we carry on to parse other, related GC intrinsics, and could end up crashing during that
verification when they try to access data from the malformed statepoint.

llvm-svn: 231759