platform/upstream/llvm.git
9 years agoUpdate obsolete comments, fix typo, delete trailing space.
Douglas Katzman [Thu, 14 May 2015 18:07:04 +0000 (18:07 +0000)]
Update obsolete comments, fix typo, delete trailing space.

llvm-svn: 237378

9 years ago[ConstantFolding] Fix wrong folding of intrinsic 'convert.from.fp16'.
Andrea Di Biagio [Thu, 14 May 2015 18:01:48 +0000 (18:01 +0000)]
[ConstantFolding] Fix wrong folding of intrinsic 'convert.from.fp16'.

Function 'ConstantFoldScalarCall' (in ConstantFolding.cpp) works under the
wrong assumption that a call to 'convert.from.fp16' returns a value of
type 'float'.
However, intrinsic 'convert.from.fp16' can be overloaded; for example, we
can call 'convert.from.fp16.f64' to convert from half to double; etc.

Before this patch, the following example would have triggered an assertion
failure in opt (with -constprop):

```
define double @foo() {
entry:
  %0 = call double @llvm.convert.from.fp16.f64(i16 0)
  ret double %0
}
```

This patch fixes the problem in ConstantFolding.cpp. When folding a call to
convert.from.fp16, we perform a different kind of conversion based on the call
return type.

Added test 'Transform/ConstProp/convert-from-fp16.ll'.

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

llvm-svn: 237377

9 years agoTargetSchedule: factor out common code; NFC
Matthias Braun [Thu, 14 May 2015 18:01:13 +0000 (18:01 +0000)]
TargetSchedule: factor out common code; NFC

llvm-svn: 237376

9 years agoRemove MCInstrItineraries includes in parts that don't use them anymore
Matthias Braun [Thu, 14 May 2015 18:01:11 +0000 (18:01 +0000)]
Remove MCInstrItineraries includes in parts that don't use them anymore

llvm-svn: 237375

9 years agoRemove unused function HasPICArg().
Ikhlas Ajbar [Thu, 14 May 2015 17:42:20 +0000 (17:42 +0000)]
Remove unused function HasPICArg().

llvm-svn: 237374

9 years ago[Hexagon] Remove dead constant assignment in hardware loop pass
Brendon Cahoon [Thu, 14 May 2015 17:31:40 +0000 (17:31 +0000)]
[Hexagon] Remove dead constant assignment in hardware loop pass

After converting a loop to a hardware loop, the pass should remove
any unnecessary instructions from the old compare-and-branch
code. This patch removes a dead constant assignment that was
used in the compare instruction.

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

llvm-svn: 237373

9 years agoEnable solid lzma compression for cpack, decreases setup size by ~30%
Ismail Donmez [Thu, 14 May 2015 17:07:41 +0000 (17:07 +0000)]
Enable solid lzma compression for cpack, decreases setup size by ~30%

Reviewed by Hans Wennborg

llvm-svn: 237372

9 years agoAvoid Linux-specific header in platform-independent tests
Ed Maste [Thu, 14 May 2015 16:39:02 +0000 (16:39 +0000)]
Avoid Linux-specific header in platform-independent tests

llvm-svn: 237371

9 years ago[ARM] Fix of architecture naming typo
Vladimir Sukharev [Thu, 14 May 2015 16:39:01 +0000 (16:39 +0000)]
[ARM] Fix of architecture naming typo

Inspired by James Greenhalgh's catch

Subscribers: cfe-commits

Relates to: http://reviews.llvm.org/rL237349

llvm-svn: 237370

9 years agoXTIMEOUT tests timing out on the FreeBSD buildbot
Ed Maste [Thu, 14 May 2015 16:25:52 +0000 (16:25 +0000)]
XTIMEOUT tests timing out on the FreeBSD buildbot

llvm-svn: 237369

9 years agoDetect uses of mismatching forms of 'new' and 'delete'
Ismail Pazarbasi [Thu, 14 May 2015 16:14:57 +0000 (16:14 +0000)]
Detect uses of mismatching forms of 'new' and 'delete'

Emit warning when operand to `delete` is allocated with `new[]` or
operand to `delete[]` is allocated with `new`.

Reviewers: rtrieu, jordan_rose, rsmith

Subscribers: majnemer, cfe-commits

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

llvm-svn: 237368

9 years agoReflow long lines of some LLVMBuild files
Douglas Katzman [Thu, 14 May 2015 15:38:27 +0000 (15:38 +0000)]
Reflow long lines of some LLVMBuild files

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

llvm-svn: 237367

9 years ago[mips] [IAS] Enforce .set nomacro.
Toma Tabacu [Thu, 14 May 2015 14:51:32 +0000 (14:51 +0000)]
[mips] [IAS] Enforce .set nomacro.

Summary: When used, ".set nomacro" causes warning messages to be reported when we expand pseudo-instructions to multiple machine instructions.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 237366

9 years ago[Hexagon] Check for underflow/wrap in hardware loop pass
Brendon Cahoon [Thu, 14 May 2015 14:15:08 +0000 (14:15 +0000)]
[Hexagon] Check for underflow/wrap in hardware loop pass

