platform/upstream/llvm.git
9 years agotsan: properly instrument unaligned accesses
Dmitry Vyukov [Tue, 27 Jan 2015 20:19:17 +0000 (20:19 +0000)]
tsan: properly instrument unaligned accesses

If a memory access is unaligned, emit __tsan_unaligned_read/write
callbacks instead of __tsan_read/write.
Required to change semantics of __tsan_unaligned_read/write to not do the user memory.
But since they were unused (other than through __sanitizer_unaligned_load/store) this is fine.
Fixes long standing issue 17:
https://code.google.com/p/thread-sanitizer/issues/detail?id=17

llvm-svn: 227231

9 years agotsan: properly instrument unaligned accesses
Dmitry Vyukov [Tue, 27 Jan 2015 20:19:12 +0000 (20:19 +0000)]
tsan: properly instrument unaligned accesses

If a memory access is unaligned, emit __tsan_unaligned_read/write
callbacks instead of __tsan_read/write.
Required to change semantics of __tsan_unaligned_read/write to not do the user memory.
But since they were unused (other than through __sanitizer_unaligned_load/store) this is fine.
Fixes long standing issue 17:
https://code.google.com/p/thread-sanitizer/issues/detail?id=17

llvm-svn: 227230

9 years agooverloaded-intrinsic-name: exercise anyptr on struct
Ramkumar Ramachandra [Tue, 27 Jan 2015 20:03:08 +0000 (20:03 +0000)]
overloaded-intrinsic-name: exercise anyptr on struct

No other test I know shows how struct names are mangled in overloaded
intrinsic functions.

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

llvm-svn: 227229

9 years ago[ExecutionEngine] Add weak symbol support to RuntimeDyld
Keno Fischer [Tue, 27 Jan 2015 20:02:31 +0000 (20:02 +0000)]
[ExecutionEngine] Add weak symbol support to RuntimeDyld

Support weak symbols by first looking up if there is an externally visible symbol we can find,
and only if that fails using the one in the object file we're loading.

Reviewed By: lhames
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6950

llvm-svn: 227228

9 years ago[ExecutionEngine] FindFunctionNamed: Skip declarations
Keno Fischer [Tue, 27 Jan 2015 19:29:00 +0000 (19:29 +0000)]
[ExecutionEngine] FindFunctionNamed: Skip declarations

Summary:
Basically all other methods that look up functions by name skip them if they are mere declarations.
Do the same in FindFunctionNamed.

Reviewers: lhames

Reviewed By: lhames

Subscribers: llvm-commits

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

llvm-svn: 227227

9 years ago[libcxx] Make __wrap_iter work with gcc.
Nico Weber [Tue, 27 Jan 2015 19:27:39 +0000 (19:27 +0000)]
[libcxx] Make __wrap_iter work with gcc.

he following snippet doesn't build when using gcc and libc++:

    #include <string>
    void f(const std::string& s) { s.begin(); }
    #include <vector>
    void AppendTo(const std::vector<char>& v) { v.begin(); }

The problem is that __wrap_iter has a private constructor. It lists vector<>
and basic_string<> as friends, but gcc seems to ignore this for vector<> for
some reason. Declaring vector before the friend declaration in __wrap_iter is
enough to work around this problem, so do that. With this patch, I'm able to
build chromium/android with libc++. Without it, two translation units fail to
build. (iosfwd already provides a forward declaration of basic_string.)

As far as I can tell, this is due to a gcc bug, which I filed as
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64816.

Fixes PR22355.

http://reviews.llvm.org/D7201

llvm-svn: 227226

9 years ago[mips] Add range checks and transformation to octeon instructions in AsmParser.
Kai Nacke [Tue, 27 Jan 2015 19:11:28 +0000 (19:11 +0000)]
[mips] Add range checks and transformation to octeon instructions in AsmParser.

This patch adds range checks to the immediate operands of octeon
instructions in the AsmParser. Like gas, it applies the following
transformations if the immediate is to large:

bbit0 $8, 42, foo => bbit032 $8, 10, foo
bbit1 $8, 46, foo => bbit132 $8, 14, foo
cins $8, $31, 32, 31 => cins32 $8, $31, 0, 31
exts $7, $4, 54, 9 => exts32 $7, $4, 22, 9

Reviewed By: dsanders

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

llvm-svn: 227225

9 years agoImplement the remaining portion of DR1467 from r227022. I may have overlooked a few...
Larisse Voufo [Tue, 27 Jan 2015 18:47:05 +0000 (18:47 +0000)]
Implement the remaining portion of DR1467 from r227022. I may have overlooked a few things, but this implementation comes straight from the DR resolution itself.

llvm-svn: 227224

