platform/upstream/llvm.git
9 years ago[X86] Lower VSELECT into SHRUNKBLEND when we shrink the bits used into the
Quentin Colombet [Thu, 6 Nov 2014 02:25:03 +0000 (02:25 +0000)]
[X86] Lower VSELECT into SHRUNKBLEND when we shrink the bits used into the
condition to match a blend.
This prevents optimizations that work on VSELECT to perform invalid
transformations. Indeed, the optimized condition does not match the vector
boolean content that is expected and bad things may happen.

This patch yields the exact same code on the whole test-suite + specs (-O3 and
-O3 -march=core-avx2), it improves one test case (vector-blend.ll) and fixes a
bug reduced in vselect-avx.ll.

<rdar://problem/18819506>

llvm-svn: 221429

9 years ago[ELF] Use llvm::Twine
Shankar Easwaran [Thu, 6 Nov 2014 02:03:40 +0000 (02:03 +0000)]
[ELF] Use llvm::Twine

llvm-svn: 221428

9 years ago[ELF] Implement isLittleEndian for all architectures
Shankar Easwaran [Thu, 6 Nov 2014 02:03:38 +0000 (02:03 +0000)]
[ELF] Implement isLittleEndian for all architectures

llvm-svn: 221427

9 years ago[ELF] Use std::find_if instead
Shankar Easwaran [Thu, 6 Nov 2014 02:03:35 +0000 (02:03 +0000)]
[ELF] Use std::find_if instead

llvm-svn: 221426

9 years ago[mach-o] remove extra leading underscore on __bss and __got
Nick Kledzik [Thu, 6 Nov 2014 01:14:12 +0000 (01:14 +0000)]
[mach-o] remove extra leading underscore on __bss and __got

llvm-svn: 221425

9 years ago[mach-o] Add support for interposing tuples section
Nick Kledzik [Thu, 6 Nov 2014 01:14:09 +0000 (01:14 +0000)]
[mach-o] Add support for interposing tuples section

Darwin uses two-level-namespace lookup for symbols which means the static
linker records where each symbol must be found at runtime.  Thus defining a
symbol in a dylib loaded earlier will not effect where symbols needed by
later dylibs will be found.  Instead overriding is done through a section
of type S_INTERPOSING which contains tuples of <interposer, interposee>.

llvm-svn: 221424

9 years ago[PECOFF] Add a comment for SECREL relocation.
Rui Ueyama [Thu, 6 Nov 2014 01:14:02 +0000 (01:14 +0000)]
[PECOFF] Add a comment for SECREL relocation.

llvm-svn: 221423

9 years agoRemove unnecessary .c_str() when implicitly converting to Twine
Matt Arsenault [Thu, 6 Nov 2014 01:13:27 +0000 (01:13 +0000)]
Remove unnecessary .c_str() when implicitly converting to Twine

llvm-svn: 221422

9 years ago[mach-o] Add support for interposing tuples section
Nick Kledzik [Thu, 6 Nov 2014 01:09:13 +0000 (01:09 +0000)]
[mach-o] Add support for interposing tuples section

Darwin uses two-level-namespace lookup for symbols which means the static
linker records where each symbol must be found at runtime.  Thus defining a
symbol in a dylib loaded earlier will not effect where symbols needed by
later dylibs will be found.  Instead overriding is done through a section
of type S_INTERPOSING which contains tuples of <interposer, interposee>.

llvm-svn: 221421

9 years ago[PECOFF] Fix SECREL relocations.
Rui Ueyama [Thu, 6 Nov 2014 01:03:23 +0000 (01:03 +0000)]
[PECOFF] Fix SECREL relocations.

SECREL relocation's value is the offset to the beginning of the section.
Because of the off-by-one error, if a SECREL relocation target is at the
beginning of a section, it got wrong value.

Added a test that would have caught this.

llvm-svn: 221420

9 years ago[Docs][JIT] Update the clang++ invocation lines in the kaleidoscope docs.
Lang Hames [Thu, 6 Nov 2014 00:31:04 +0000 (00:31 +0000)]
[Docs][JIT] Update the clang++ invocation lines in the kaleidoscope docs.

The old examples had missing/incorrect flags that were causing failures on newer
versions of clang and the tutorial code.

llvm-svn: 221419

9 years agoExtract SCEV generation into subfunction
Tobias Grosser [Thu, 6 Nov 2014 00:27:01 +0000 (00:27 +0000)]
Extract SCEV generation into subfunction

This makes the code more readable and will be reused in subsequent OpenMP
patches.

llvm-svn: 221418

9 years agoPatch for small addition to availability attribute.
Fariborz Jahanian [Wed, 5 Nov 2014 23:58:55 +0000 (23:58 +0000)]
Patch for small addition to availability attribute.
This is to accept "NA" in place of vesion number for availability
attribute. Used on introduced=NA to mean unavailable
and deprecated=NA to mean nothing (not deprecated).
rdar://18804883

llvm-svn: 221417

9 years agoFixed the C++ method name class to be a bit more picky about what it identifies as...
Greg Clayton [Wed, 5 Nov 2014 23:56:37 +0000 (23:56 +0000)]
Fixed the C++ method name class to be a bit more picky about what it identifies as a C++ method.

This was done by using regular expressions on any basename we find to ensure it is valid.