If the loop trip count may underflow or wrap, the compiler should
not generate a hardware loop since the trip count will be
incorrect.

llvm-svn: 237365

9 years agoFactor out SmallDataThreshold
Ikhlas Ajbar [Thu, 14 May 2015 13:52:08 +0000 (13:52 +0000)]
Factor out SmallDataThreshold

This patch factors out SmallDataThreshold code.

llvm-svn: 237364

9 years ago[mips] [IAS] Emit .set macro/nomacro.
Toma Tabacu [Thu, 14 May 2015 13:42:10 +0000 (13:42 +0000)]
[mips] [IAS] Emit .set macro/nomacro.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 237363

9 years ago[mips] Do not place users of $ra in the delay slot of call instructions.
Vasileios Kalintiris [Thu, 14 May 2015 13:17:56 +0000 (13:17 +0000)]
[mips] Do not place users of $ra in the delay slot of call instructions.

Summary:
When we are trying to fill the delay slot of a call instruction, we must avoid
filler instructions that use the $ra register. This fixes the test
MultiSource/Applications/JM/lencod when we enable the forward delay slot filler.

Reviewers: dsanders

Subscribers: llvm-commits

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

llvm-svn: 237362

9 years agoRe-apply r237247 - [AArch64] Codegen VMAX/VMIN for safe math cases
Artyom Skrobov [Thu, 14 May 2015 12:59:46 +0000 (12:59 +0000)]
Re-apply r237247 - [AArch64] Codegen VMAX/VMIN for safe math cases

No longer breaks SPEC2000/2006

llvm-svn: 237361

9 years agoCross compiler build fix [Important] - from J.Peyton, initial version from C.Bergstrom.
Andrey Churbanov [Thu, 14 May 2015 12:54:08 +0000 (12:54 +0000)]
Cross compiler build fix [Important] - from J.Peyton, initial version from C.Bergstrom.

llvm-svn: 237360

9 years agoAttempt to fix MSVC bots
Adam Nemet [Thu, 14 May 2015 12:33:32 +0000 (12:33 +0000)]
Attempt to fix MSVC bots

llvm-svn: 237359

9 years agoNew Loop Distribution pass
Adam Nemet [Thu, 14 May 2015 12:05:18 +0000 (12:05 +0000)]
New Loop Distribution pass

Summary:
This implements the initial version as was proposed earlier this year
(http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-January/080462.html).
Since then Loop Access Analysis was split out from the Loop Vectorizer
and was made into a separate analysis pass.  Loop Distribution becomes
the second user of this analysis.

The pass is off by default and can be enabled
with -enable-loop-distribution.  There is currently no notion of
profitability; if there is a loop with dependence cycles, the pass will
try to split them off from other memory operations into a separate loop.

I decided to remove the control-dependence calculation from this first
version.  This and the issues with the PDT are actively discussed so it
probably makes sense to treat it separately.  Right now I just mark all
terminator instruction required which keeps identical CFGs for each
distributed loop.  This seems to be working pretty well for 456.hmmer
where even though there is an empty if-then block in the distributed
loop initially, it gets completely removed.

The pass keeps DominatorTree and LoopInfo updated.  I've tested this
with -loop-distribute-verify with the testsuite where we distribute ~90
loops.  SimplifyLoop is violated in some cases and I have a FIXME
covering this.

Reviewers: hfinkel, nadav, aschwaighofer

Reviewed By: aschwaighofer

Subscribers: llvm-commits

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

llvm-svn: 237358

9 years agoFixed some typos and broken links in source level debugging docs.
Michael Kuperstein [Thu, 14 May 2015 10:58:59 +0000 (10:58 +0000)]
Fixed some typos and broken links in source level debugging docs.

llvm-svn: 237357

9 years ago[mips] [IAS] Warn when LA is used with a 64-bit symbol.
Toma Tabacu [Thu, 14 May 2015 10:53:40 +0000 (10:53 +0000)]
[mips] [IAS] Warn when LA is used with a 64-bit symbol.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 237356

9 years ago[mips] [IAS] Give expandLoadAddressSym() more specific arguments. NFC.
Toma Tabacu [Thu, 14 May 2015 10:02:58 +0000 (10:02 +0000)]
[mips] [IAS] Give expandLoadAddressSym() more specific arguments. NFC.

Summary:
If we only pass the necessary operands, we don't have to determine the position of the symbol operand when entering expandLoadAddressSym().
This simplifies the expandLoadAddressSym() code.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 237355

9 years ago[AArch64] Slight naming changes and comments for AArch64NamedImmMapper
Vladimir Sukharev [Thu, 14 May 2015 09:50:14 +0000 (09:50 +0000)]
[AArch64] Slight naming changes and comments for AArch64NamedImmMapper

Reviewers: echristo

Subscribers: llvm-commits

Follow-up to: http://reviews.llvm.org/D8496#158595

Relates to: http://reviews.llvm.org/rL235089

llvm-svn: 237354