9 years agoCheck wchar_t type on PS4.
Alex Rosenberg [Tue, 27 Jan 2015 18:43:05 +0000 (18:43 +0000)]
Check wchar_t type on PS4.

llvm-svn: 227223

9 years agoFix copy paste error in file header.
Chaoren Lin [Tue, 27 Jan 2015 18:40:25 +0000 (18:40 +0000)]
Fix copy paste error in file header.

llvm-svn: 227222

9 years agoUpdate the doxygen comments in CGDebugInfo.h to follow the coding standards.
Adrian Prantl [Tue, 27 Jan 2015 18:32:19 +0000 (18:32 +0000)]
Update the doxygen comments in CGDebugInfo.h to follow the coding standards.

llvm-svn: 227221

9 years agoProperly handle typos in the conditional of ?: expressions in C.
Kaelyn Takata [Tue, 27 Jan 2015 18:26:18 +0000 (18:26 +0000)]
Properly handle typos in the conditional of ?: expressions in C.

In particular, remove the OpaqueExpr transformation from r225389 and
move the correction of the conditional from CheckConditionalOperands to
ActOnConditionalOp before the OpaqueExpr is created. This fixes the
typo correction behavior in C code that uses the GNU extension for a
binary ?: (without an expression between the "?" and the ":").

llvm-svn: 227220

9 years agoFix part of r227215. PS4 code just omits leaf frame pointers.
Filipe Cabecinhas [Tue, 27 Jan 2015 18:08:32 +0000 (18:08 +0000)]
Fix part of r227215. PS4 code just omits leaf frame pointers.

llvm-svn: 227219

9 years agoClean lldb-mi test cases.
Hafiz Abid Qadeer [Tue, 27 Jan 2015 18:03:50 +0000 (18:03 +0000)]
Clean lldb-mi test cases.
This patch adds lldbmi_testcase.MiTestCaseBase class and removes
a lot of repitition in the lldb-mi test cases. Also cleans import
list and code-style.

Presented for review in http://reviews.llvm.org/D7162.
Patch from Ilia K <ki.stfu@gmail.com>.

llvm-svn: 227218

9 years agoThe MCJIT doesn't seem to call getPointerForNamedFunction from the MemoryManager...
Jim Ingham [Tue, 27 Jan 2015 18:03:05 +0000 (18:03 +0000)]
The MCJIT doesn't seem to call getPointerForNamedFunction from the MemoryManager anymore, switching to getSymbolAddress, which
it does call, and implementing it so that we once again look up external symbols in the JIT.

Also juked the error reporting from the JIT a little bit.

This resolves:
http://llvm.org/bugs/show_bug.cgi?id=22314

llvm-svn: 227217

9 years agoAdd cmake flag LLVM_USE_SANITIZE_COVERAGE
Kostya Serebryany [Tue, 27 Jan 2015 17:59:28 +0000 (17:59 +0000)]
Add cmake flag LLVM_USE_SANITIZE_COVERAGE

Summary:
When LLVM_USE_SANITIZE_COVERAGE=YES
and one of the sanitizers is used -fsanitize-coverage=3 will be added
to build flag. This will be used to run a coverage-guided fuzzer on various
llvm libraries.

Test Plan: n/a

Reviewers: rnk

Reviewed By: rnk

Subscribers: llvm-commits

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

llvm-svn: 227216

9 years agoAdded more PS4 defaults for code generation
Filipe Cabecinhas [Tue, 27 Jan 2015 17:27:37 +0000 (17:27 +0000)]
Added more PS4 defaults for code generation

llvm-svn: 227215

9 years agoR600/SI: Enable all tests that pass on VI without changes
Marek Olsak [Tue, 27 Jan 2015 17:27:15 +0000 (17:27 +0000)]
R600/SI: Enable all tests that pass on VI without changes

llvm-svn: 227214

9 years agoR600/SI: Fix MIN3/MAX3 on VI, define MED3
Marek Olsak [Tue, 27 Jan 2015 17:25:15 +0000 (17:25 +0000)]
R600/SI: Fix MIN3/MAX3 on VI, define MED3

llvm-svn: 227213

9 years agoR600/SI: Don't set patterns for chip-specific instructions while having pseudos
Marek Olsak [Tue, 27 Jan 2015 17:25:11 +0000 (17:25 +0000)]
R600/SI: Don't set patterns for chip-specific instructions while having pseudos

Only pseudos have patterns on them.

Also don't set the asm string for VINTRP_Pseudo. All pseudos should have empty
asm.

This matches what all other multiclasses do.

llvm-svn: 227212

9 years agoR600/SI: Add VI versions of LDS atomics
Marek Olsak [Tue, 27 Jan 2015 17:25:07 +0000 (17:25 +0000)]
R600/SI: Add VI versions of LDS atomics