This fixed setting breakpoints by name with values like '[J]com.robovm.debug.server.apps.SleepLoop.startingUp()V'. This was previously triggering the C++ method name class to identify the string as C++ with a basename of '[J]com.robovm.debug.server.apps.SleepLoop.startingUp' which was obviously incorrect.

The changes also fixed errors in templated function names like "void foo<int>(...)" where "void foo<int>" was being identified incorrectly as the basename. We also handle more C++ operators correctly now.

llvm-svn: 221416

9 years agocmake: Only export targets in the standalone build
Reid Kleckner [Wed, 5 Nov 2014 23:51:45 +0000 (23:51 +0000)]
cmake: Only export targets in the standalone build

Trying to fix bots that didn't like the fact that I exported targets
that depended on LLVM without exporting targets from LLVM.

llvm-svn: 221415

9 years agoFix shadowed variable warning
Nick Kledzik [Wed, 5 Nov 2014 23:40:04 +0000 (23:40 +0000)]
Fix shadowed variable warning

llvm-svn: 221414

9 years agocmake: Make the LLDB standalone build work for me
Reid Kleckner [Wed, 5 Nov 2014 23:23:18 +0000 (23:23 +0000)]
cmake: Make the LLDB standalone build work for me

This allows me to generate a Visual Studio solution that builds LLDB if
you have standalone builds of LLVM and Clang lying around.
Unfortunately, you have to pass *four* CMake variables in, but it means
you don't have to take the extra step of installing Clang and LLVM to
some package prefix.

Hopefully this will generate a more usable XCode project too.

llvm-svn: 221413

9 years agoMachO: Remove an unused variable from processSection
David Majnemer [Wed, 5 Nov 2014 23:22:41 +0000 (23:22 +0000)]
MachO: Remove an unused variable from processSection

The local variable `cfi` became dead in r220730 when it's use was
obviated; it was replaced with a call to read32.

No functionality change intended.

llvm-svn: 221412

9 years agoMake it easier to build against a pre-built Clang package with CMake
Reid Kleckner [Wed, 5 Nov 2014 23:14:59 +0000 (23:14 +0000)]
Make it easier to build against a pre-built Clang package with CMake

Installing <prefix>/share/clang/cmake/ClangConfig.cmake makes CMake's
builtin find_package() utility work with Clang. This also allows
downstream consumers of Clang to statically link against libraries like
clangAST and have that pull in dependencies like clangBasic and
LLVMSupport.

See the CMake docs on packages:
http://www.cmake.org/cmake/help/v3.0/manual/cmake-packages.7.html

llvm-svn: 221411

9 years agoThread Safety Analysis: move warnings on range-based for loops out of beta
DeLesley Hutchins [Wed, 5 Nov 2014 23:09:28 +0000 (23:09 +0000)]
Thread Safety Analysis: move warnings on range-based for loops out of beta
and into -Wthread-safety.

llvm-svn: 221410

9 years ago[Sanitizer] Introduce generic stack frame rendering machinery
Alexey Samsonov [Wed, 5 Nov 2014 22:44:36 +0000 (22:44 +0000)]
[Sanitizer] Introduce generic stack frame rendering machinery

Summary:
This commit introduces function __sanitizer::RenderFrame()
that allows to render the contents of AddressInfo (essentially, symbolized stack frame)
using the custom format string. This function can be used to
implement stack frame formatting for both ThreadSanitizer and
generic StackTrace::Print(), used in another places. This paves the
way towards allowing user to control the format of stack frames,
obtaining them in any format he desires, and/or enforcing the consistent
output from all sanitizers.

Test Plan: compiler-rt test suite

Reviewers: kcc

Reviewed By: kcc

Subscribers: llvm-commits

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

llvm-svn: 221409

9 years ago[mips64] Fix MIPS64 exception personality encoding
Petar Jovanovic [Wed, 5 Nov 2014 22:42:31 +0000 (22:42 +0000)]
[mips64] Fix MIPS64 exception personality encoding

Remove dynamic relocations of __gxx_personality_v0 from the .eh_frame.
The MIPS64 follow-up of the MIPS32 fix (rL209907).

Patch by Vladimir Stefanovic.

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

llvm-svn: 221408

9 years ago[X86][SSE] Vector integer to float conversion memory folding
Simon Pilgrim [Wed, 5 Nov 2014 22:28:25 +0000 (22:28 +0000)]
[X86][SSE] Vector integer to float conversion memory folding

Added missing memory folding for the (V)CVTDQ2PS instructions - we can safely fold these (but not the (V)CVTDQ2PD versions which have a register/memory size discrepancy in the source operand). I've added a test case demonstrating that stack folding now works.

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

llvm-svn: 221407

9 years ago[docs] Document usage of Inputs/ for extra test files.
Sean Silva [Wed, 5 Nov 2014 22:17:18 +0000 (22:17 +0000)]
[docs] Document usage of Inputs/ for extra test files.

llvm-svn: 221406

9 years agoDecouple ProcessWindows from the Windows debug driver thread.
Zachary Turner [Wed, 5 Nov 2014 22:16:28 +0000 (22:16 +0000)]
Decouple ProcessWindows from the Windows debug driver thread.

In the llgs world, ProcessWindows will eventually go away and
we'll implement a different protocol.  This patch decouples
ProcessWindows from the core debug loop so that this transition
will not be more difficult than it needs to be.

llvm-svn: 221405