9 years agoAVX-512: Added i1 type handling for calling conventions.
Elena Demikhovsky [Thu, 14 May 2015 09:04:45 +0000 (09:04 +0000)]
AVX-512: Added i1 type handling for calling conventions.
i1 type is a legal type on AVX-512 and can be passed as parameter or return value.
i1 is promoted to i8 on return and to i32 for call arguments (i8 is also promoted to i32 here).
The result code is similar to the previous X86 targets, where i1 is allways promoted to i8.

llvm-svn: 237350

9 years ago[ARM] Add v8.1a architecture
Vladimir Sukharev [Thu, 14 May 2015 08:25:18 +0000 (08:25 +0000)]
[ARM] Add v8.1a architecture

Add support for ARMv8.1a architecture.

Briefly it is described on http://community.arm.com/groups/processors/blog/2014/12/02/the-armv8-a-architecture-and-its-ongoing-development

Reviewers:  jmolloy, rengolin

Subscribers: cfe-commits

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

llvm-svn: 237349

9 years ago[AArch64 ACLE] Allow to define poly64_t as 'unsigned long long' on LLP64 system.
Kevin Qin [Thu, 14 May 2015 08:18:05 +0000 (08:18 +0000)]
[AArch64 ACLE] Allow to define poly64_t as 'unsigned long long' on LLP64 system.

This fixes PR23414 as well.

llvm-svn: 237348

9 years agoclang/test/Frontend/dependency-gen-escaping.c: Appease win32 hosts. Investigating.
NAKAMURA Takumi [Thu, 14 May 2015 07:37:35 +0000 (07:37 +0000)]
clang/test/Frontend/dependency-gen-escaping.c: Appease win32 hosts. Investigating.

FIXME: Do we really emit single \ or escaped \\ along the context with -fms-compatibility -MG?
llvm-svn: 237347

9 years agoRevert r237339 as sanitizer-ppc64-linux1 does not like it.
Yaron Keren [Thu, 14 May 2015 06:53:31 +0000 (06:53 +0000)]
Revert r237339 as sanitizer-ppc64-linux1 does not like it.
Complains:

/home/buildbots/sanitizerslave1/sanitizer-ppc64-1/build/llvm/tools/clang/tools/c-index-test/c-index-test.c:829:30: error: format specifies type 'long' but the argument has type 'long long' [-Werror,-Wformat]
                     I, TAK, clang_Cursor_getTemplateArgumentValue(Cursor, I));
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I'm not sure now how this should be fixed. %lld is non-standard
and not accepted by mingw on Windows while PRId64 is bad for this bot.

Is long long longer than 64 bits here? if not, why is PRId64
incompatible with it? something seems wrong.

Probably all the datatypes should be replaced to unsigned or uint64_t
depending upin requirements instead of the non standard long long.

llvm-svn: 237346

9 years agoTableGen: Avoid undefined behaviour by doing this shift in int64
Justin Bogner [Thu, 14 May 2015 06:47:02 +0000 (06:47 +0000)]
TableGen: Avoid undefined behaviour by doing this shift in int64

Found by ubsan. This was taking a bool and left shifting by 32 - the
result is 64 bit, so we should really do the math in a type it fits
in.

llvm-svn: 237345

9 years ago[MS ABI] Add support for /Zc:sizedDealloc
David Majnemer [Thu, 14 May 2015 05:55:00 +0000 (05:55 +0000)]
[MS ABI] Add support for /Zc:sizedDealloc

llvm-svn: 237344

9 years ago[TableGen] Remove an unnecessary outer 'if' around 3 separate inner ifs. No functiona...
Craig Topper [Thu, 14 May 2015 05:54:02 +0000 (05:54 +0000)]
[TableGen] Remove an unnecessary outer 'if' around 3 separate inner ifs. No functional change intended.

The outer if had 3 separate conditions ORed together and then the inner ifs detected which of the three conditions it was by using only a portion of the specific condition. Just put the whole condition in each inner if and remove the outer if.

llvm-svn: 237343

9 years ago[TableGen] Simplify some code. NFC
Craig Topper [Thu, 14 May 2015 05:53:59 +0000 (05:53 +0000)]
[TableGen] Simplify some code. NFC

llvm-svn: 237342

9 years ago[TableGen] Remove ListInit::size() in favor of getSize() which does the same thing...
Craig Topper [Thu, 14 May 2015 05:53:56 +0000 (05:53 +0000)]
[TableGen] Remove ListInit::size() in favor of getSize() which does the same thing and is already used in most places. NFC.

llvm-svn: 237341

9 years ago[TableGen] Replace some calls to ListInit::getSize() with ListInit::empty() if it...
Craig Topper [Thu, 14 May 2015 05:53:53 +0000 (05:53 +0000)]
[TableGen] Replace some calls to ListInit::getSize() with ListInit::empty() if it was just comparing to 0. NFC.

llvm-svn: 237340

9 years agoReplace non-standard %lld printf usage with PRId64.
Yaron Keren [Thu, 14 May 2015 05:40:50 +0000 (05:40 +0000)]
Replace non-standard %lld printf usage with PRId64.

See also r180024.

llvm-svn: 237339

9 years agoFix buildbots
David Majnemer [Thu, 14 May 2015 05:24:59 +0000 (05:24 +0000)]
Fix buildbots