Each class is split into two: one adds let statements around non-pseudos,
and the other one specifies the parameters.

llvm-svn: 227211

9 years agoR600/SI: Add VI versions of MUBUF atomics
Marek Olsak [Tue, 27 Jan 2015 17:25:02 +0000 (17:25 +0000)]
R600/SI: Add VI versions of MUBUF atomics

llvm-svn: 227210

9 years agoR600/SI: Add VI versions of MUBUF loads and stores
Marek Olsak [Tue, 27 Jan 2015 17:24:58 +0000 (17:24 +0000)]
R600/SI: Add VI versions of MUBUF loads and stores

This enables a lot of existing patterns for VI.

llvm-svn: 227209

9 years agoR600/SI: Add pseudos for MUBUF loads and stores
Marek Olsak [Tue, 27 Jan 2015 17:24:54 +0000 (17:24 +0000)]
R600/SI: Add pseudos for MUBUF loads and stores

This defines the SI versions only, so it shouldn't change anything.

There are no changes other than using the new multiclasses, adding missing
mayLoad/mayStore, and formatting fixes.

llvm-svn: 227208

9 years agoComments only: removing the Revision and Date svn variables from the top of all the...
Andrey Churbanov [Tue, 27 Jan 2015 17:13:53 +0000 (17:13 +0000)]
Comments only: removing the Revision and Date svn variables from the top of all the source files.

llvm-svn: 227207

9 years agoprofile: add lib/profile to cc_kext on darwin,arm64
Justin Bogner [Tue, 27 Jan 2015 17:10:07 +0000 (17:10 +0000)]
profile: add lib/profile to cc_kext on darwin,arm64

These functions are already present in the cc_kext for arm32 and for x86 and
x86_64.  It was an oversight that they were not included for arm64.

Based on a patch by Lawrence D'Anna. Thanks!

llvm-svn: 227206

9 years agominor formatting change
Andrey Churbanov [Tue, 27 Jan 2015 17:06:18 +0000 (17:06 +0000)]
minor formatting change

llvm-svn: 227205

9 years agoEnables a cpuid leaf 4 check for non-MIC x86 architectures.
Andrey Churbanov [Tue, 27 Jan 2015 17:03:42 +0000 (17:03 +0000)]
Enables a cpuid leaf 4 check for non-MIC x86 architectures.

llvm-svn: 227204

9 years agoAdds some new Windows processor groups trace messages
Andrey Churbanov [Tue, 27 Jan 2015 17:00:03 +0000 (17:00 +0000)]
Adds some new Windows processor groups trace messages

llvm-svn: 227203

9 years agoFixes error where proc-bind-var is not set when there is a parsing error of GOMP_AFFI...
Andrey Churbanov [Tue, 27 Jan 2015 16:58:08 +0000 (16:58 +0000)]
Fixes error where proc-bind-var is not set when there is a parsing error of GOMP_AFFINITY environment variable.

llvm-svn: 227202

9 years agoRemoves some unused variables (__kmp_ht_*) and changes__kmp_ncores and __kmp_nThreads...
Andrey Churbanov [Tue, 27 Jan 2015 16:55:43 +0000 (16:55 +0000)]
Removes some unused variables (__kmp_ht_*) and changes__kmp_ncores and __kmp_nThreadsPerCore to static globals within kmp_affinity.cpp.

llvm-svn: 227201

9 years agoNo longer SCE_PRIVATE ;)
Sean Silva [Tue, 27 Jan 2015 16:53:56 +0000 (16:53 +0000)]
No longer SCE_PRIVATE ;)

llvm-svn: 227200

9 years agoReplaces KMP_OS_WINDOWS && KMP_ARCH_X86_64 or any combination of those two options...
Andrey Churbanov [Tue, 27 Jan 2015 16:52:57 +0000 (16:52 +0000)]
Replaces KMP_OS_WINDOWS && KMP_ARCH_X86_64 or any combination of those two options with the feature macro KMP_GROUP_AFFINITY.

llvm-svn: 227199

9 years agoFixed implementation of the teams construct in case it contains parallel regions...
Andrey Churbanov [Tue, 27 Jan 2015 16:50:31 +0000 (16:50 +0000)]
Fixed implementation of the teams construct in case it contains parallel regions with different number of threads.

llvm-svn: 227198

9 years ago[InstCombine] Teach how to fold a select into a cttz/ctlz with the 'is_zero_undef...
Andrea Di Biagio [Tue, 27 Jan 2015 15:58:14 +0000 (15:58 +0000)]
[InstCombine] Teach how to fold a select into a cttz/ctlz with the 'is_zero_undef' flag.