9 years agoThis patch fixes a crash after rebuilding call AST of
Fariborz Jahanian [Wed, 5 Nov 2014 21:50:22 +0000 (21:50 +0000)]
This patch fixes a crash after rebuilding call AST of
an __unknown_anytype(...). In this case, we rebuild the
vararg function type specially to convert the call expression
to  something that IRGen can handle. However, FunctionDecl
as rebuilt in RebuildUnknownAnyExpr::resolveDecl is bogus and
results in crash when accessing its params later on. This
patch fixes the crash by rebuilding the FunctionDecl to match
its new resolved type. rdar://15297105.
John McCall, please review post-commit.

llvm-svn: 221404

9 years ago[Linker] Add some test coverage for llvm.ident merging
Sean Silva [Wed, 5 Nov 2014 21:33:34 +0000 (21:33 +0000)]
[Linker] Add some test coverage for llvm.ident merging

llvm-svn: 221403

9 years agoAllow inline test case to register actually useful teardown hooks by allowing a hook...
Enrico Granata [Wed, 5 Nov 2014 21:31:57 +0000 (21:31 +0000)]
Allow inline test case to register actually useful teardown hooks by allowing a hook to be passed back the test instance, were it not to be already bound to self. Use this ability to make the reversal of escape-non-printables a teardown hook for added reliability of the testing logic

llvm-svn: 221402

9 years agoFix heap-use-after-free bug in expandSDiv when the operands are
Michael Ilseman [Wed, 5 Nov 2014 21:28:24 +0000 (21:28 +0000)]
Fix heap-use-after-free bug in expandSDiv when the operands are
constants, as discovered by ASAN.

Patch by Mehdi Amini!

llvm-svn: 221401

9 years agoFixed the Objective-C stripped ivar test to ensure
Sean Callanan [Wed, 5 Nov 2014 21:24:27 +0000 (21:24 +0000)]
Fixed the Objective-C stripped ivar test to ensure
that we load debug information properly.  If we don't
explicitly add-dsym, sometimes Spotlight will help out
and tell us about the dSYM but we shouldn't be relying
on that.  Thanks to Jim for catching this.

<rdar://problem/16424661>

llvm-svn: 221400

9 years agoAdd a setting escape-non-printables that drives whether the StringPrinter should...
Enrico Granata [Wed, 5 Nov 2014 21:20:48 +0000 (21:20 +0000)]
Add a setting escape-non-printables that drives whether the StringPrinter should or should not escape sequences such as \t, \n, .. and generally any non-printing character

The recent StringPrinter changes made this behavior the default, and the setting defaults to yes
If you want to change this behavior and see non-printables unescaped (e.g. "a\tb" as "a    b"), set it to false

Fixes rdar://12969594

llvm-svn: 221399

9 years agoFix rvalue bug in __has_operator_addressof
Eric Fiselier [Wed, 5 Nov 2014 21:20:10 +0000 (21:20 +0000)]
Fix rvalue bug in  __has_operator_addressof

llvm-svn: 221398

9 years ago[ELF] Use getVisibility() function to access st_other field
Simon Atanasyan [Wed, 5 Nov 2014 21:09:53 +0000 (21:09 +0000)]
[ELF] Use getVisibility() function to access st_other field

The st_other field can contains not only visibility flag so we should
retrieve a visibility flag using a bit-mask.

llvm-svn: 221397

9 years agoRemove obsolete ARM intrinsics vclz and vcnt
Steven Wu [Wed, 5 Nov 2014 21:02:55 +0000 (21:02 +0000)]
Remove obsolete ARM intrinsics vclz and vcnt

Both of the intrinsics get autoupgraded to target independent
intrinsics.

llvm-svn: 221396

9 years agoFix operator & detection trait to check for free function overloads as well
Eric Fiselier [Wed, 5 Nov 2014 20:59:18 +0000 (20:59 +0000)]
Fix operator & detection trait to check for free function overloads as well

llvm-svn: 221395

9 years agoBlockGenerator: Recompute values from SCEV before handing back the original values
Tobias Grosser [Wed, 5 Nov 2014 20:48:56 +0000 (20:48 +0000)]
BlockGenerator: Recompute values from SCEV before handing back the original values

This patch moves the SCEV based (re)generation of values before the checking for
scop-constant terms. It enables us to provide SCEV based replacements, which
are necessary to correctly generate OpenMP subfunctions when using the SCEV
based code generation.

When recomputing a new value for a value used in the code of the original scop,
we previously directly returned the same original value for all scop-constant
expressions without even trying to regenerate these values using our SCEV
expression. This is correct when the newly generated code remains fully in the
same function, however in case we want to outline parts of the newly generated
scop into subfunctions, this approach means we do not have any opportunity to
update these values in the SCEV based code generation. (In the non-SCEV based
code generation, we can provide such updates through the GlobalMap). To ensure
we have this opportunity, we first try to regenerate scalar terms with our SCEV
builder and will only return scop-constant expressions if SCEV based code
generation was not possible.

This change should not affect the results of the existing code generation
passes. It only impacts the upcoming OpenMP based code generation.

This commit also adds a test case. This test case passes before and after this
commit. It was added to ensure test coverage for the changed code.

llvm-svn: 221393

9 years agoAdd accessor to get 'visibility' part of st_other field
Simon Atanasyan [Wed, 5 Nov 2014 20:47:35 +0000 (20:47 +0000)]
Add accessor to get 'visibility' part of st_other field

This new `getVisibility()` function will also be used in the LLD code.

llvm-svn: 221392

