OSDN Git Service

android-x86/external-llvm.git
7 years ago[MathExtras] fix documentation comments; NFC
Sanjay Patel [Wed, 14 Jun 2017 14:28:24 +0000 (14:28 +0000)]
[MathExtras] fix documentation comments; NFC

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

7 years ago[ARM] Support constant pools in data when generating execute-only code.
Alexandros Lamprineas [Wed, 14 Jun 2017 13:22:41 +0000 (13:22 +0000)]
[ARM] Support constant pools in data when generating execute-only code.

The ARM backend asserts against constant pool lowering when it generates
execute-only code in order to prevent the generation of constant pools in
the text section. It appears that target independent optimizations might
generate DAG nodes that represent constant pools. By lowering such nodes
as global addresses we don't violate the semantics of execute-only code
and also it is guaranteed that execute-only behaves correct with the
position-independent addressing modes that support execute-only code.

Differential Revision: https://reviews.llvm.org/D33773

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

7 years agoAlign definition of DW_OP_plus with DWARF spec [3/3]
Florian Hahn [Wed, 14 Jun 2017 13:14:38 +0000 (13:14 +0000)]
Align definition of DW_OP_plus with DWARF spec [3/3]

Summary:
This patch is part of 3 patches that together form a single patch, but must be introduced in stages in order not to break things.

The way that LLVM interprets DW_OP_plus in DIExpression nodes is basically that of the DW_OP_plus_uconst operator since LLVM expects an unsigned constant operand. This unnecessarily restricts the DW_OP_plus operator, preventing it from being used to describe the evaluation of runtime values on the expression stack. These patches try to align the semantics of DW_OP_plus and DW_OP_minus with that of the DWARF definition, which pops two elements off the expression stack, performs the operation and pushes the result back on the stack.

This is done in three stages:
• The first patch (LLVM) adds support for DW_OP_plus_uconst.
• The second patch (Clang) contains changes all its uses from DW_OP_plus to DW_OP_plus_uconst.
• The third patch (LLVM) changes the semantics of DW_OP_plus and DW_OP_minus to be in line with its DWARF meaning. This patch includes the bitcode upgrade from legacy DIExpressions.

Patch by Sander de Smalen.

Reviewers: echristo, pcc, aprantl

Reviewed By: aprantl

Subscribers: fhahn, javed.absar, aprantl, llvm-commits

Differential Revision: https://reviews.llvm.org/D33894

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

7 years ago[mips] Fix machine verifier errors in the long branch pass
Simon Dardis [Wed, 14 Jun 2017 12:16:47 +0000 (12:16 +0000)]
[mips] Fix machine verifier errors in the long branch pass

This patch fixes two systemic machine verifier errors in the long
branch pass. The first is the incorrect basic block successors
and the second was the incorrect construction of several jump
instructions.

This partially resolves PR27458 and the associated PR32146.

Reviewers: slthakur

Differential Revision: https://reviews.llvm.org/D33378

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

7 years agoRevert r304907 as it is causing some failures that I cannot reproduce.
Nemanja Ivanovic [Wed, 14 Jun 2017 07:05:42 +0000 (07:05 +0000)]
Revert r304907 as it is causing some failures that I cannot reproduce.

Reverting this until a test case can be provided to aid the investigation.

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

7 years agoRevert "[codeview] Make obj2yaml/yaml2obj support .debug$S..."
Zachary Turner [Wed, 14 Jun 2017 06:24:24 +0000 (06:24 +0000)]
Revert "[codeview] Make obj2yaml/yaml2obj support .debug$S..."

This is causing failures on linux bots with an invalid stream
read.  It doesn't repro in any configuration on Windows, so
reverting until I have a chance to investigate on Linux.

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

7 years agoUse make_shared instead of make_unique.
Zachary Turner [Wed, 14 Jun 2017 05:48:33 +0000 (05:48 +0000)]
Use make_shared instead of make_unique.

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

7 years agoFix some more errors.
Zachary Turner [Wed, 14 Jun 2017 05:44:38 +0000 (05:44 +0000)]
Fix some more errors.

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

7 years agoAdd some #includes to appease the build.
Zachary Turner [Wed, 14 Jun 2017 05:38:34 +0000 (05:38 +0000)]
Add some #includes to appease the build.

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

7 years ago[codeview] Make obj2yaml/yaml2obj support .debug$S/T sections.
Zachary Turner [Wed, 14 Jun 2017 05:31:00 +0000 (05:31 +0000)]
[codeview] Make obj2yaml/yaml2obj support .debug$S/T sections.

This allows us to use yaml2obj and obj2yaml to round-trip CodeView
symbol and type information without having to manually specify the bytes
of the section. This makes for much easier to maintain tests. See the
tests under lld/COFF in this patch for example. Before they just said
SectionData: <blob> whereas now we can use meaningful record
descriptions. Note that it still supports the SectionData yaml field,
which could be useful for initializing a section to invalid bytes for
testing, for example.

Differential Revision: https://reviews.llvm.org/D34127

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

7 years agoSupport: Remove MSVC 2013 workarounds in ThreadPool class.
Peter Collingbourne [Wed, 14 Jun 2017 00:36:21 +0000 (00:36 +0000)]
Support: Remove MSVC 2013 workarounds in ThreadPool class.

I have confirmed that these are no longer needed with MSVC 2015.

Differential Revision: https://reviews.llvm.org/D34187

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

7 years ago[libFuzzer] really restrict the new test to Linux (fails on Mac/Windows currently)
Kostya Serebryany [Wed, 14 Jun 2017 00:34:42 +0000 (00:34 +0000)]
[libFuzzer] really restrict the new test to Linux (fails on Mac/Windows currently)

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

7 years agoRe-enable tests on power pc since the bug has been fixed.
Eric Beckmann [Wed, 14 Jun 2017 00:22:43 +0000 (00:22 +0000)]
Re-enable tests on power pc since the bug has been fixed.