llvm-svn: 237338

9 years ago[MS ABI] __declspec(thread) behaves like thread_local in MSVC 2015
David Majnemer [Thu, 14 May 2015 05:19:23 +0000 (05:19 +0000)]
[MS ABI] __declspec(thread) behaves like thread_local in MSVC 2015

MSVC 2015 changed __declspec(thread) to make it behave like C++11's
thread_local keyword instead of acting similarly to __thread.

llvm-svn: 237337

9 years ago[AST] hasAttr followed by getAttr isn't efficient
David Majnemer [Thu, 14 May 2015 05:19:20 +0000 (05:19 +0000)]
[AST] hasAttr followed by getAttr isn't efficient

Just use getAttr because we are interested in the attribute's contents.

llvm-svn: 237336

9 years ago[clang-cl] Add /Qvec and /Qvec- to control vectorization
David Majnemer [Thu, 14 May 2015 05:19:17 +0000 (05:19 +0000)]
[clang-cl] Add /Qvec and /Qvec- to control vectorization

llvm-svn: 237335

9 years agocmake: Use -fno-sanitize-recover=all - the old spelling is deprecated
Justin Bogner [Thu, 14 May 2015 04:52:57 +0000 (04:52 +0000)]
cmake: Use -fno-sanitize-recover=all - the old spelling is deprecated

llvm-svn: 237334

9 years agoclang/test/Frontend/dependency-gen-escaping.c: Tweak r237296, to let '/' and '\\...
NAKAMURA Takumi [Thu, 14 May 2015 04:25:54 +0000 (04:25 +0000)]
clang/test/Frontend/dependency-gen-escaping.c: Tweak r237296, to let '/' and '\\' distinguishd, to unbreak "--host=linux --target=msvc".

llvm-svn: 237333

9 years agoGeneralize future keyword compat diagnostics.
Richard Smith [Thu, 14 May 2015 04:00:59 +0000 (04:00 +0000)]
Generalize future keyword compat diagnostics.

This, in preparation for the introduction of more new keywords in the
implementation of the C++ language, generalizes the support for future keyword
compat diagnostics (e.g., diag::warn_cxx11_keyword) by extending the
applicability of the relevant property in IdentifierTable with appropriate
renaming.

Patch by Hubert Tong!

llvm-svn: 237332

9 years ago[modules] Rearrange preprocessor module visibility handling, no observable change...
Richard Smith [Thu, 14 May 2015 02:25:44 +0000 (02:25 +0000)]
[modules] Rearrange preprocessor module visibility handling, no observable change intended.

llvm-svn: 237331

9 years ago[Builtins] Wire half-precision conversions through cc_kext makefiles.
Ahmed Bougacha [Thu, 14 May 2015 02:21:02 +0000 (02:21 +0000)]
[Builtins] Wire half-precision conversions through cc_kext makefiles.

Kernel side of r237329.

llvm-svn: 237330

9 years ago[Builtins] Wire half-precision conversions through Darwin makefiles.
Ahmed Bougacha [Thu, 14 May 2015 01:47:32 +0000 (01:47 +0000)]
[Builtins] Wire half-precision conversions through Darwin makefiles.

Follow-up to r237161, modeled after r236805.

Note that arm64 is omitted on purpose, as the conversions are supported
natively there.

llvm-svn: 237329

9 years ago[TestAttachDenied] Use a file instead of a pipe for synchronization.
Siva Chandra [Thu, 14 May 2015 01:36:47 +0000 (01:36 +0000)]
[TestAttachDenied] Use a file instead of a pipe for synchronization.

Summary:
One cannot use mknod or mkfifo on user Android devices. This commit
changes the use of pipe to a file to synchronize between the inferior
and the test.

Test Plan: dotest.py -P TestAttachDenied

Reviewers: ovyalov, chaoren

Reviewed By: chaoren

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 237328

9 years agoDon't omit the constant when computing a cross-section relative relocation.
Andy Ayers [Thu, 14 May 2015 01:10:41 +0000 (01:10 +0000)]
Don't omit the constant when computing a cross-section relative relocation.

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

llvm-svn: 237327

9 years agoAdd missing #include, found by modules build.
Richard Smith [Thu, 14 May 2015 01:08:58 +0000 (01:08 +0000)]
Add missing #include, found by modules build.

llvm-svn: 237326

9 years ago[modules] Work around PR23521 to fix -O0 modules bootstrap.
Richard Smith [Thu, 14 May 2015 01:08:08 +0000 (01:08 +0000)]
[modules] Work around PR23521 to fix -O0 modules bootstrap.

llvm-svn: 237325

9 years ago[CodeGen] Use standard -not gnueabi- naming for f16 libcalls on Darwin.
Ahmed Bougacha [Thu, 14 May 2015 01:00:51 +0000 (01:00 +0000)]
[CodeGen] Use standard -not gnueabi- naming for f16 libcalls on Darwin.

Other targets probably should as well.  Since r237161, compiler-rt has
both, but I don't see why anything other than gnueabi would use a
gnueabi naming scheme.