9 years agocmake: Conditionalize CodeGen's dependency on intrinsics_gen
Reid Kleckner [Wed, 5 Nov 2014 20:30:55 +0000 (20:30 +0000)]
cmake: Conditionalize CodeGen's dependency on intrinsics_gen

Custom targets in cmake cannot be exported, and this dependency is only
needed in the combined build to ensure that Intrinsics.gen is created
before compiling CodeGen. In the standalone, all of LLVM is build first.

llvm-svn: 221391

9 years agoFix test breakage from r221386
Derek Schuff [Wed, 5 Nov 2014 20:02:05 +0000 (20:02 +0000)]
Fix test breakage from r221386

llvm-svn: 221389

9 years agoBlockGenerator: inline lookupAvailableValue into getValue [NFC]
Tobias Grosser [Wed, 5 Nov 2014 19:46:04 +0000 (19:46 +0000)]
BlockGenerator: inline lookupAvailableValue into getValue [NFC]

There was no good reason why this code was split accross two functions.

In subsequent changes we will change the order in which values are looked up.
Doing so would make the split into two functions even more arbitrary.

We also slightly improve the documentation.

llvm-svn: 221388

9 years agoR600/SI: Fix omod display for VOP3b
Matt Arsenault [Wed, 5 Nov 2014 19:35:00 +0000 (19:35 +0000)]
R600/SI: Fix omod display for VOP3b

llvm-svn: 221387

9 years ago[x86 fast-isel] Materialize allocas with the correct-sized lea for ILP32
Derek Schuff [Wed, 5 Nov 2014 19:27:21 +0000 (19:27 +0000)]
[x86 fast-isel] Materialize allocas with the correct-sized lea for ILP32

Summary:
X86FastISel::fastMaterializeAlloca was incorrectly conditioning its
opcode selection on subtarget bitness rather than pointer size.

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

llvm-svn: 221386

9 years ago[DebugInfo] Do not record artificial global initializer functions in the DeclCache.
Frederic Riss [Wed, 5 Nov 2014 19:19:04 +0000 (19:19 +0000)]
[DebugInfo] Do not record artificial global initializer functions in the DeclCache.

When we are generating the global initializer functions, we call
CGDebugInfo::EmitFunctionStart() with a valid decl which is describing
the initialized global variable. Do not update the DeclCache with this
key as it will overwrite the the cached variable DIGlobalVariable with
the newly created artificial DISubprogram.

One could wonder if we should put artificial subprograms in the DIE tree
at all (there are vaild uses for them carrying line information though).

llvm-svn: 221385

9 years agoR600/SI: Add testcase I forgot to commit from months ago
Matt Arsenault [Wed, 5 Nov 2014 19:01:22 +0000 (19:01 +0000)]
R600/SI: Add testcase I forgot to commit from months ago

llvm-svn: 221384

9 years agoR600/SI: Move all rsrc building functions to SIISelLowering
Matt Arsenault [Wed, 5 Nov 2014 19:01:19 +0000 (19:01 +0000)]
R600/SI: Move all rsrc building functions to SIISelLowering

llvm-svn: 221383

9 years agoR600/SI: Remove SI_ADDR64_RSRC
Matt Arsenault [Wed, 5 Nov 2014 19:01:17 +0000 (19:01 +0000)]
R600/SI: Remove SI_ADDR64_RSRC

llvm-svn: 221382

9 years agoFix failing allow_user_segv.cc test on OS X 10.10
Kuba Brecka [Wed, 5 Nov 2014 18:58:41 +0000 (18:58 +0000)]
Fix failing allow_user_segv.cc test on OS X 10.10

The current ASan testcase Posix/allow_user_segv.cc expects SIGBUS to be triggered on 32-bit Darwin. This has apparently changed on 10.10 to trigger SIGSEGV instead, just as on 64-bit. Let's just install handlers for both SIGSEGV and SIGBUS instead of #ifdef'ing.

Reviewed at http://reviews.llvm.org/D6121

llvm-svn: 221381

9 years agoExtend the OS X pthread_get_stacksize_np workaround to 10.10
Kuba Brecka [Wed, 5 Nov 2014 18:55:38 +0000 (18:55 +0000)]
Extend the OS X pthread_get_stacksize_np workaround to 10.10

Fixes a failing ASan testcase (TestCases/stack-use-after-return.cc) on OS X 10.10.

Reviewed at http://reviews.llvm.org/D6120

llvm-svn: 221380

9 years agoExtend Mac OS versions to Yosemite
Kuba Brecka [Wed, 5 Nov 2014 18:53:22 +0000 (18:53 +0000)]
Extend Mac OS versions to Yosemite

This also fixes the test/asan/TestCases/Darwin/malloc_zone-protected.cc test failure on OS X 10.10.

Reviewed at http://reviews.llvm.org/D6119

llvm-svn: 221379

9 years agoFix LLDB build as a result of upstream LLVM changes.
Zachary Turner [Wed, 5 Nov 2014 18:37:53 +0000 (18:37 +0000)]
Fix LLDB build as a result of upstream LLVM changes.

llvm-svn: 221378

9 years ago[NVPTX] Add NVPTXLowerStructArgs pass
Justin Holewinski [Wed, 5 Nov 2014 18:19:30 +0000 (18:19 +0000)]
[NVPTX] Add NVPTXLowerStructArgs pass

This works around the limitation that PTX does not allow .param space
loads/stores with arbitrary pointers.

If a function has a by-val struct ptr arg, say foo(%struct.x *byval %d), then
add the following instructions to the first basic block :