This patch teaches the Instruction Combiner how to fold a cttz/ctlz followed by
a icmp plus select into a single cttz/ctlz with flag 'is_zero_undef' cleared.

Added test InstCombine/select-cmp-cttz-ctlz.ll.

llvm-svn: 227197

9 years agoRevert r226440.
Evgeniy Stepanov [Tue, 27 Jan 2015 15:06:54 +0000 (15:06 +0000)]
Revert r226440.

It was fixed the right way in r227195.

llvm-svn: 227196

9 years ago[sancov] Fix unspecified constructor order between sancov and asan.
Evgeniy Stepanov [Tue, 27 Jan 2015 15:01:22 +0000 (15:01 +0000)]
[sancov] Fix unspecified constructor order between sancov and asan.

Sanitizer coverage constructor must run after asan constructor (for each DSO).
Bump constructor priority to guarantee that.

llvm-svn: 227195

9 years agoBegin to teach clang about the PS4.
Alex Rosenberg [Tue, 27 Jan 2015 14:47:44 +0000 (14:47 +0000)]
Begin to teach clang about the PS4.

llvm-svn: 227194

9 years ago[msan] Refactor memory layout specification and setup.
Evgeniy Stepanov [Tue, 27 Jan 2015 13:20:34 +0000 (13:20 +0000)]
[msan] Refactor memory layout specification and setup.

A flexible way of describing MSan memory layout details on various
platforms. No significant functional changes, but the memory layout
description that you get at verbosity=1 looks slightly different.
This change includes stronger sanity checks than before.

The goal of this change is to allow more than 2 application memory
ranges for https://code.google.com/p/memory-sanitizer/issues/detail?id=76.

llvm-svn: 227192

9 years agoAdd a FIXME in SelectionDAGBuilder before an assert that is valid only on X86.
Manuel Jacob [Tue, 27 Jan 2015 13:14:35 +0000 (13:14 +0000)]
Add a FIXME in SelectionDAGBuilder before an assert that is valid only on X86.

When lowering memcpy, memset or memmove, this assert checks whether the pointer
operands are in an address space < 256 which means "user defined address space"
on X86.  However, this notion of "user defined address space" does not exist
for other targets.

llvm-svn: 227191

9 years agotsan: add test for ANNOTATE_HAPPENS_BEFORE/AFTER annotations
Dmitry Vyukov [Tue, 27 Jan 2015 13:03:18 +0000 (13:03 +0000)]
tsan: add test for ANNOTATE_HAPPENS_BEFORE/AFTER annotations

llvm-svn: 227190

9 years ago[MSan] Enable MSan unit tests for all archs
Mohit K. Bhakkad [Tue, 27 Jan 2015 12:38:25 +0000 (12:38 +0000)]
[MSan] Enable MSan unit tests for all archs

Reviewers: Reviewers: eugenis, kcc, samsonov, petarj

Subscribers: dsanders, sagar, lldb-commits

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

llvm-svn: 227189

9 years ago[X86] Add intrinsics for AVX512 128 and 256 bit integer comparison of word and byte...
Craig Topper [Tue, 27 Jan 2015 09:16:29 +0000 (09:16 +0000)]
[X86] Add intrinsics for AVX512 128 and 256 bit integer comparison of word and byte vectors.

llvm-svn: 227186

9 years agoReplace some uses of getSubtargetImpl with the cached version
Eric Christopher [Tue, 27 Jan 2015 08:48:42 +0000 (08:48 +0000)]
Replace some uses of getSubtargetImpl with the cached version
off of the MachineFunction or with the version that takes a
Function reference as an argument.

llvm-svn: 227185

9 years ago[ARM] Correctly use make_unhandled_reloc_error
Denis Protivensky [Tue, 27 Jan 2015 08:47:15 +0000 (08:47 +0000)]
[ARM] Correctly use make_unhandled_reloc_error

llvm-svn: 227184

9 years ago[Mips] Fix createMipsRelocationHandler specialization (take 2)
Denis Protivensky [Tue, 27 Jan 2015 08:36:34 +0000 (08:36 +0000)]
[Mips] Fix createMipsRelocationHandler specialization (take 2)

Misread buildbot's log.
Both gcc and clang compile this fine.

Original fix reason:
gcc allows template specializations only in the same namespace
where template has been declared.

llvm-svn: 227183

9 years ago[PM] Clean up file banner comments prior to refactoring this code.
Chandler Carruth [Tue, 27 Jan 2015 08:28:33 +0000 (08:28 +0000)]
[PM] Clean up file banner comments prior to refactoring this code.

llvm-svn: 227182

9 years agoHave the PBQP register allocator use the subtarget on the MachineFunction.
Eric Christopher [Tue, 27 Jan 2015 08:27:06 +0000 (08:27 +0000)]
Have the PBQP register allocator use the subtarget on the MachineFunction.
(and remove an extraneous private).