llvm-svn: 237324

9 years ago[Builtins] Implement f2h/h2f by jumping to trunc/extend.
Ahmed Bougacha [Thu, 14 May 2015 00:50:28 +0000 (00:50 +0000)]
[Builtins] Implement f2h/h2f by jumping to trunc/extend.

Follow-up to r237161; seems like we can't use aliases, but we
can do better than duplicating the bodies, especially when that
body, after inlining, isn't as small as it looks.

Better approaches welcome.  Perhaps the best thing is just to have
an #ifndef __APPLE__ over the GNUEABI names, since they're not used
there.

llvm-svn: 237323

9 years agoImplement an objc tagged-pointer info command that will provide information about...
Enrico Granata [Thu, 14 May 2015 00:46:47 +0000 (00:46 +0000)]
Implement an objc tagged-pointer info command that will provide information about what LLDB thinks an ObjC tagged pointer represents

llvm-svn: 237322

9 years ago[modules] Fix a #include cycle when building a module for our builtin headers.
Richard Smith [Thu, 14 May 2015 00:45:20 +0000 (00:45 +0000)]
[modules] Fix a #include cycle when building a module for our builtin headers.

xmmintrin.h includes emmintrin.h and vice versa if SSE2 is enabled. We break
this cycle for a modules build, and instead make the xmmintrin.h module
re-export the immintrin.h module. Also included is a fix for an assert in the
serialization code if a module exports another module that was declared later
in the same module map.

llvm-svn: 237321

9 years agoFix a #include cycle in the libclang headers. "Eventually" is now.
Richard Smith [Thu, 14 May 2015 00:22:12 +0000 (00:22 +0000)]
Fix a #include cycle in the libclang headers. "Eventually" is now.

llvm-svn: 237320

9 years agoAdded XTIMEOUT for TestAttachDenied.py
Vince Harron [Wed, 13 May 2015 23:59:03 +0000 (23:59 +0000)]
Added XTIMEOUT for TestAttachDenied.py

llvm-svn: 237319

9 years agoRevert r237046. See the testcase on the thread where r237046 was committed.
Nick Lewycky [Wed, 13 May 2015 23:41:47 +0000 (23:41 +0000)]
Revert r237046. See the testcase on the thread where r237046 was committed.

llvm-svn: 237317

9 years agoAdd mips64el trap opcode to PlatformFreeBSD as well
Ed Maste [Wed, 13 May 2015 23:12:51 +0000 (23:12 +0000)]
Add mips64el trap opcode to PlatformFreeBSD as well

llvm-svn: 237315

9 years agoYAML: Implement block scalar parsing.
Alex Lorenz [Wed, 13 May 2015 23:10:51 +0000 (23:10 +0000)]
YAML: Implement block scalar parsing.

This commit implements the parsing of YAML block scalars.
Some code existed for it before, but it couldn't parse block
scalars.

This commit adds a new yaml node type to represent the block
scalar values.

This commit also deletes the 'spec-09-27' and 'spec-09-28' tests
as they are identical to the test file 'spec-09-26'.

This commit introduces 3 new utility functions to the YAML scanner
class: `skip_s_space`, `advanceWhile` and `consumeLineBreakIfPresent`.

Reviewers: Duncan P. N. Exon Smith

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

llvm-svn: 237314

9 years agoRestore breaks lost in shuffling GetSoftwareBreakpointTrapOpcode
Ed Maste [Wed, 13 May 2015 23:09:43 +0000 (23:09 +0000)]
Restore breaks lost in shuffling GetSoftwareBreakpointTrapOpcode

llvm-svn: 237313

9 years ago[opaque pointer type] Use the value type of the GlobalVariable rather than accessing...
David Blaikie [Wed, 13 May 2015 22:55:01 +0000 (22:55 +0000)]
[opaque pointer type] Use the value type of the GlobalVariable rather than accessing it through the pointee's type

llvm-svn: 237312

9 years ago[opaque pointer type] Use GlobalVariable::getValueType rather than accessing it throu...
David Blaikie [Wed, 13 May 2015 22:54:54 +0000 (22:54 +0000)]
[opaque pointer type] Use GlobalVariable::getValueType rather than accessing it through the GV's pointee type

llvm-svn: 237311

9 years ago[X86] Fix PR23271 - RIP-relative decoding bug in disassembler.
Douglas Katzman [Wed, 13 May 2015 22:44:52 +0000 (22:44 +0000)]
[X86] Fix PR23271 - RIP-relative decoding bug in disassembler.

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

llvm-svn: 237310

9 years agoConstruct ArrayRef<const T*> from vector<T>
Pete Cooper [Wed, 13 May 2015 22:43:09 +0000 (22:43 +0000)]
Construct ArrayRef<const T*> from vector<T>

ArrayRef already has a SFINAE constructor which can construct ArrayRef<const T*> from ArrayRef<T*>.

This adds methods to do the same directly from SmallVector and std::vector.  This avoids an intermediate step through the use of makeArrayRef.

Also update the users of this in LICM and SROA to remove the now unnecessary makeArrayRef call.

Reviewed by David Blaikie.