%temp = alloca %struct.x, align 8
%tt1 = bitcast %struct.x * %d to i8 *
%tt2 = llvm.nvvm.cvt.gen.to.param %tt2
%tempd = bitcast i8 addrspace(101) * to %struct.x addrspace(101) *
%tv = load %struct.x addrspace(101) * %tempd
store %struct.x %tv, %struct.x * %temp, align 8

The above code allocates some space in the stack and copies the incoming
struct from param space to local space. Then replace all occurences of %d
by %temp.

Fixes PR21465.

llvm-svn: 221377

9 years agoIR: MDNode => Value: Update for LLVM API change in r221375
Duncan P. N. Exon Smith [Wed, 5 Nov 2014 18:16:35 +0000 (18:16 +0000)]
IR: MDNode => Value: Update for LLVM API change in r221375

llvm-svn: 221376

9 years agoIR: MDNode => Value: NamedMDNode::getOperator()
Duncan P. N. Exon Smith [Wed, 5 Nov 2014 18:16:03 +0000 (18:16 +0000)]
IR: MDNode => Value: NamedMDNode::getOperator()

Change `NamedMDNode::getOperator()` from returning `MDNode *` to
returning `Value *`.  To reduce boilerplate at some call sites, add a
`getOperatorAsMDNode()` for named metadata that's expected to only
return `MDNode` -- for now, that's everything, but debug node named
metadata (such as llvm.dbg.cu and llvm.dbg.sp) will soon change.  This
is part of PR21433.

Note that there's a follow-up patch to clang for the API change.

llvm-svn: 221375

9 years agoremove extra breaks; NFC
Sanjay Patel [Wed, 5 Nov 2014 18:00:07 +0000 (18:00 +0000)]
remove extra breaks; NFC

llvm-svn: 221374

9 years agoIR: MDNode => Value: AsmWriter SlotTracker API
Duncan P. N. Exon Smith [Wed, 5 Nov 2014 17:56:28 +0000 (17:56 +0000)]
IR: MDNode => Value: AsmWriter SlotTracker API

Change `SlotTracker::CreateMetadataSlot()` and
`SlotTracker::getMetadataSlot()` to use `Value` instead of `MDNode`.
Part of PR21433.

llvm-svn: 221373

9 years ago[ARM] Remove more dead code.
Tilmann Scheller [Wed, 5 Nov 2014 17:45:04 +0000 (17:45 +0000)]
[ARM] Remove more dead code.

Dead code identified by the Clang static analyzer.

llvm-svn: 221372

9 years agops][microMIPS] Implement CodeGen support for ANDI16 instruction
Zoran Jovanovic [Wed, 5 Nov 2014 17:43:00 +0000 (17:43 +0000)]
ps][microMIPS] Implement CodeGen support for ANDI16 instruction

llvm-svn: 221371

9 years ago[Hexagon] [NFC] Alphabetizing cmake files.
Colin LeMahieu [Wed, 5 Nov 2014 17:38:48 +0000 (17:38 +0000)]
[Hexagon] [NFC] Alphabetizing cmake files.

llvm-svn: 221370

9 years agops][microMIPS] Implement CodeGen support for SLL16 and SRL16 instructions
Zoran Jovanovic [Wed, 5 Nov 2014 17:38:31 +0000 (17:38 +0000)]
ps][microMIPS] Implement CodeGen support for SLL16 and SRL16 instructions

llvm-svn: 221369

9 years ago[ARM] Remove another redundant assignment.
Tilmann Scheller [Wed, 5 Nov 2014 17:34:04 +0000 (17:34 +0000)]
[ARM] Remove another redundant assignment.

Found by the Clang static analyzer.

llvm-svn: 221368

9 years ago[mips][microMIPS] Implement ANDI16 instruction
Zoran Jovanovic [Wed, 5 Nov 2014 17:31:00 +0000 (17:31 +0000)]
[mips][microMIPS] Implement ANDI16 instruction

llvm-svn: 221367

9 years ago[ARM] Remove redundant assignment.
Tilmann Scheller [Wed, 5 Nov 2014 17:28:19 +0000 (17:28 +0000)]
[ARM] Remove redundant assignment.

Found by the Clang static analyzer.

llvm-svn: 221366

9 years agoRevert "clang-format: [js] Updates to Google's JavaScript style."
Daniel Jasper [Wed, 5 Nov 2014 17:22:31 +0000 (17:22 +0000)]
Revert "clang-format: [js] Updates to Google's JavaScript style."

This reverts commit eefd2eaad43c5c2b17953ae7ed1e72b28e696f7b.

Apparently, this change was a bit premature.

llvm-svn: 221365

9 years ago[dfsan] Add runtime function for aborting on indirect calls to
Peter Collingbourne [Wed, 5 Nov 2014 17:21:11 +0000 (17:21 +0000)]
[dfsan] Add runtime function for aborting on indirect calls to
uninstrumented vararg functions.

llvm-svn: 221364

9 years ago[dfsan] Add libgo functions to ABI list.
Peter Collingbourne [Wed, 5 Nov 2014 17:21:08 +0000 (17:21 +0000)]
[dfsan] Add libgo functions to ABI list.

llvm-svn: 221363

9 years ago[dfsan] Upgrade ABI list to Ubuntu 14.04.
Peter Collingbourne [Wed, 5 Nov 2014 17:21:06 +0000 (17:21 +0000)]
[dfsan] Upgrade ABI list to Ubuntu 14.04.