llvm-svn: 227181

9 years agoRemove some extraneous includes.
Eric Christopher [Tue, 27 Jan 2015 08:27:03 +0000 (08:27 +0000)]
Remove some extraneous includes.

llvm-svn: 227180

9 years agoRevert "[Mips] Fix createMipsRelocationHandler specialization"
Denis Protivensky [Tue, 27 Jan 2015 08:22:07 +0000 (08:22 +0000)]
Revert "[Mips] Fix createMipsRelocationHandler specialization"

The buildbot reported build failures for clang.

llvm-svn: 227179

9 years agoFix build failure with pointer vs reference.
Eric Christopher [Tue, 27 Jan 2015 08:00:42 +0000 (08:00 +0000)]
Fix build failure with pointer vs reference.

NB: Saving files after editing helps.
llvm-svn: 227178

9 years ago[Mips] Fix createMipsRelocationHandler specialization
Denis Protivensky [Tue, 27 Jan 2015 07:56:25 +0000 (07:56 +0000)]
[Mips] Fix createMipsRelocationHandler specialization

gcc allows template specializations only in the same namespace
where template has been declared.

llvm-svn: 227177

9 years agoUpdate a few calls to getSubtarget<> to either be getSubtargetImpl
Eric Christopher [Tue, 27 Jan 2015 07:54:39 +0000 (07:54 +0000)]
Update a few calls to getSubtarget<> to either be getSubtargetImpl
when we didn't need the cast to the base class or the cached version
off of the subtarget.

llvm-svn: 227176

9 years agoClean up the AArch64 store pair suppression pass initialization
Eric Christopher [Tue, 27 Jan 2015 07:54:36 +0000 (07:54 +0000)]
Clean up the AArch64 store pair suppression pass initialization
and remove and unnecessary class variable.

llvm-svn: 227175

9 years ago[lld] Correct forming of ARM/Thumb atoms
Denis Protivensky [Tue, 27 Jan 2015 07:39:04 +0000 (07:39 +0000)]
[lld] Correct forming of ARM/Thumb atoms

Symbols addressing Thumb code have zero bit set in st_value to distinguish them from ARM instructions.
This caused wrong atoms' forming because of offset of one byte brought in by that corrected st_value.

Fixed reading of st_value & st_value-related things in ARMELFFile while forming atoms.
Symbol table generation is also fixed for Thumb atoms.

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

llvm-svn: 227174

9 years agoThe subtarget is cached on the MachineFunction. Access it directly.
Eric Christopher [Tue, 27 Jan 2015 07:31:29 +0000 (07:31 +0000)]
The subtarget is cached on the MachineFunction. Access it directly.

llvm-svn: 227173

9 years agoMigrate SeparateConstOffsetFromGEP to use a Function with
Eric Christopher [Tue, 27 Jan 2015 07:16:37 +0000 (07:16 +0000)]
Migrate SeparateConstOffsetFromGEP to use a Function with
getSubtarget.

llvm-svn: 227172

9 years agoLoopRotate: Don't walk the uses of a Constant
David Majnemer [Tue, 27 Jan 2015 06:21:43 +0000 (06:21 +0000)]
LoopRotate: Don't walk the uses of a Constant

LoopRotate wanted to avoid live range interference by looking at the
uses of a Value in the loop latch and seeing if any lied outside of the
loop.  We would wrongly perform this operation on Constants.

This fixes PR22337.

llvm-svn: 227171

9 years agoRemove unused include.
Eric Christopher [Tue, 27 Jan 2015 05:58:44 +0000 (05:58 +0000)]
Remove unused include.

llvm-svn: 227170

9 years agoDR1902: if overload resolution recurses, and the inner overload resolution
Richard Smith [Tue, 27 Jan 2015 03:30:40 +0000 (03:30 +0000)]
DR1902: if overload resolution recurses, and the inner overload resolution
selects a deleted function, the outer function is still a candidate even though
the initialization sequence is "otherwise ill-formed".

llvm-svn: 227169

9 years agoFix incorrect atom ordinal.
Rui Ueyama [Tue, 27 Jan 2015 03:05:34 +0000 (03:05 +0000)]
Fix incorrect atom ordinal.

Anonymous atoms created there were getting wrong atom ordinal.
LayoutAfter references take precedence over atom ordinals, so
the bug was not visible, though.

llvm-svn: 227168

9 years agoRevert r227148 & r227154 which added a test which infinitely loops.
Richard Trieu [Tue, 27 Jan 2015 03:03:47 +0000 (03:03 +0000)]
Revert r227148 & r227154 which added a test which infinitely loops.