llvm-svn: 237309

9 years ago[lib/Fuzzer] update docs about test corpuses in git
Kostya Serebryany [Wed, 13 May 2015 22:42:28 +0000 (22:42 +0000)]
[lib/Fuzzer] update docs about test corpuses in git

llvm-svn: 237308

9 years agoInstrProf: Fix display of large numbers in llvm-cov
Justin Bogner [Wed, 13 May 2015 22:41:48 +0000 (22:41 +0000)]
InstrProf: Fix display of large numbers in llvm-cov

llvm-cov was truncating numbers that were larger than a particular
fixed width, which is as confusing as it is useless. Instead, we use
engineering notation with SI prefix for magnitude.

llvm-svn: 237307

9 years agoAdd AArch64 and MIPS breakpoint opcodes and sort cases
Ed Maste [Wed, 13 May 2015 22:40:01 +0000 (22:40 +0000)]
Add AArch64 and MIPS breakpoint opcodes and sort cases

New opcodes from PlatformLinux.cpp

llvm-svn: 237306

9 years agoBreak \# in a depfile the same way as gcc.
Paul Robinson [Wed, 13 May 2015 22:33:50 +0000 (22:33 +0000)]
Break \# in a depfile the same way as gcc.

Backslash followed by # in a filename should have both characters
escaped, if you do it the way GNU Make wants.  GCC doesn't, so we do
it the way GCC does rather than the way GNU Make wants.

llvm-svn: 237304

9 years agoInitial FreeBSD/arm live debugging support
Ed Maste [Wed, 13 May 2015 22:33:12 +0000 (22:33 +0000)]
Initial FreeBSD/arm live debugging support

Patch by Tom Rix, except using the RegisterContextFreeBSD_arm files
added in r235305 instead.

llvm-svn: 237303

9 years agoRearrange PlatformFreeBSD to match PlatformLinux
Ed Maste [Wed, 13 May 2015 22:26:24 +0000 (22:26 +0000)]
Rearrange PlatformFreeBSD to match PlatformLinux

No functional change, but this simplifies diffs of the two.

llvm-svn: 237302

9 years agoAdd llvm::all_of which wraps std::all_of.
Pete Cooper [Wed, 13 May 2015 22:19:13 +0000 (22:19 +0000)]
Add llvm::all_of which wraps std::all_of.

This version doesn't need begin/end but can instead just take a type which has begin/end methods.

Use this to replace an eligible foreach loop in LoopInfo found by David Blaikie in r237224.

Reviewed by David Blaikie.

llvm-svn: 237301

9 years agoFix typo on Instruction::insert{After,Before}(). NFC
Jonathan Roelofs [Wed, 13 May 2015 22:14:43 +0000 (22:14 +0000)]
Fix typo on Instruction::insert{After,Before}(). NFC

llvm-svn: 237300

9 years agoMake GNUInline consistent with whether we use traditional GNU inline semantics.
Peter Collingbourne [Wed, 13 May 2015 22:07:22 +0000 (22:07 +0000)]
Make GNUInline consistent with whether we use traditional GNU inline semantics.

Previously we were setting LangOptions::GNUInline (which controls whether we
use traditional GNU inline semantics) if the language did not have the C99
feature flag set. The trouble with this is that C++ family languages also
do not have that flag set, so we ended up setting this flag in C++ modes
(and working around it in a few places downstream by also checking CPlusPlus).

The fix is to check whether the C89 flag is set for the target language,
rather than whether the C99 flag is cleared. This also lets us remove most
CPlusPlus checks. We continue to test CPlusPlus when deciding whether to
pre-define the __GNUC_GNU_INLINE__ macro for consistency with GCC.

There is a change in semantics in two other places
where we weren't checking both CPlusPlus and GNUInline
(FunctionDecl::doesDeclarationForceExternallyVisibleDefinition and
FunctionDecl::isInlineDefinitionExternallyVisible), but this change seems to
put us back into line with GCC's semantics (test case: test/CodeGen/inline.c).

While at it, forbid -fgnu89-inline in C++ modes, as GCC doesn't support it,
it didn't have any effect before, and supporting it just makes things more
complicated.

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

llvm-svn: 237299

9 years agoInstrProf: Treat functions with a coverage map but no profile as unreached
Justin Bogner [Wed, 13 May 2015 22:03:04 +0000 (22:03 +0000)]
InstrProf: Treat functions with a coverage map but no profile as unreached

If we have a coverage mapping but no profile data for a function,
calling it mismatched is misleading. This can just as easily be
unreachable code that was stripped from the binary. Instead, treat
these the same as functions where we have an explicit "zero" coverage
map by setting the count to zero for each mapped region.

llvm-svn: 237298

9 years agoMC: clang-format MCSymbol.h, NFC
Duncan P. N. Exon Smith [Wed, 13 May 2015 21:41:14 +0000 (21:41 +0000)]
MC: clang-format MCSymbol.h, NFC

llvm-svn: 237297

9 years agoFix dependency file escaping.
Paul Robinson [Wed, 13 May 2015 21:18:15 +0000 (21:18 +0000)]
Fix dependency file escaping.