Summary: just flip them on.

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D34186

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

7 years agoAdded partial verification for .apple_names accelerator table in llvm-dwarfdump output.
Spyridoula Gravani [Wed, 14 Jun 2017 00:17:55 +0000 (00:17 +0000)]
Added partial verification for .apple_names accelerator table in llvm-dwarfdump output.

This patch adds code which verifies that each bucket in the .apple_names
accelerator table is either empty or has a valid hash index.

Differential Revision: https://reviews.llvm.org/D34177

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

7 years agoReverted r305339 as MSVC is not happy with noreturn in lambda.
Galina Kistanova [Tue, 13 Jun 2017 23:57:51 +0000 (23:57 +0000)]
Reverted r305339 as MSVC is not happy with noreturn in lambda.

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

7 years ago[globalisel][legalizer] G_LOAD/G_STORE NarrowScalar should not emit G_GEP x, 0.
Daniel Sanders [Tue, 13 Jun 2017 23:42:32 +0000 (23:42 +0000)]
[globalisel][legalizer] G_LOAD/G_STORE NarrowScalar should not emit G_GEP x, 0.

Summary:
When legalizing G_LOAD/G_STORE using NarrowScalar, we should avoid emitting
%0 = G_CONSTANT ty 0
%1 = G_GEP %x, %0
since it's cheaper to not emit the redundant instructions than it is to fold them
away later.

Reviewers: qcolombet, t.p.northover, ab, rovka, aditya_nandakumar, kristof.beyls

Reviewed By: qcolombet

Subscribers: javed.absar, llvm-commits, igorb

Differential Revision: https://reviews.llvm.org/D32746

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

7 years agoSpecified LLVM_ATTRIBUTE_NORETURN for ReportError.
Galina Kistanova [Tue, 13 Jun 2017 23:39:42 +0000 (23:39 +0000)]
Specified LLVM_ATTRIBUTE_NORETURN for ReportError.

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