r227148 added test CommandLineTest.HideUnrelatedOptionsMulti which repeatedly
outputs two following lines:

-tool: CommandLine Error: Option 'test-option-1' registered more than once!
-tool: CommandLine Error: Option 'test-option-2' registered more than once!

r227154 depends on changes from r227148

llvm-svn: 227167

9 years agoApply the transformation to the static type as well as the dynamic type. It doesn...
Enrico Granata [Tue, 27 Jan 2015 02:46:27 +0000 (02:46 +0000)]
Apply the transformation to the static type as well as the dynamic type. It doesn't make sense to carry along an untransformed static type

llvm-svn: 227166

9 years ago[PM] Run clang-format over this header to clean up the very few)
Chandler Carruth [Tue, 27 Jan 2015 02:20:43 +0000 (02:20 +0000)]
[PM] Run clang-format over this header to clean up the very few)
divergent formatting issues. This should prevent any format-only diffs
from sneaking into subsequent changes to port TTI to the new pass
manager.

llvm-svn: 227165

9 years ago[PM] Switch a doxygen comment to the standard format. NFC
Chandler Carruth [Tue, 27 Jan 2015 02:20:41 +0000 (02:20 +0000)]
[PM] Switch a doxygen comment to the standard format. NFC

llvm-svn: 227164

9 years agoAllow python command interpreter commands to be interruptable via CTRL+C.
Greg Clayton [Tue, 27 Jan 2015 01:58:22 +0000 (01:58 +0000)]
Allow python command interpreter commands to be interruptable via CTRL+C.

<rdar://problem/17935601>

llvm-svn: 227163

9 years ago[PM] Refactor the core logic to run EarlyCSE over a function into an
Chandler Carruth [Tue, 27 Jan 2015 01:34:14 +0000 (01:34 +0000)]
[PM] Refactor the core logic to run EarlyCSE over a function into an
object that manages a single run of this pass.

This was already essentially how it worked. Within the run function, it
would point members at *stack local* allocations that were only live for
a single run. Instead, it seems much cleaner to have a utility object
whose lifetime is clearly bounded by the run of the pass over the
function and can use member variables in a more direct way.

This also makes it easy to plumb the analyses used into it from the pass
and will make it re-usable with the new pass manager.

No functionality changed here, its just a refactoring.

llvm-svn: 227162

9 years ago[ASan] Use rpath in tests that produce a shared library
Kuba Brecka [Tue, 27 Jan 2015 01:29:18 +0000 (01:29 +0000)]
[ASan] Use rpath in tests that produce a shared library

Modifying Darwin/interception-in-shared-lib-test.cc and suppressions-library.cc
to use rpath instead of linking against the full path to the temporary file.
NFC.

llvm-svn: 227161

9 years agoMachineRegisterInfo can access TII off of the MachineFunction's
Eric Christopher [Tue, 27 Jan 2015 01:15:16 +0000 (01:15 +0000)]
MachineRegisterInfo can access TII off of the MachineFunction's
subtarget and so doesn't need the TargetMachine or to access via
getSubtargetImpl. Update all callers.

llvm-svn: 227160

9 years agoMigrate AtomicExpandPass and DwarfEHPrepare to using a Function-ized getSubtargetImpl.
Eric Christopher [Tue, 27 Jan 2015 01:04:42 +0000 (01:04 +0000)]
Migrate AtomicExpandPass and DwarfEHPrepare to using a Function-ized getSubtargetImpl.

llvm-svn: 227159

9 years agoFix unsigned/signed comparison warning.
Eric Christopher [Tue, 27 Jan 2015 01:01:39 +0000 (01:01 +0000)]
Fix unsigned/signed comparison warning.

llvm-svn: 227158

9 years agoMigrate CodeGenPrepare to use the Function based getSubtarget
Eric Christopher [Tue, 27 Jan 2015 01:01:38 +0000 (01:01 +0000)]
Migrate CodeGenPrepare to use the Function based getSubtarget
code.

llvm-svn: 227157

9 years agoGrab the TargetLowering info from the DAG rather than querying for
Eric Christopher [Tue, 27 Jan 2015 01:01:36 +0000 (01:01 +0000)]
Grab the TargetLowering info from the DAG rather than querying for
a subtarget.

llvm-svn: 227156

9 years agoRemove extraneous period.
Eric Christopher [Tue, 27 Jan 2015 01:01:34 +0000 (01:01 +0000)]
Remove extraneous period.

llvm-svn: 227155

9 years agoOne more fix to the new API to fix const-correctness.
Chris Bieneman [Tue, 27 Jan 2015 00:42:00 +0000 (00:42 +0000)]
One more fix to the new API to fix const-correctness.

llvm-svn: 227154