When writing a dependency (.d) file, if space or # is immediately
preceded by one or more backslashes, escape the backslashes as well as
the space or # character. Otherwise leave backslash alone.
This straddles the fence between BSD Make (which does no escaping at
all, and does not support space or # in filespecs) and GNU Make (which
does support escaping, but will fall back to the filespec as-written
if the escaping doesn't match an existing file).

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

llvm-svn: 237296

9 years agoARM: remove possible vestiges of the legacy JIT???
Tim Northover [Wed, 13 May 2015 20:28:41 +0000 (20:28 +0000)]
ARM: remove possible vestiges of the legacy JIT???

There's no need to manually pass modifier strings around to tell an operand how
to print now, that information is encoded in the operand itself since the MC
layer came along.

llvm-svn: 237295

9 years agoARM: remove custom jump table UID
Tim Northover [Wed, 13 May 2015 20:28:38 +0000 (20:28 +0000)]
ARM: remove custom jump table UID

We were creating and propagating two separate indices for each jump table (from
back in the mists of time). However, the generic index used by other backends
is sufficient to emit a unique symbol so this was unneeded.

llvm-svn: 237294

9 years agoARM: refactor optimizeThumb2JumpTables.
Tim Northover [Wed, 13 May 2015 20:28:32 +0000 (20:28 +0000)]
ARM: refactor optimizeThumb2JumpTables.

The previous logic mixed 2 separate questions:
  + Can we form a TBB/TBH instruction?
  + Can we remove the jump-table calculation before it?

It then performed a bunch of random tests on the instructions earlier in the
basic block, which were probably sufficient to answer 2 but only because of the
very limited ways in which a t2BR_JT can actually be created.

For example there's no reason to expect the LeaInst to define the same base
register as the following indexing calulation. In practice this means we might
have missed opportunities to form TBB/TBH, in theory you could end up
misidentifying a sequence and removing the wrong LEA:

     %R1 = t2LEApcrelJT ...
     %R2 = t2LEApcrelJT ...
     <... using and killing %R2 ...>
     %R2 = t2ADDr %R1, $Ridx

Before we would have looked for an LEA defining %R2 and found the wrong one. We
just got lucky that jump table setup was (almost?) always confined to a single
basic block and there was only one jump table per block.

llvm-svn: 237293

9 years agoDon't import lock on Windows.
Zachary Turner [Wed, 13 May 2015 20:21:33 +0000 (20:21 +0000)]
Don't import lock on Windows.

lock imports fcntl, which doesn't exist on Windows.  If we need
to use this class on Windows, we will need to implement something
based on the CreateMutex API.

llvm-svn: 237292

9 years agoFix broken test, this wasn't supposed to get committed.
Zachary Turner [Wed, 13 May 2015 20:21:22 +0000 (20:21 +0000)]
Fix broken test, this wasn't supposed to get committed.

llvm-svn: 237291

9 years ago[Statepoints][Docs] Fix a couple of out of date examples.
Sanjoy Das [Wed, 13 May 2015 20:20:10 +0000 (20:20 +0000)]
[Statepoints][Docs] Fix a couple of out of date examples.

Things I had missed in r237285.

llvm-svn: 237290

9 years ago[Statepoints][Docs] Fix typo: change a period to a comma.
Sanjoy Das [Wed, 13 May 2015 20:19:51 +0000 (20:19 +0000)]
[Statepoints][Docs] Fix typo: change a period to a comma.

llvm-svn: 237289

9 years agoSelect expected remote libc++ library name based on remote platform.
Robert Flack [Wed, 13 May 2015 20:17:34 +0000 (20:17 +0000)]
Select expected remote libc++ library name based on remote platform.

Select expected remote libc++ library name based on remote platform. This is
used to verify libc++ is in the loaded image list by various tests which use it.

Test Plan:
Passes the following tests mac -> linux with this patch:
TestDataFormatterLibccIterator.py
TestDataFormatterLibccMap.py
TestDataFormatterLibccMultiMap.py
TestDataFormatterLibcxxMultiSet.py
TestDataFormatterLibcxxSet.py
TestDataFormatterUnordered.py

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

llvm-svn: 237288

9 years ago[Safepoints][Verifier] Fix a tautological Assert.
Sanjoy Das [Wed, 13 May 2015 20:11:59 +0000 (20:11 +0000)]
[Safepoints][Verifier] Fix a tautological Assert.

llvm-svn: 237287

9 years ago[PlaceSafepoints] New attributes for patchable statepoints.
Sanjoy Das [Wed, 13 May 2015 20:11:31 +0000 (20:11 +0000)]
[PlaceSafepoints] New attributes for patchable statepoints.

Summary:
This patch teaches the PlaceSafepoints pass about two `CallSite`
function attributes:

 * "statepoint-id": if the string value of this attribute can be parsed
   as an integer, then it is propagated to the ID parameter of the
   statepoint created.

 * "statepoint-num-patch-bytes": if the string value of this attribute
   can be parsed as an integer, then it is propagated to the `num patch
   bytes` parameter of the statepoint created.

This change intentionally does not assert on a malformed value for these
attributes, given that they're not "official" attributes.

Reviewers: reames, pgavlin

Subscribers: llvm-commits

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

llvm-svn: 237286

9 years ago[PlaceSafepoints] Update docs for r237214.
Sanjoy Das [Wed, 13 May 2015 20:11:24 +0000 (20:11 +0000)]
[PlaceSafepoints] Update docs for r237214.

Show the two new ID and NumPatchBytes fields in the PlaceSafepoint
examples in Statepoints.rst to avoid confusion.

llvm-svn: 237285

9 years ago[LoopIdiomRecognize] Use auto + range-based loop. NFC intended.
Davide Italiano [Wed, 13 May 2015 19:51:21 +0000 (19:51 +0000)]
[LoopIdiomRecognize] Use auto + range-based loop. NFC intended.

llvm-svn: 237284

9 years agoFix line endings.
Zachary Turner [Wed, 13 May 2015 19:45:06 +0000 (19:45 +0000)]
Fix line endings.

I must have committed these with windows line endings a few months
ago when I did this work.

llvm-svn: 237283

9 years agoFix an issue with finding python on Windows.
Zachary Turner [Wed, 13 May 2015 19:44:57 +0000 (19:44 +0000)]
Fix an issue with finding python on Windows.

Someone must have changed the behavior of FileSpec slightly
relating to whether or not there is a trailing backslash when calling
GetPath() and GetDirectory().  This caused ScriptInterpreterPython
to find the wrong values when initializing sys.path, and as a result
we couldn't find the lldb module.

This patch fixes the issue, and also adds a test to make sure that
GetDirectory() does not return a string containing a trailing slash.

llvm-svn: 237282

9 years agoRemove DoAttachToProcessWithId(lldb::pid_t).
Zachary Turner [Wed, 13 May 2015 19:44:44 +0000 (19:44 +0000)]
Remove DoAttachToProcessWithId(lldb::pid_t).

There were two versions of DoAttachToprocessWithId.  One that takes
a pid_t, and the other which takes a pid_t and a ProcessAttachInfo.
There were no callers of the former version, and all of the
implementations of this version were simply forwarding calls to
one version or the other.

llvm-svn: 237281

9 years agoHave Platform::KillProcess try to use the process plugin first.
Zachary Turner [Wed, 13 May 2015 19:44:24 +0000 (19:44 +0000)]
Have Platform::KillProcess try to use the process plugin first.

llvm-svn: 237280

9 years agoAdd a comment clarifying what func_name_type_mask is.
Jim Ingham [Wed, 13 May 2015 19:01:15 +0000 (19:01 +0000)]
Add a comment clarifying what func_name_type_mask is.

llvm-svn: 237279

9 years agoChange Linux Platform to support non-host Linux architectures
Ted Woodward [Wed, 13 May 2015 18:52:56 +0000 (18:52 +0000)]
Change Linux Platform to support non-host Linux architectures

Summary:
This was originally http://reviews.llvm.org/D8709 , but I didn't commit it correctly.

Since then GetSupportedArchitectureAtIndex() has been changed. That change, http://reviews.llvm.org/D9511 , breaks non-x86 linux implementations, so this change goes back to the old implementation and adds remote linux support from D8709.

D8709 summary:

The Linux Platform currently will only say the Host architecture is supported. This patch retains that behavior for the Host Platform, but adds a list of architectures for the Remote Platform.

Reviewers: clayborg, flackr

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 237278

9 years ago[llvm-bcanalyzer] Add -show-binary-blobs option.
Jordan Rose [Wed, 13 May 2015 18:51:49 +0000 (18:51 +0000)]
[llvm-bcanalyzer] Add -show-binary-blobs option.

-dump mode normally omits blob data that contains unprintable characters.
When -show-binary-blobs is passed, it unilaterally escapes all blobs,
allowing those with binary data to be displayed.

llvm-svn: 237276

9 years agoMC: Modernize MCOperand API naming. NFC.
Jim Grosbach [Wed, 13 May 2015 18:37:00 +0000 (18:37 +0000)]
MC: Modernize MCOperand API naming. NFC.

MCOperand::Create*() methods renamed to MCOperand::create*().

llvm-svn: 237275

9 years ago[opaque pointer type] Constant Folding: Use GEPOperator to access the pointee source...
David Blaikie [Wed, 13 May 2015 18:35:29 +0000 (18:35 +0000)]
[opaque pointer type] Constant Folding: Use GEPOperator to access the pointee source type rather than going through the first operand's pointer type

llvm-svn: 237274

9 years ago[opaque pointer type] Pass the explicit function type down to the instruction constru...
David Blaikie [Wed, 13 May 2015 18:35:26 +0000 (18:35 +0000)]
[opaque pointer type] Pass the explicit function type down to the instruction constructor when parsing invoke instructions

llvm-svn: 237273

9 years ago[lib/Fuzzer] enable -use_counters=1 by default
Kostya Serebryany [Wed, 13 May 2015 18:31:46 +0000 (18:31 +0000)]
[lib/Fuzzer] enable -use_counters=1 by default

llvm-svn: 237272