This incorporates some of the newer functions used by (e.g.) the Go runtime.

llvm-svn: 221362

9 years ago[dfsan] Modify build-libc-list.py to filter out local functions in generated
Peter Collingbourne [Wed, 5 Nov 2014 17:21:04 +0000 (17:21 +0000)]
[dfsan] Modify build-libc-list.py to filter out local functions in generated
ABI list.

llvm-svn: 221361

9 years ago[dfsan] Abort at runtime on indirect calls to uninstrumented vararg functions.
Peter Collingbourne [Wed, 5 Nov 2014 17:21:00 +0000 (17:21 +0000)]
[dfsan] Abort at runtime on indirect calls to uninstrumented vararg functions.

We currently have no infrastructure to support these correctly.

This is accomplished by generating a call to a runtime library function that
aborts at runtime in place of the regular wrapper for such functions. Direct
calls are rewritten in the usual way during traversal of the caller's IR.

We also remove the "split-stack" attribute from such wrappers, as the code
generator cannot currently handle split-stack vararg functions.

llvm-svn: 221360

9 years agoIR: MDNode => Value: NamedMDNode::addOperand()
Duncan P. N. Exon Smith [Wed, 5 Nov 2014 17:16:09 +0000 (17:16 +0000)]
IR: MDNode => Value: NamedMDNode::addOperand()

Change `NamedMDNode::addOperand()` to take a `Value *` instead of an
`MDNode *`.  This is part of PR21433.

llvm-svn: 221359

9 years ago[ARM] Remove dead code identified by the Clang static analyzer.
Tilmann Scheller [Wed, 5 Nov 2014 17:10:43 +0000 (17:10 +0000)]
[ARM] Remove dead code identified by the Clang static analyzer.

llvm-svn: 221358

9 years agoRemove superceded warning warn_forgotten_module_header
Ben Langmuir [Wed, 5 Nov 2014 16:43:18 +0000 (16:43 +0000)]
Remove superceded warning warn_forgotten_module_header

This DefaultIgnore warning under -Wincomplete-module was firing on
any module map files that happened to be parsed (it's only supposed to
fire on headers), and it has been superceded by
-Wnon-modular-include-in-module anyway.

For compatibility, I rewired -Wincomplete-module to imply
-Wnon-modular-include-in-module.

llvm-svn: 221357

9 years agoWhen run on a ppc64le based platform, the check-sanitizer build looks for
Will Schmidt [Wed, 5 Nov 2014 16:35:23 +0000 (16:35 +0000)]
When run on a ppc64le based platform, the check-sanitizer build looks for
objects with the powerpc64le name. i.e. asan-powerpc64le.a
This change allows those objects to be built.

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

llvm-svn: 221356

9 years ago[mips][microMIPS] Mark symbols as microMIPS if necessary
Zoran Jovanovic [Wed, 5 Nov 2014 16:35:20 +0000 (16:35 +0000)]
[mips][microMIPS] Mark symbols as microMIPS if necessary
Differential Revision: http://reviews.llvm.org/D6039

llvm-svn: 221355

9 years agoReverted revisions 221351, 221352 and 221353.
Zoran Jovanovic [Wed, 5 Nov 2014 16:19:59 +0000 (16:19 +0000)]
Reverted revisions 221351, 221352 and 221353.

llvm-svn: 221354

9 years ago[mips][microMIPS] Implement CodeGen support for ANDI16 instruction
Zoran Jovanovic [Wed, 5 Nov 2014 15:54:05 +0000 (15:54 +0000)]
[mips][microMIPS] Implement CodeGen support for ANDI16 instruction
Differential Revision: http://reviews.llvm.org/D5797

llvm-svn: 221353

9 years ago[mips][microMIPS] Implement CodeGen support for SLL16 and SRL16 instructions
Zoran Jovanovic [Wed, 5 Nov 2014 15:46:53 +0000 (15:46 +0000)]
[mips][microMIPS] Implement CodeGen support for SLL16 and SRL16 instructions
Differential Revision: http://reviews.llvm.org/D5933

llvm-svn: 221352

9 years ago[mips][microMIPS] Implement ANDI16 instruction
Zoran Jovanovic [Wed, 5 Nov 2014 15:39:41 +0000 (15:39 +0000)]
[mips][microMIPS] Implement ANDI16 instruction
Differential Revision: http://reviews.llvm.org/D5163

llvm-svn: 221351

9 years agoR600/SI: Change all instruction assembly names to lowercase.
Tom Stellard [Wed, 5 Nov 2014 14:50:53 +0000 (14:50 +0000)]
R600/SI: Change all instruction assembly names to lowercase.

This matches the format produced by the AMD proprietary driver.

//==================================================================//
// Shell script for converting .ll test cases: (Pass the .ll files
   you want to convert to this script as arguments).
//==================================================================//

; This was necessary on my system so that A-Z in sed would match only
; upper case.  I'm not sure why.
export LC_ALL='C'

TEST_FILES="$*"

MATCHES=`grep -v Patterns SIInstructions.td | grep -o '"[A-Z0-9_]\+["e]' | grep -o '[A-Z0-9_]\+' | sort -r`