9 years agoFix the test to disassemble as if at address zero, not at an invalid address. The...
Greg Clayton [Tue, 27 Jan 2015 00:22:36 +0000 (00:22 +0000)]
Fix the test to disassemble as if at address zero, not at an invalid address. The default SBAddress constructor sets the offset to 0xffffffffffffffff and the section to NULL.

This was causing problems on clang 602 branches that use MemoryObjects to as the container for opcode bytes instead of a plain array of bytes. So we were asking for 3 bytes to be disassembled at address 0xffffffffffffffff which would cause an unsigned overflow and cause the MemoryObject to refuse to read anymore bytes.

llvm-svn: 227153

9 years agoReplace this testcase with an even shorter one provided by dblaikie.
Adrian Prantl [Tue, 27 Jan 2015 00:22:17 +0000 (00:22 +0000)]
Replace this testcase with an even shorter one provided by dblaikie.

llvm-svn: 227152

9 years agoCommoning of target specific load/store intrinsics in Early CSE.
Chad Rosier [Mon, 26 Jan 2015 22:51:15 +0000 (22:51 +0000)]
Commoning of target specific load/store intrinsics in Early CSE.

Phabricator revision: http://reviews.llvm.org/D7121
Patch by Sanjin Sijaric <ssijaric@codeaurora.org>!

llvm-svn: 227149

9 years agoPete Cooper suggested the new API should use ArrayRef instead of SmallVectorImpl...
Chris Bieneman [Mon, 26 Jan 2015 22:50:47 +0000 (22:50 +0000)]
Pete Cooper suggested the new API should use ArrayRef instead of SmallVectorImpl. Also adding a test case.

llvm-svn: 227148

9 years agoFix local variable names.
Rui Ueyama [Mon, 26 Jan 2015 22:47:52 +0000 (22:47 +0000)]
Fix local variable names.

llvm-svn: 227147

9 years agoAdd test cases for PRE w/volatile loads
Philip Reames [Mon, 26 Jan 2015 22:40:44 +0000 (22:40 +0000)]
Add test cases for PRE w/volatile loads

These tests check that the combination of 227110 (cross block query inst) and 227112 (volatile load semantics) work together properly to allow PRE in cases where a loop contains a volatile access.

llvm-svn: 227146

9 years ago[X86][SSE] Float comparisons can sometimes be safely commuted
Simon Pilgrim [Mon, 26 Jan 2015 22:29:24 +0000 (22:29 +0000)]
[X86][SSE] Float comparisons can sometimes be safely commuted

For ordered, unordered, equal and not-equal tests, packed float and double comparison instructions can be safely commuted without affecting the results. This patch checks the comparison mode of the (v)cmpps + (v)cmppd instructions and commutes the result if it can.

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

llvm-svn: 227145

9 years agoAccept -allow-shlib-undefined in addition to --allow-shlib-undefined.
Rui Ueyama [Mon, 26 Jan 2015 22:13:53 +0000 (22:13 +0000)]
Accept -allow-shlib-undefined in addition to --allow-shlib-undefined.

GNU LD accepts both. CMake seems to use the former than the latter.

llvm-svn: 227144

9 years agoHave the UTF conversion wrappers append a null terminator.
Zachary Turner [Mon, 26 Jan 2015 22:05:50 +0000 (22:05 +0000)]
Have the UTF conversion wrappers append a null terminator.

This is especially useful for the UTF8 -> UTF16 direction, since
there is no equivalent of llvm::SmallString<> for wide characters.
This means that anyone who wants a null terminated string is forced
to manually push and pop their own null terminator.

Reviewed by: Reid Kleckner.

llvm-svn: 227143

9 years agoAdopt CMake policy CMP0042. Set MACOSX_RPATH on by default.
Eric Fiselier [Mon, 26 Jan 2015 22:00:30 +0000 (22:00 +0000)]
Adopt CMake policy CMP0042. Set MACOSX_RPATH on by default.

llvm-svn: 227142

9 years ago[X86][PCLMUL] Enable commutation for PCLMUL instructions
Simon Pilgrim [Mon, 26 Jan 2015 22:00:18 +0000 (22:00 +0000)]
[X86][PCLMUL] Enable commutation for PCLMUL instructions

Patch to allow (v)pclmulqdq to be commuted - swaps the src registers and inverts the immediate (low/high) src mask.

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

llvm-svn: 227141

9 years agoAdd new HideUnrelatedOptions API that takes a SmallVectorImpl.
Chris Bieneman [Mon, 26 Jan 2015 21:57:29 +0000 (21:57 +0000)]
Add new HideUnrelatedOptions API that takes a SmallVectorImpl.

Need a new API for clang-modernize that allows specifying a list of option categories to remain visible. This will allow clang-modernize to move off getRegisteredOptions.