7 years ago[InstCombine] Add test cases demonstrating failure to handle (select (icmp eq (and...
Craig Topper [Tue, 13 Jun 2017 23:30:41 +0000 (23:30 +0000)]
[InstCombine] Add test cases demonstrating failure to handle (select (icmp eq (and X, C1), 0), Y, (or Y, C2)) when the icmp portion gets turned into a truncate and a signed compare with 0.

InstCombine has an optimization that recognizes an and with the sign bit of legal type size and turns it into a truncate and compare that checks the sign bit. But the select handling code doesn't recognize this idiom.

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

7 years ago[libFuzzer] restrict the new test to Linux (fails on Mac currently)
Kostya Serebryany [Tue, 13 Jun 2017 23:09:11 +0000 (23:09 +0000)]
[libFuzzer] restrict the new test to Linux (fails on Mac currently)

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

7 years ago[ADT] Revert r305326 changes in BitVector.h to fix broken builds.
Eugene Zelenko [Tue, 13 Jun 2017 22:32:38 +0000 (22:32 +0000)]
[ADT] Revert r305326 changes in BitVector.h to fix broken builds.

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

7 years ago[libFuzzer] initial support of -fsanitize-coverage=inline-8bit-counters in libFuzzer...
Kostya Serebryany [Tue, 13 Jun 2017 22:31:21 +0000 (22:31 +0000)]
[libFuzzer] initial support of -fsanitize-coverage=inline-8bit-counters in libFuzzer. This is not fully functional yet, but simple tests work

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

7 years ago[AMDGPU] Remove now dead defaultOffsetS13(). NFCI.
Davide Italiano [Tue, 13 Jun 2017 22:24:24 +0000 (22:24 +0000)]
[AMDGPU] Remove now dead defaultOffsetS13(). NFCI.

Fixes the GCC7 build with -Werror.

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

7 years ago[InstrProf] Don't take the address of alwaysinline available_externally functions
Vedant Kumar [Tue, 13 Jun 2017 22:12:35 +0000 (22:12 +0000)]
[InstrProf] Don't take the address of alwaysinline available_externally functions

Doing so breaks compilation of the following C program
(under -fprofile-instr-generate):

 __attribute__((always_inline)) inline int foo() { return 0; }

 int main() { return foo(); }

At link time, we fail because taking the address of an
available_externally function creates an undefined external reference,
which the TU cannot provide.

Emitting the function definition into the object file at all appears to
be a violation of the langref: "Globals with 'available_externally'
linkage are never emitted into the object file corresponding to the LLVM
module."

Differential Revision: https://reviews.llvm.org/D34134

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

7 years ago[ADT] Fix some Clang-tidy modernize-use-using and Include What You Use warnings;...
Eugene Zelenko [Tue, 13 Jun 2017 22:11:49 +0000 (22:11 +0000)]
[ADT] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).

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

7 years agoUse reference to iterate through string table instead of copying.
Eric Beckmann [Tue, 13 Jun 2017 21:05:42 +0000 (21:05 +0000)]
Use reference to iterate through string table instead of copying.

Summary: just a quick patch

Subscribers: ruiu, llvm-commits, hiraditya

Differential Revision: https://reviews.llvm.org/D34171

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

7 years agoFix a bug introduced in r305092 on big-endian systems.
Eric Beckmann [Tue, 13 Jun 2017 20:53:31 +0000 (20:53 +0000)]
Fix a bug introduced in r305092 on big-endian systems.

Summary:
We were writing the length of the string based on system-endianness, and
not universally little-endian.  This fixes that.

Reviewers: zturner

Subscribers: hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D34159

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

7 years ago[PGO] Update VP metadata after memory intrinsic optimization
Teresa Johnson [Tue, 13 Jun 2017 20:44:08 +0000 (20:44 +0000)]
[PGO] Update VP metadata after memory intrinsic optimization

Summary:
Leave an updated VP metadata on the fallback memcpy intrinsic after
specialization. This can be used for later possible expansion based on
the average of the remaining values.

Reviewers: davidxl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D34164

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

7 years agoFix alignment complaint.
Eric Beckmann [Tue, 13 Jun 2017 20:36:19 +0000 (20:36 +0000)]
Fix alignment complaint.

Summary: Apparently we need to write using a void* pointer on some architectures, or else alignment error is caused.

Subscribers: hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D34166

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

7 years ago[ADT] PointerUnion::getAddrOfPtr1(): fix/silence -Wcast-qual warning.
Roman Lebedev [Tue, 13 Jun 2017 20:33:51 +0000 (20:33 +0000)]
[ADT] PointerUnion::getAddrOfPtr1(): fix/silence -Wcast-qual warning.

Summary:
Previously, when D33102 landed, this broke -Werror buildbots.

http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/3249
```
FAILED: /home/buildbot/Buildbot/Slave1a/clang-with-lto-ubuntu/install/stage1/bin/clang++   -DGTEST_HAS_RTTI=0 -DLLVM_BUILD_GLOBAL_ISEL -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/CodeGen/AsmPrinter -I/home/buildbot/Buildbot/Slave1a/clang-with-lto-ubuntu/llvm.src/lib/CodeGen/AsmPrinter -Iinclude -I/home/buildbot/Buildbot/Slave1a/clang-with-lto-ubuntu/llvm.src/include -fPIC -fvisibility-inlines-hidden -Werror -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fcolor-diagnostics -ffunction-sections -fdata-sections -O3    -UNDEBUG  -fno-exceptions -fno-rtti -MMD -MT lib/CodeGen/AsmPrinter/CMakeFiles/LLVMAsmPrinter.dir/CodeViewDebug.cpp.o -MF lib/CodeGen/AsmPrinter/CMakeFiles/LLVMAsmPrinter.dir/CodeViewDebug.cpp.o.d -o lib/CodeGen/AsmPrinter/CMakeFiles/LLVMAsmPrinter.dir/CodeViewDebug.cpp.o -c /home/buildbot/Buildbot/Slave1a/clang-with-lto-ubuntu/llvm.src/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
In file included from /home/buildbot/Buildbot/Slave1a/clang-with-lto-ubuntu/llvm.src/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:14:
In file included from /home/buildbot/Buildbot/Slave1a/clang-with-lto-ubuntu/llvm.src/lib/CodeGen/AsmPrinter/CodeViewDebug.h:17:
In file included from /home/buildbot/Buildbot/Slave1a/clang-with-lto-ubuntu/llvm.src/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.h:15:
In file included from /home/buildbot/Buildbot/Slave1a/clang-with-lto-ubuntu/llvm.src/include/llvm/IR/DebugInfoMetadata.h:26:
In file included from /home/buildbot/Buildbot/Slave1a/clang-with-lto-ubuntu/llvm.src/include/llvm/IR/Metadata.h:23:
/home/buildbot/Buildbot/Slave1a/clang-with-lto-ubuntu/llvm.src/include/llvm/ADT/PointerUnion.h:161:19: error: cast from 'void **' to 'const llvm::DISubprogram **' must have all intermediate pointers const qualified to be safe [-Werror,-Wcast-qual]
    return (PT1 *)Val.getAddrOfPointer();
                  ^
/home/buildbot/Buildbot/Slave1a/clang-with-lto-ubuntu/llvm.src/include/llvm/ADT/TinyPtrVector.h:177:18: note: in instantiation of member function 'llvm::PointerUnion<const llvm::DISubprogram *, llvm::SmallVector<const llvm::DISubprogram *, 4> *>::getAddrOfPtr1' requested here
      return Val.getAddrOfPtr1();
                 ^
/home/buildbot/Buildbot/Slave1a/clang-with-lto-ubuntu/llvm.src/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:1885:33: note: in instantiation of member function 'llvm::TinyPtrVector<const llvm::DISubprogram *>::begin' requested here
    for (const DISubprogram *SP : MethodItr.second) {
                                ^
1 error generated.
```

Reviewers: dblaikie, akyrtzi

Reviewed By: dblaikie

Subscribers: joerg, mehdi_amini, llvm-commits

Differential Revision: https://reviews.llvm.org/D34153

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

7 years agoRevert r305313 & r305303, self-hosting build-bot isn’t liking it.
Frederich Munch [Tue, 13 Jun 2017 19:05:24 +0000 (19:05 +0000)]
Revert r305313 & r305303, self-hosting build-bot isn’t liking it.

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

7 years ago[powerpc] deactivate tests combined.test and object.test on powerpc64 be
Bill Seurer [Tue, 13 Jun 2017 18:52:41 +0000 (18:52 +0000)]
[powerpc] deactivate tests combined.test and object.test on powerpc64 be

These tests fail on powerpc64 BE (only, not LE) and are thus intefering with
the running of 3 of the powerpc buildbots.  The author of the tests has been
notified and is working on fixing them but in the meantime I am disabling
them to get the bots working again.

See https://bugs.llvm.org//show_bug.cgi?id=33429

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

7 years ago[WebAssembly] Cleanup WebAssemblyWasmObjectWriter
Sam Clegg [Tue, 13 Jun 2017 18:51:50 +0000 (18:51 +0000)]
[WebAssembly] Cleanup WebAssemblyWasmObjectWriter

Differential Revision: https://reviews.llvm.org/D34131

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

7 years agoImprove error messages in order to help with fixing a big-endian bug.
Eric Beckmann [Tue, 13 Jun 2017 18:17:36 +0000 (18:17 +0000)]
Improve error messages in order to help with fixing a big-endian bug.

Summary: Added output to stderr so that we can actually see what is happening when the test fails on big endian.

Reviewers: zturner

Subscribers: llvm-commits, hiraditya

Differential Revision: https://reviews.llvm.org/D34155

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

7 years agoFix self hosting build-bot failure from r305303 by adjusting DynamicLibraryTests...
Frederich Munch [Tue, 13 Jun 2017 18:12:11 +0000 (18:12 +0000)]
Fix self hosting build-bot failure from r305303 by adjusting DynamicLibraryTests compile flags.

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

7 years ago[IR] Remove a couple explicitly deleted default constructors on classes that have...
Craig Topper [Tue, 13 Jun 2017 17:58:59 +0000 (17:58 +0000)]
[IR] Remove a couple explicitly deleted default constructors on classes that have a non-default constructor. NFC

The non-default constructor will implicitly delete the default constructor.

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

7 years ago[AArch64][Falkor] Fix sched details for FDIV, FSQRT, SDIV, UDIV
Geoff Berry [Tue, 13 Jun 2017 17:43:39 +0000 (17:43 +0000)]
[AArch64][Falkor] Fix sched details for FDIV, FSQRT, SDIV, UDIV

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

7 years agoTest commit - NFC.
Kit Barton [Tue, 13 Jun 2017 17:35:29 +0000 (17:35 +0000)]
Test commit - NFC.

Modified a comment to confirm commit access functionality.

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

7 years agoFix m_[Ord|Unord][FMin|FMax] matchers to correctly match ordering.
Craig Topper [Tue, 13 Jun 2017 17:18:45 +0000 (17:18 +0000)]
Fix m_[Ord|Unord][FMin|FMax] matchers to correctly match ordering.

Previously, the matching was done incorrectly for the case where
operands for FCmpInst and SelectInst were in opposite order.

Patch by Andrei Elovikov.

Differential Revision: https://reviews.llvm.org/D33185

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

7 years ago[Hexagon] Generate store-immediate instructions for stack objects
Krzysztof Parzyszek [Tue, 13 Jun 2017 17:10:16 +0000 (17:10 +0000)]
[Hexagon] Generate store-immediate instructions for stack objects

Store-immediate instructions have a non-extendable offset. Since the
actual offset for a stack object is not known until much later, only
generate these stores when the stack size (at the time of instruction
selection) is small.

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

7 years agoAlign definition of DW_OP_plus with DWARF spec [1/3]
Florian Hahn [Tue, 13 Jun 2017 16:54:44 +0000 (16:54 +0000)]
Align definition of DW_OP_plus with DWARF spec [1/3]

Summary:
This patch is part of 3 patches that together form a single patch, but must be introduced in stages in order not to break things.

The way that LLVM interprets DW_OP_plus in DIExpression nodes is basically that of the DW_OP_plus_uconst operator since LLVM expects an unsigned constant operand. This unnecessarily restricts the DW_OP_plus operator, preventing it from being used to describe the evaluation of runtime values on the expression stack. These patches try to align the semantics of DW_OP_plus and DW_OP_minus with that of the DWARF definition, which pops two elements off the expression stack, performs the operation and pushes the result back on the stack.

This is done in three stages:
• The first patch (LLVM) adds support for DW_OP_plus_uconst.
• The second patch (Clang) contains changes all its uses from DW_OP_plus to DW_OP_plus_uconst.
• The third patch (LLVM) changes the semantics of DW_OP_plus and DW_OP_minus to be in line with its DWARF meaning. This patch includes the bitcode upgrade from legacy DIExpressions.

Patch by Sander de Smalen.

Reviewers: pcc, echristo, aprantl

Reviewed By: aprantl

Subscribers: fhahn, aprantl, javed.absar, llvm-commits

Differential Revision: https://reviews.llvm.org/D33892

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

7 years agoForce RegisterStandardPasses to construct std::function in the IPO library.
Frederich Munch [Tue, 13 Jun 2017 16:48:41 +0000 (16:48 +0000)]
Force RegisterStandardPasses to construct std::function in the IPO library.

Summary: Fixes an issue using RegisterStandardPasses from a statically linked object before PassManagerBuilder::addGlobalExtension is called from a dynamic library.

Reviewers: efriedma, theraven

Reviewed By: efriedma

Subscribers: mehdi_amini, mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D33515

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

7 years ago[Hexagon] Generate multiply-high instruction in isel
Krzysztof Parzyszek [Tue, 13 Jun 2017 16:21:57 +0000 (16:21 +0000)]
[Hexagon] Generate multiply-high instruction in isel

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

7 years agobpf: clang-format on BPFAsmPrinter.cpp
Yonghong Song [Tue, 13 Jun 2017 16:17:20 +0000 (16:17 +0000)]
bpf: clang-format on BPFAsmPrinter.cpp

Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305301 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Don't kill live registers when creating mux out of tfr
Krzysztof Parzyszek [Tue, 13 Jun 2017 16:07:36 +0000 (16:07 +0000)]
[Hexagon] Don't kill live registers when creating mux out of tfr

When a mux instruction is created from a pair of complementary conditional
transfers, it can be placed at the location of either the earlier or the
later of the transfers. Since it will use the operands of the original
transfers, putting it in the earlier location may hoist a kill of a source
register that was originally further down. Make sure the kill flag is
removed if the register is still used afterwards.

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

7 years ago[PDB] Add a module descriptor for every object file
Reid Kleckner [Tue, 13 Jun 2017 15:49:13 +0000 (15:49 +0000)]
[PDB] Add a module descriptor for every object file

Summary:
Expose the module descriptor index and fill it in for section
contributions.

Reviewers: zturner

Subscribers: llvm-commits, ruiu, hiraditya

Differential Revision: https://reviews.llvm.org/D34126

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

7 years ago[MIPS] BuildCondBr should preserve MO flags
Simon Dardis [Tue, 13 Jun 2017 14:11:29 +0000 (14:11 +0000)]
[MIPS] BuildCondBr should preserve MO flags

While simplifying branches in the MachineInstr representation, the
routine BuildCondBr must preserve flags on register MachineOperands. In
particular, it must preserve the <undef> flag.

This fixes a bug that is unlikely to occur in any real scenario, but
which bugpoint is likely to introduce.

Patch By Nick Johnson!

Reviewers: ahatanak, sdardis

Differential Revision: https://reviews.llvm.org/D34041

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

7 years ago[Hexagon] Stop pmpy recognition when shift conversion fails
Krzysztof Parzyszek [Tue, 13 Jun 2017 13:51:49 +0000 (13:51 +0000)]
[Hexagon] Stop pmpy recognition when shift conversion fails

The conversion of shifts from right shifts to left shifts may fail.
In such case, the pmpy recognition cannot proceed.

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

7 years ago[ARM] Add scheduling classes for VFNM[AS]
Oliver Stannard [Tue, 13 Jun 2017 13:04:32 +0000 (13:04 +0000)]
[ARM] Add scheduling classes for VFNM[AS]

The VFNM[AS] instructions did not have scheduling information attached, which
was causing assertion failures with the Cortex-A57 scheduling model and
-fp-contract=fast, because the Cortex-A57 sched model claims to be complete.

Differential Revision: https://reviews.llvm.org/D34139

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

7 years agoStrip UTF8 BOM that got added in rL305091
Simon Pilgrim [Tue, 13 Jun 2017 10:17:57 +0000 (10:17 +0000)]
Strip UTF8 BOM that got added in rL305091

Seems my recent move to VS2017 has resulted in a few text editor issues.....

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

7 years ago[X86][SSE] Refactor getTargetConstantBitsFromNode to avoid large APInts (PR32037)
Simon Pilgrim [Tue, 13 Jun 2017 10:13:48 +0000 (10:13 +0000)]
[X86][SSE] Refactor getTargetConstantBitsFromNode to avoid large APInts (PR32037)

Much of PR32037's compile time regression is due to getTargetConstantBitsFromNode always creating large (>64bit) APInts during the bitcasting from the source data to the destination bitwidth.

This commit avoids this bitcast stage if the data is already the correct bitwidth.

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

7 years agoStrip UTF8 BOM that got added for some reason in rL305163
Simon Pilgrim [Tue, 13 Jun 2017 09:58:27 +0000 (09:58 +0000)]
Strip UTF8 BOM that got added for some reason in rL305163

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

7 years agoPPCISelLowering.cpp: Fix warnings in r305214. [-Wdocumentation]
NAKAMURA Takumi [Tue, 13 Jun 2017 07:34:32 +0000 (07:34 +0000)]
PPCISelLowering.cpp: Fix warnings in r305214. [-Wdocumentation]

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

7 years ago[AVX-512] Mark masked VPCMP instructions as commutable.
Craig Topper [Tue, 13 Jun 2017 07:13:50 +0000 (07:13 +0000)]
[AVX-512] Mark masked VPCMP instructions as commutable.

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

7 years ago[AVX-512] Mark masked version of vpcmpeq as being commutable.
Craig Topper [Tue, 13 Jun 2017 07:13:47 +0000 (07:13 +0000)]
[AVX-512] Mark masked version of vpcmpeq as being commutable.

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

7 years ago[X86] Add masked integer compare instructions to load folding tables.
Craig Topper [Tue, 13 Jun 2017 07:13:44 +0000 (07:13 +0000)]
[X86] Add masked integer compare instructions to load folding tables.

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

7 years agoRead /out:%t which was (accidentally?) removed in r305258.
Daniel Jasper [Tue, 13 Jun 2017 07:00:05 +0000 (07:00 +0000)]
Read /out:%t which was (accidentally?) removed in r305258.

Without it, the source directory gets polluted.

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

7 years ago[Lexicon] Add GVN
Brian Gesiak [Tue, 13 Jun 2017 03:06:16 +0000 (03:06 +0000)]
[Lexicon] Add GVN

Summary: Add a lexicon entry for global value numbering.

Reviewers: davide, majnemer

Reviewed By: davide

Subscribers: llvm-commits, inouehrs

Differential Revision: https://reviews.llvm.org/D33664

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

7 years agoInliner: Avoid calling shouldInline until it's absolutely necessary
David Blaikie [Tue, 13 Jun 2017 02:24:09 +0000 (02:24 +0000)]
Inliner: Avoid calling shouldInline until it's absolutely necessary

This restores the order of evaluation (& conditionalized evaluation) of
isTriviallyDeadInstruction, InlineHistoryIncludes, and shouldInline
(with the addition of a shouldInline call after
isTriviallyDeadInstruction) from before r305245.

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

7 years ago[WebAssembly] Fix symbol type for addresses of external functions
Sam Clegg [Tue, 13 Jun 2017 01:42:21 +0000 (01:42 +0000)]
[WebAssembly] Fix symbol type for addresses of external functions

These symbols were previously not being marked as functions
so were appearing as globals instead, and with the incorrect
relocation type.

Without this fix, objects that take address of external
functions include them as global imports rather than function
imports which then fails at link time.

Differential Revision: https://reviews.llvm.org/D34068

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

7 years agoFix signed/unsigned comparison warning; NFC
George Burgess IV [Tue, 13 Jun 2017 01:28:49 +0000 (01:28 +0000)]
Fix signed/unsigned comparison warning; NFC

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

7 years agoAdding one test that I forgot to include with the commit for https://reviews.llvm...
Wolfgang Pieb [Tue, 13 Jun 2017 00:42:03 +0000 (00:42 +0000)]
Adding one test that I forgot to include with the commit for https://reviews.llvm.org/D32779.
NFC

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

7 years agoRevert "Revert "Fix alignment bug in COFF emission.""
Eric Beckmann [Tue, 13 Jun 2017 00:19:43 +0000 (00:19 +0000)]
Revert "Revert "Fix alignment bug in COFF emission.""

This revert was done so that my other patch to add test framework could
land separately.  Now the revert can be reverted and this patch can
reland.

This reverts commit 18b3c75b2b0d32601fb60a06b9672c33d6f0dff9.

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

7 years agoUpdate the test framework for llvm-cvtres to be more comprehensive.
Eric Beckmann [Tue, 13 Jun 2017 00:16:32 +0000 (00:16 +0000)]
Update the test framework for llvm-cvtres to be more comprehensive.

Summary: Added test cases for multiple machine types, file merging, multiple languages, and more resource types.  Also fixed new bugs these tests exposed.

Subscribers: javed.absar, llvm-commits, hiraditya

Differential Revision: https://reviews.llvm.org/D34047

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

7 years agoRevert "Fix alignment bug in COFF emission."
Eric Beckmann [Tue, 13 Jun 2017 00:15:47 +0000 (00:15 +0000)]
Revert "Fix alignment bug in COFF emission."

I accidentally combined this patch with one for adding more tests, they
should be separated.

This reverts commit 3da218a523be78df32e637d3446ecf97c9ea0465.

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

7 years agoFix alignment bug in COFF emission.
Eric Beckmann [Tue, 13 Jun 2017 00:06:10 +0000 (00:06 +0000)]
Fix alignment bug in COFF emission.

Summary: Fix alignment issue in D34020, by aligning all sections to 8 bytes.

Reviewers: zturner

Subscribers: hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D34072

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

7 years ago[IR] Remove override of operator new from PHINode.
Craig Topper [Tue, 13 Jun 2017 00:00:19 +0000 (00:00 +0000)]
[IR] Remove override of operator new from PHINode.

This just forwarded to the same signature in User. The version in User is protected so there's no danger of anyone outside of PHINode constructing with the wrong operator new. All PHINodes are created by a static Create function in PHINode.

I believe at one point in history this called User::operator new(s, 0) so it was useful then.

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

7 years agoUpdate LangRef for PR27284.
Adrian Prantl [Mon, 12 Jun 2017 23:59:43 +0000 (23:59 +0000)]
Update LangRef for PR27284.

And reverse the ownership between DICompileUnit and DISubprogram.

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

7 years ago[WebAssembly] MC: Fix value of R_WEBASSEMBLY_TABLE_INDEX relocations
Sam Clegg [Mon, 12 Jun 2017 23:52:44 +0000 (23:52 +0000)]
[WebAssembly] MC: Fix value of R_WEBASSEMBLY_TABLE_INDEX relocations

Previously we were writing the value function index space
value but for these types of relocations we want to be
writing the table element index space value.

Add a test case for these relocation types that fails
without this change.

Differential Revision: https://reviews.llvm.org/D33962

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

7 years agoUse a fixed target triple to s to appease windows bots
Adrian Prantl [Mon, 12 Jun 2017 23:47:27 +0000 (23:47 +0000)]
Use a fixed target triple to s to appease windows bots

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

7 years ago[IR] Stop deleting other signatures of User::operator new when we override one signat...
Craig Topper [Mon, 12 Jun 2017 23:25:15 +0000 (23:25 +0000)]
[IR] Stop deleting other signatures of User::operator new when we override one signature in a class derived from User

User has 3 signatures for operator new today. They take a single size, a size and a number of users, and a size, number of users, and descriptor size.

Historically there used to only be one signature that took size and a number of uses. Long ago derived classes implemented their own versions that took just a size and would call the size and use count version. Then they left an unimplemented signature for the size and use count signature from User. As we moved to C++11 this unimplemented signature because = delete.

Since then operator new has picked up two new signatures for operator new. But when the 3 argument version was added it was never added to the delete list in all of the derived classes where the 2 argument version is deleted. This makes things inconsistent.

I believe once one version of operator new is created in a derived class name hiding will take care of making all of the base class signatures unavailable. So I don't think the deleted lines are needed at all.

This patch removes all of the deletes in cases where there is an override or there is already a delete of another signature (that should trigger name hiding too).

Differential Revision: https://reviews.llvm.org/D34120

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

7 years agoFix line endings.
Zachary Turner [Mon, 12 Jun 2017 23:15:47 +0000 (23:15 +0000)]
Fix line endings.

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

7 years ago[pdb] Don't choke on unknown symbol types.
Zachary Turner [Mon, 12 Jun 2017 23:10:31 +0000 (23:10 +0000)]
[pdb] Don't choke on unknown symbol types.

When we get an unknown symbol type, we might as well at least
dump it.  Same goes for round-tripping through YAML, we can
dump the record contents as raw bytes even if we don't know
how to interpret it semantically.

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

7 years agoInliner: Don't remove calls to readnone+nounwind (but not always_inline) functions...
David Blaikie [Mon, 12 Jun 2017 23:01:17 +0000 (23:01 +0000)]
Inliner: Don't remove calls to readnone+nounwind (but not always_inline) functions in the AlwaysInliner

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

7 years agoFix an assertion failure when duplicate dbg.declares are present.
Adrian Prantl [Mon, 12 Jun 2017 22:41:06 +0000 (22:41 +0000)]
Fix an assertion failure when duplicate dbg.declares are present.

This fixes PR33157.
https://bugs.llvm.org//show_bug.cgi?id=33157

We might also think about disallowing duplicate dbg.declare intrinsics
entirely, but this may complicate some passes needlessly.

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

7 years agofix typos/formatting; NFC
Sanjay Patel [Mon, 12 Jun 2017 22:34:37 +0000 (22:34 +0000)]
fix typos/formatting; NFC

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

7 years agoSupport: Don't set RLIMIT_AS on child processes when applying a memory limit
David Blaikie [Mon, 12 Jun 2017 22:16:49 +0000 (22:16 +0000)]
Support: Don't set RLIMIT_AS on child processes when applying a memory limit

It doesn't seem relevant to set an address space limit - this isn't
important in any sense that I'm aware & it gets in the way of things
that use a lot of address space, like llvm-symbolizer.

This came up when I realized that bugpoint regression tests were much
slower with -gsplit-dwarf than plain -g. Turned out that bugpoint
subprocesses (opt, etc) were crashing and doing symbolization - but
bugpoint runs those subprocesses with a 400MB memory limit. So with
plain -g, mmaping the opt binary would exceed the memory limit, fail,
and thus be really fast - no symbolization occurred. Whereas with
-gsplit-dwarf, comically, having less to map in, it would succeed and
then spend lots of time symbolizing.

I've fixed at least the critical part of bugpoint's perf problem there
by adding an option to allow bugpoint to disable symbolization. Thus
improving the perfromance for -gsplit-dwarf and making the -g-esque
speed available without this quirk/accidental benefit.

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

7 years ago[ADT] Add type-safe methods to FoldingSetImpl; NFC.
George Burgess IV [Mon, 12 Jun 2017 22:08:08 +0000 (22:08 +0000)]
[ADT] Add type-safe methods to FoldingSetImpl; NFC.

Thankfully, this hasn't uncovered any new bugs. With this, issues like
the one fixed in r305207 (hopefully) shouldn't happen again.

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

7 years agoFix printing error.
Zachary Turner [Mon, 12 Jun 2017 22:08:03 +0000 (22:08 +0000)]
Fix printing error.

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

7 years ago[llvm-pdbutil] Fix one more issue with no-id-stream PDBs.
Zachary Turner [Mon, 12 Jun 2017 21:57:41 +0000 (21:57 +0000)]
[llvm-pdbutil] Fix one more issue with no-id-stream PDBs.

This one occurred when we were dumping symbols, we have code
that is prepared to dump many different types of symbols,
including symbols which reference an ID stream.  So when creating
the dumper object, we assume that there is an ID stream.  Fix
this assumption.

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

7 years agoSlightly better fix for dealing with no-id-stream PDBs.
Zachary Turner [Mon, 12 Jun 2017 21:46:51 +0000 (21:46 +0000)]
Slightly better fix for dealing with no-id-stream PDBs.

The last fix required the user to manually add the required
feature.  This caused an LLD test to fail because I failed to
update LLD.  In practice we can hide this logic so it can just
be transparently added when we write the PDB.

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

7 years ago[llvm-pdbdump] Don't fail on PDBs with no ID stream.
Zachary Turner [Mon, 12 Jun 2017 21:34:53 +0000 (21:34 +0000)]
[llvm-pdbdump] Don't fail on PDBs with no ID stream.

Older PDBs don't have this.  Its presence is detected by using
the various "feature" flags that come at the end of the PDB
Stream.  Detect this, and don't try to dump the ID stream if the
features tells us it's not present.

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

7 years ago[RS4GC] Drop invalid metadata after pointers are relocated
Anna Thomas [Mon, 12 Jun 2017 21:26:53 +0000 (21:26 +0000)]
[RS4GC] Drop invalid metadata after pointers are relocated

Summary:
After RS4GC, we should drop metadata that is no longer valid. These metadata
is used by optimizations scheduled after RS4GC, and can cause a miscompile.
One such metadata is invariant.load which is used by LICM sinking transform.
After rewriting statepoints, the address of a load maybe relocated. With
invariant.load metadata on a load instruction, LICM sinking assumes the
loaded value (from a dererenceable address) to be invariant, and
rematerializes the load operand and the load at the exit block.
This transforms the IR to have an unrelocated use of the
address after a statepoint, which is incorrect.
Other metadata we conservatively remove are related to
dereferenceability and noalias metadata.

This patch drops such metadata on store and load instructions after
rewriting statepoints.

Reviewers: reames, sanjoy, apilipenko

Reviewed by: reames

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D33756

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

7 years agoAMDGPU/GlobalISel: Mark 32-bit G_ADD as legal
Tom Stellard [Mon, 12 Jun 2017 20:54:56 +0000 (20:54 +0000)]
AMDGPU/GlobalISel: Mark 32-bit G_ADD as legal

Reviewers: arsenm

Reviewed By: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, igorb, dstuttard, tpr, llvm-commits, t-tye

Differential Revision: https://reviews.llvm.org/D33992

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

7 years ago[ADT] Reduce duplication between {Contextual,}FoldingSet; NFC
George Burgess IV [Mon, 12 Jun 2017 20:52:53 +0000 (20:52 +0000)]
[ADT] Reduce duplication between {Contextual,}FoldingSet; NFC

This is a precursor to another change (coming soon) that aims to make
FoldingSet's API more type-safe. Without this, the type-safety change
would just duplicate 4 more public methods between the already very
similar classes.

This renames FoldingSetImpl to FoldingSetBase so it's consistent with
the FooBase -> FooImpl<T> -> Foo<T> convention we seem to have with
other containers.

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

7 years agoAArch64: don't try to emit an add (shifted reg) for SP.
Tim Northover [Mon, 12 Jun 2017 20:49:53 +0000 (20:49 +0000)]
AArch64: don't try to emit an add (shifted reg) for SP.

The "Add/sub (shifted reg)" instructions use the 31 encoding for xzr and wzr
rather than the SP, so we need to use different variants.

Situations where this actually comes up are rare enough (see test-case) that I
think falling back to DAG is fine.

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

7 years agoFix a null pointer dereference in llvm-pdbutil pretty.
Zachary Turner [Mon, 12 Jun 2017 20:46:35 +0000 (20:46 +0000)]
Fix a null pointer dereference in llvm-pdbutil pretty.

Static data members were causing a problem because I mistakenly
assumed all members would affect a class's layout and so the
Layout member would be non-null.

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

7 years agoSplitKit: Fix partially live subreg splitting
Matthias Braun [Mon, 12 Jun 2017 20:30:52 +0000 (20:30 +0000)]
SplitKit: Fix partially live subreg splitting

Fix thinko/typo in subreg aware liverange splitting logic. I'm not sure
how to write a proper testcase for this. The original problem only
happens on an out-of-tree target. Forcing subreg enabled targets to
spill and split in a predictable way is near impossible.

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

7 years agoIR: Replace the "Linker Options" module flag with "llvm.linker.options" named metadata.
Peter Collingbourne [Mon, 12 Jun 2017 20:10:48 +0000 (20:10 +0000)]
IR: Replace the "Linker Options" module flag with "llvm.linker.options" named metadata.

The new metadata is easier to manipulate than module flags.

Differential Revision: https://reviews.llvm.org/D31349

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

7 years agoRemove unneeded conditionals - the code is already conditional on the same condition
David Blaikie [Mon, 12 Jun 2017 20:09:53 +0000 (20:09 +0000)]
Remove unneeded conditionals - the code is already conditional on the same condition

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

7 years agoAdd EOL at EOF to appease source utils like unifdef
Tim Hammerquist [Mon, 12 Jun 2017 20:08:55 +0000 (20:08 +0000)]
Add EOL at EOF to appease source utils like unifdef

<rdar://problem/32511256>

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

7 years ago[llvm-ar] Make llvm-lib behave more like the MSVC archiver
Reid Kleckner [Mon, 12 Jun 2017 19:45:35 +0000 (19:45 +0000)]
[llvm-ar] Make llvm-lib behave more like the MSVC archiver

Summary:
Use the filepath used to open the archive member as the archive member
name instead of the file basename. This path might be absolute or
relative.  This is important because the archive member name will show
up in the PDB, and we want our PDBs to look as much like MSVC's as
possible.

This also helps avoid an issue in our PDB module descriptor writing
code, which assumes that all module names are unique. Relative paths
still aren't guaranteed to be unique, but they're much better than
basenames, which definitely aren't unique.

Reviewers: ruiu, zturner

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D33575

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

7 years agoAddressed Takumi's comment about redundancy.
Galina Kistanova [Mon, 12 Jun 2017 19:17:55 +0000 (19:17 +0000)]
Addressed Takumi's comment about redundancy.

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

7 years ago[DWARF] Added a blank line in llvm-dwarfdump to test commit access.
Spyridoula Gravani [Mon, 12 Jun 2017 19:04:28 +0000 (19:04 +0000)]
[DWARF] Added a blank line in llvm-dwarfdump to test commit access.

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

7 years agoSame expressions on both sides of the return
Sylvestre Ledru [Mon, 12 Jun 2017 18:53:46 +0000 (18:53 +0000)]
Same expressions on both sides of the return

Summary:
I guess we want PointerToMemberFunction & PointerToDataMember

Fix coverity cid 1376038

Reviewers: zturner

Reviewed By: zturner

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D34110

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

7 years ago[PowerPC] Match vec_revb builtins to P9 instructions.
Tony Jiang [Mon, 12 Jun 2017 18:24:36 +0000 (18:24 +0000)]
[PowerPC] Match vec_revb builtins to P9 instructions.

Power9 has instructions that will reverse the bytes within an element for all
sizes (half-word, word, double-word and quad-word). These can be used for the
vec_revb builtins in altivec.h. However, we implement these to match vector
shuffle nodes as that will cover both the builtins and vector shuffles that
occur in the SDAG through other means.

Differential Revision: https://reviews.llvm.org/D33690

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

7 years ago[Power9] Added support for the modsw, moduw, modsd, modud hardware instructions.
Tony Jiang [Mon, 12 Jun 2017 17:58:42 +0000 (17:58 +0000)]
[Power9] Added support for the modsw, moduw, modsd, modud hardware instructions.

Note that if we need the result of both the divide and the modulo then we
compute the modulo based on the result of the divide and not using the new
hardware instruction.

Commit on behalf of STEFAN PINTILIE.
Differential Revision: https://reviews.llvm.org/D33940

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

7 years ago[llvm-ar] Fix AddNewMember typo in enum
Reid Kleckner [Mon, 12 Jun 2017 17:44:42 +0000 (17:44 +0000)]
[llvm-ar] Fix AddNewMember typo in enum

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

7 years ago[utils] remove ability to generate llc check lines from update_test_checks.py
Sanjay Patel [Mon, 12 Jun 2017 17:44:30 +0000 (17:44 +0000)]
[utils] remove ability to generate llc check lines from update_test_checks.py

The dream of a unified check-line auto-generator for all phases of compilation is dead.
The llc script has already diverged to be better at its goal, so having 2 scripts that
do almost the same thing just causes confusion. Now, this script will only work with
opt to produce check lines for IR transforms.

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

7 years ago[x86] regenerate checks with update_llc_test_checks.py
Sanjay Patel [Mon, 12 Jun 2017 17:31:36 +0000 (17:31 +0000)]
[x86] regenerate checks with update_llc_test_checks.py

The dream of a unified check-line auto-generator for all phases of compilation is dead.
The llc script has already diverged to be better at its goal, so having 2 scripts that
do almost the same thing is just causing confusion.

We can rip out the llc ability in update_test_checks.py next and rename it, so it will
be clear that we have one script for llc check auto-generation and another for opt.

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

7 years agoAMDGPU: Don't add same implicit use multiple times
Matt Arsenault [Mon, 12 Jun 2017 17:19:20 +0000 (17:19 +0000)]
AMDGPU: Don't add same implicit use multiple times

For the last component, the same register use
was added as an implicit use and another implicit kill use.

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