for f in $TEST_FILES; do
  # Check that there are SI tests:
  grep -q -e 'verde' -e 'bonaire' -e 'SI' -e 'tahiti' $f
  if [ $? -eq 0 ]; then
    for match in $MATCHES; do
      sed -i -e "s/\([ :]$match\)/\L\1/" $f
    done

    # Try to get check lines with partial instruction names
    sed -i 's/\(;[ ]*SI[A-Z\\-]*: \)\([A-Z_0-9]\+\)/\1\L\2/' $f
  fi
done

sed -i -e 's/bb0_1/BB0_1/g' ../../../test/CodeGen/R600/infinite-loop.ll
sed -i -e 's/SI-NOT: bfe/SI-NOT: {{[^@]}}bfe/g'../../../test/CodeGen/R600/llvm.AMDGPU.bfe.*32.ll ../../../test/CodeGen/R600/sext-in-reg.ll
sed -i -e 's/exp_IEEE/EXP_IEEE/g' ../../../test/CodeGen/R600/llvm.exp2.ll
sed -i -e 's/numVgprs/NumVgprs/g' ../../../test/CodeGen/R600/register-count-comments.ll
sed -i 's/\(; CHECK[-NOT]*: \)\([A-Z_0-9]\+\)/\1\L\2/' ../../../test/CodeGen/R600/select64.ll ../../../test/CodeGen/R600/sgpr-copy.ll

//==================================================================//
// Shell script for converting .td files (run this last)
//==================================================================//

export LC_ALL='C'
sed -i -e '/Patterns/!s/\("[A-Z0-9_]\+[ "e]\)/\L\1/g' SIInstructions.td
sed -i -e 's/"EXP/"exp/g' SIInstrInfo.td

llvm-svn: 221350

9 years agoR600/SI: Add an extra check line to make test more strict
Tom Stellard [Wed, 5 Nov 2014 14:50:34 +0000 (14:50 +0000)]
R600/SI: Add an extra check line to make test more strict

llvm-svn: 221349

9 years agoDisable backtrace libcxxabi test on ARM
Renato Golin [Wed, 5 Nov 2014 14:45:46 +0000 (14:45 +0000)]
Disable backtrace libcxxabi test on ARM

_Unwind_Backtrace is not clearly defined in EHABI and needs more
testing. A bug was created with some initial investigation done
http://llvm.org/PR21444. This test fails with both libunwind and libgcc_s.

llvm-svn: 221348

9 years agoDisable XFAIL on ARM since the x86_64 specific code is isolated
Renato Golin [Wed, 5 Nov 2014 14:44:58 +0000 (14:44 +0000)]
Disable XFAIL on ARM since the x86_64 specific code is isolated

llvm-svn: 221347

9 years agoSupport LLVM_BUILD_STATIC.
Rafael Espindola [Wed, 5 Nov 2014 14:04:25 +0000 (14:04 +0000)]
Support LLVM_BUILD_STATIC.

llvm-svn: 221346

9 years agoAdd a LLVM_BUILD_STATIC option to cmake.
Rafael Espindola [Wed, 5 Nov 2014 14:03:58 +0000 (14:03 +0000)]
Add a LLVM_BUILD_STATIC option to cmake.

Setting it to true causes all executables to be statically linked.

llvm-svn: 221345

9 years agoMS ABI: Correctly mangle CV qualifiers from typedefs
Will Wilson [Wed, 5 Nov 2014 13:54:21 +0000 (13:54 +0000)]
MS ABI: Correctly mangle CV qualifiers from typedefs

llvm-svn: 221344

9 years ago[X86] Teach method 'isVectorClearMaskLegal' how to check for legal blend masks.
Andrea Di Biagio [Wed, 5 Nov 2014 13:04:14 +0000 (13:04 +0000)]
[X86] Teach method 'isVectorClearMaskLegal' how to check for legal blend masks.

This patch improves the folding of vector AND nodes into blend operations for
targets that feature SSE4.1. A vector AND node where one of the operands is
a constant build_vector with elements that are either zero or all-ones can be
converted into a blend.

This allows for example to simplify the following code:

define <4 x i32> @test(<4 x i32> %A, <4 x i32> %B) {
  %1 = and <4 x i32> %A, <i32 0, i32 0, i32 0, i32 -1>
  %2 = and <4 x i32> %B, <i32 -1, i32 -1, i32 -1, i32 0>
  %3 = or <4 x i32> %1, %2
  ret <4 x i32> %3
}

Before this patch llc (-mcpu=corei7) generated:
        andps  LCPI1_0(%rip), %xmm0, %xmm0
        andps  LCPI1_1(%rip), %xmm1, %xmm1
        orps   %xmm1, %xmm0, %xmm0
        retq

With this patch we generate a single 'vpblendw'.

llvm-svn: 221343

9 years agoFix bashism in tests added by r221341
Oliver Stannard [Wed, 5 Nov 2014 12:40:21 +0000 (12:40 +0000)]
Fix bashism in tests added by r221341

llvm-svn: 221342

9 years ago[ARM] Honor FeatureD16 in the assembler and disassembler
Oliver Stannard [Wed, 5 Nov 2014 12:06:39 +0000 (12:06 +0000)]
[ARM] Honor FeatureD16 in the assembler and disassembler

Some ARM FPUs only have 16 double-precision registers, rather than the
normal 32. LLVM represents this with the D16 target feature. This is
currently used by CodeGen to avoid using high registers when they are
not available, but the assembler and disassembler do not.

I fix this in the assmebler and disassembler rather than the
InstrInfo.td files, as the latter would require a large number of
changes everywhere one of the floating-point instructions is referenced
in the backend. This solution is similar to the one used for
co-processor numbers and MSR masks.