llvm-svn: 227140

9 years agoAdopt CMake policy CMP0042. Set MACOSX_RPATH on by default.
Eric Fiselier [Mon, 26 Jan 2015 21:56:45 +0000 (21:56 +0000)]
Adopt CMake policy CMP0042. Set MACOSX_RPATH on by default.

llvm-svn: 227139

9 years agoLine endings fix. NFC.
Simon Pilgrim [Mon, 26 Jan 2015 21:28:32 +0000 (21:28 +0000)]
Line endings fix. NFC.

llvm-svn: 227138

9 years agoR600: Cleanup or test
Matt Arsenault [Mon, 26 Jan 2015 21:16:10 +0000 (21:16 +0000)]
R600: Cleanup or test

Fix broken check lines, use multiple check prefixes,
add an additional test for i1 or.

llvm-svn: 227137

9 years agoLine endings fix. NFC.
Simon Pilgrim [Mon, 26 Jan 2015 21:15:42 +0000 (21:15 +0000)]
Line endings fix. NFC.

llvm-svn: 227136

9 years agoDon't generate llvm.expect intrinsics with -O0.
Pete Cooper [Mon, 26 Jan 2015 20:51:58 +0000 (20:51 +0000)]
Don't generate llvm.expect intrinsics with -O0.

The backend won't run LowerExpect on -O0.  In a debug LTO build, this results in llvm.expect intrinsics being in the LTO IR which doesn't know how to optimize them.

Thanks to Chandler for the suggestion and review.

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

llvm-svn: 227135

9 years agoFix shared library build
Greg Fitzgerald [Mon, 26 Jan 2015 20:46:47 +0000 (20:46 +0000)]
Fix shared library build

* Removed cyclic dependency between lldPECOFF and lldDriver
* Added missing dependencies in unit tests

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

llvm-svn: 227134

9 years agobpf: fix build due to 'Move DataLayout back to the TargetMachine'
Alexei Starovoitov [Mon, 26 Jan 2015 20:43:15 +0000 (20:43 +0000)]
bpf: fix build due to 'Move DataLayout back to the TargetMachine'

commit r227113 moved DataLayout

llvm-svn: 227133

9 years agoUse parallel_sort in the LayoutPass.
Rui Ueyama [Mon, 26 Jan 2015 20:18:37 +0000 (20:18 +0000)]
Use parallel_sort in the LayoutPass.

Time to link lld using lld improved from 5.7s to 5.4s on Windows.
It's not a significant improvement but not bad for one-line change.

This patch includes a bug fix for Parallel.h as the original code
uses operator< instead of a compare function there.

llvm-svn: 227132

9 years agoAdded test for incomplete type support in vector/list/forward_list. References PR...
Marshall Clow [Mon, 26 Jan 2015 20:06:52 +0000 (20:06 +0000)]
Added test for incomplete type support in vector/list/forward_list. References PR#17980

llvm-svn: 227131

9 years ago[x86][MMX] Rename and cleanup tests: arith, intrinsics and shuffle
Bruno Cardoso Lopes [Mon, 26 Jan 2015 20:06:51 +0000 (20:06 +0000)]
[x86][MMX] Rename and cleanup tests: arith, intrinsics and shuffle

- Rename mmx-builtins to mmx-intrinsics to match other intrinsic test naming.
- Remove tests that duplicate functionality from mmx-intrinsics.ll.
- Move arith related tests to mmx-arith.ll.
- MMX related shuffle goes to vector-shuffle-mmx.ll.

llvm-svn: 227130

9 years agoTweak r227115 per review feedback
Ben Langmuir [Mon, 26 Jan 2015 20:01:17 +0000 (20:01 +0000)]
Tweak r227115 per review feedback

Use getAsArrayTypeUnsafe() instead of getUnqualifiedDesugaredType() to
get the underlying ArrayType.

llvm-svn: 227129

9 years agoFix broken doc link to Clang 3.5 release notes
Reid Kleckner [Mon, 26 Jan 2015 19:53:16 +0000 (19:53 +0000)]
Fix broken doc link to Clang 3.5 release notes

We appear to use 3.5.0 in the directory structure now. That's probably
unnecessary. We should probably let the micro releases update the docs
for the same minor version.

llvm-svn: 227127

9 years agoSimplifyCFG: Omit range checks for switch lookup tables when default is unreachable
Hans Wennborg [Mon, 26 Jan 2015 19:52:34 +0000 (19:52 +0000)]
SimplifyCFG: Omit range checks for switch lookup tables when default is unreachable

The range check would get optimized away later, but we might as well not emit
them in the first place.

http://reviews.llvm.org/D6471

llvm-svn: 227126