llvm-svn: 221341

9 years ago[clang-tidy] google-readability-function: skip std::nullptr_t
Alexander Kornienko [Wed, 5 Nov 2014 11:08:39 +0000 (11:08 +0000)]
[clang-tidy] google-readability-function: skip std::nullptr_t

Parameters of type std::nullptr_t can only have one value, so it doesn't make
sense to name them.

llvm-svn: 221340

9 years agoclang-format: Add test to prevent regression in r221125.
Daniel Jasper [Wed, 5 Nov 2014 10:55:36 +0000 (10:55 +0000)]
clang-format: Add test to prevent regression in r221125.

llvm-svn: 221339

9 years agoclang-format: Improve free-standing macro detection.
Daniel Jasper [Wed, 5 Nov 2014 10:48:04 +0000 (10:48 +0000)]
clang-format: Improve free-standing macro detection.

Before:
  SOME_WEIRD_LOG_MACRO
  << "Something long enough to cause a line break";

After:
  SOME_WEIRD_LOG_MACRO
      << "Something long enough to cause a line break";

llvm-svn: 221338

9 years agoGet the Linux ptrace test working on PowerPC64
Jay Foad [Wed, 5 Nov 2014 08:42:48 +0000 (08:42 +0000)]
Get the Linux ptrace test working on PowerPC64

The test refers to user_regs_struct.rip so it can only ever have worked
on x86-64. Put this code inside an appropriate #if, and add a similar
case for PowerPC64. (If we do likewise for ARM we can probably remove
the XFAILs, but I have no way of testing that.)

Those changes are enough to get the test working for me on big-endian
PowerPC64 Fedora 19.

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

llvm-svn: 221337

9 years agoImprove logic that decides if its profitable to commute when some of the virtual...
Craig Topper [Wed, 5 Nov 2014 06:43:02 +0000 (06:43 +0000)]
Improve logic that decides if its profitable to commute when some of the virtual registers involved have uses/defs chains connecting them to physical register. Fix up the tests that this change improves.

llvm-svn: 221336

9 years agoPECOFF: Set the AddressOfRelocationTable in the DOS header
David Majnemer [Wed, 5 Nov 2014 06:37:08 +0000 (06:37 +0000)]
PECOFF: Set the AddressOfRelocationTable in the DOS header

Many programs, for reasons unknown, really like to look at the
AddressOfRelocationTable to determine whether or not they are looking at
a bona fide PE file.  Without this, programs like the UNIX `file'
utility will insist that they are looking at a MS DOS executable.

llvm-svn: 221335

9 years agollvm/test/Transforms/GCOVProfiling: Avoid to parse backslashes in MDString. Use ...
NAKAMURA Takumi [Wed, 5 Nov 2014 06:29:05 +0000 (06:29 +0000)]
llvm/test/Transforms/GCOVProfiling: Avoid to parse backslashes in MDString. Use %/T instead of %T.

LLVM Parser decodes "\bb" as hex in "C:\bb-win7\buildername\build...", with MDString.

See also, http://llvm.org/docs/LangRef.html#metadata-nodes-and-metadata-strings

This reverts r221270, "Disable 3 tests in llvm/test/Transforms/GCOVProfiling/ for now. Investigating."

FIXME: Please check EC in GCOVProfiler::emitProfileNotes().
llvm-svn: 221334

9 years agollvm-readobj: Add support for dumping the DOS header in PE files
David Majnemer [Wed, 5 Nov 2014 06:24:35 +0000 (06:24 +0000)]
llvm-readobj: Add support for dumping the DOS header in PE files

llvm-svn: 221333

9 years agoMark darwin-debug-flags.c as REQUIRES:shell, due to quoting issue.
NAKAMURA Takumi [Wed, 5 Nov 2014 05:04:00 +0000 (05:04 +0000)]
Mark darwin-debug-flags.c as REQUIRES:shell, due to quoting issue.

llvm-svn: 221332

9 years agoRevert 220932.
Jiangning Liu [Wed, 5 Nov 2014 04:44:31 +0000 (04:44 +0000)]
Revert 220932.

Commit 220932 caused crash when building clang-tblgen on aarch64 debian target,
so it's blocking all daily tests.

The std::call_once implementation in pthread has bug for aarch64 debian.

llvm-svn: 221331

9 years agoclang-format: Make it possible to (require 'clang-format)
Justin Bogner [Wed, 5 Nov 2014 04:32:54 +0000 (04:32 +0000)]
clang-format: Make it possible to (require 'clang-format)

This makes the emacs integration ``provide`` a clang-format feature,
so that a .emacs can ``require`` it.

llvm-svn: 221330

9 years ago[PECOFF] Do not skip COMDAT section symbols.
Rui Ueyama [Wed, 5 Nov 2014 02:21:39 +0000 (02:21 +0000)]
[PECOFF] Do not skip COMDAT section symbols.

LLD skipped COMDAT section symbols when reading them because
I thought we don't want to have symbols with the same name.
But they are actually needed because relocations may refer to
the section symbols. So we shoulnd't skip them.

llvm-svn: 221329

9 years agoIR: Metadata: Remove unnecessary dyn_cast
Duncan P. N. Exon Smith [Wed, 5 Nov 2014 01:55:06 +0000 (01:55 +0000)]
IR: Metadata: Remove unnecessary dyn_cast

llvm-svn: 221328