5 years agoForgot to add triple to test in r308513.
Wolfgang Pieb [Wed, 19 Jul 2017 21:45:21 +0000 (21:45 +0000)]
Forgot to add triple to test in r308513.

llvm-svn: 308527

5 years agoUse StringRef::contains().
Rui Ueyama [Wed, 19 Jul 2017 21:40:26 +0000 (21:40 +0000)]
Use StringRef::contains().

llvm-svn: 308526

5 years ago[TRE] Add another test for OptRemark.
Davide Italiano [Wed, 19 Jul 2017 21:39:51 +0000 (21:39 +0000)]
[TRE] Add another test for OptRemark.

This shows we emit a remark for tail recursion -> loop.

llvm-svn: 308525

5 years ago[TRE] Move to the new OptRemark API.
Davide Italiano [Wed, 19 Jul 2017 21:13:22 +0000 (21:13 +0000)]
[TRE] Move to the new OptRemark API.

Fixes PR33788.

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

llvm-svn: 308524

5 years agoFix one more occurrence of getOption().getID().
Rui Ueyama [Wed, 19 Jul 2017 21:06:46 +0000 (21:06 +0000)]
Fix one more occurrence of getOption().getID().

llvm-svn: 308523

5 years agoMake byref llvm::Use parameters const. NFC.
Michael Kruse [Wed, 19 Jul 2017 20:41:56 +0000 (20:41 +0000)]
Make byref llvm::Use parameters const. NFC.

llvm-svn: 308522

5 years ago[yaml2obj][ELF] Add support for program headers
Petr Hosek [Wed, 19 Jul 2017 20:38:46 +0000 (20:38 +0000)]
[yaml2obj][ELF] Add support for program headers

This change adds basic support for program headers.

I need to do some testing which requires generating program headers but
I can't use ld.lld or clang to produce programs that have headers. I'd
also like to test some strange things that those programs may never

Patch by Jake Ehrlich

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

llvm-svn: 308520

5 years agoHandle option aliases in a better way.
Rui Ueyama [Wed, 19 Jul 2017 20:30:04 +0000 (20:30 +0000)]
Handle option aliases in a better way.

In this way, we don't need to know which options have aliases.

llvm-svn: 308519

5 years ago[AArch64] Force relocations for all ADRP instructions
Martin Storsjo [Wed, 19 Jul 2017 20:14:32 +0000 (20:14 +0000)]
[AArch64] Force relocations for all ADRP instructions

This generalizes an existing fix from ELF to MachO and COFF.

Test that an ADRP to a local symbol whose offset is known at assembly
time still produces relocations, both for MachO and COFF. Test that
an ADRP without a @page modifier on MachO fails (previously it

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

llvm-svn: 308518

5 years ago[AArch64, COFF] Interpret .align as power of two for COFF as well
Martin Storsjo [Wed, 19 Jul 2017 20:14:24 +0000 (20:14 +0000)]
[AArch64, COFF] Interpret .align as power of two for COFF as well

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

llvm-svn: 308517

5 years agoFixing an issue with the initialization of LexicalScopes objects when mixing debug
Wolfgang Pieb [Wed, 19 Jul 2017 19:36:40 +0000 (19:36 +0000)]
Fixing an issue with the initialization of LexicalScopes objects when mixing debug
and non-debug units.

Patch by Andrea DiBiagio.

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

llvm-svn: 308513

5 years ago[CMake] Fix r307650: Readd missing dependency.
Philip Pfaffe [Wed, 19 Jul 2017 19:20:58 +0000 (19:20 +0000)]
[CMake] Fix r307650: Readd missing dependency.

The commit erroneously removed the dependency of the Polly tests on
things like opt and FileCheck. Add that dependency back.

llvm-svn: 308512

5 years ago[Hexagon] Fix a bug in r308502: post-inc offset is always 0
Krzysztof Parzyszek [Wed, 19 Jul 2017 19:17:32 +0000 (19:17 +0000)]
[Hexagon] Fix a bug in r308502: post-inc offset is always 0

llvm-svn: 308510

5 years agoFix GreenDragon bots
Chris Bieneman [Wed, 19 Jul 2017 18:57:16 +0000 (18:57 +0000)]
Fix GreenDragon bots

This commit removes a very old deprecated API that was causing compile failures for LLDB on Darwin. Since the comment says we only needed to keep the old API around for a few Xcode builds, and the comment was written 6 years ago... I think this can safely go away.

Failure URL:

llvm-svn: 308509

5 years ago[cmake] GetSVN.cmake takes a list of arguments
Brian Gesiak [Wed, 19 Jul 2017 18:37:02 +0000 (18:37 +0000)]
[cmake] GetSVN.cmake takes a list of arguments

GetSVN.cmake currently takes one or two pairs of <source directory path,
name>, then attempts to get the remote repository URL and source control
revision of the repositories at those one or two paths.

It takes two pairs in order for Clang to get the revision of both
itself, and its dependency LLVM.

For projects that rely upon both LLVM and Clang (Apple's Swift is one
example, but there are others), GetSVN.cmake is used to fetch *three*
revisions: Swift, Clang, and LLVM.

To support this use case, change GetSVN.cmake: instead of taking one or
two pairs (specified via `FIRST_SOURCE_DIR`/`FIRST_NAME`, have it take a list
of pairs (`SOURCE_DIRS`/`NAMES`).

In order to allow Clang to migrate, have GetSVN.cmake support both sets
of arguments for now. The old arguments can be removed once Clang begins
using the new arguments, and Swift can follow when it updates its
copy of LLVM.

Test Plan:
1. Perform a clean build of Clang, verify that `clang --version` still
   prints the correct LLVM and Clang revision information.
2. Modify Clang's CMake to use the new arguments, then perform another
   clean build. `clang --version` should still print the correct
   revision information.

Reviewers: jordan_rose, beanz, probinson

Subscribers: echristo, chapuni, llvm-commits, mgorny

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

llvm-svn: 308507

5 years agoDon't depend on these symbols being implicitly global.
Rafael Espindola [Wed, 19 Jul 2017 18:24:38 +0000 (18:24 +0000)]
Don't depend on these symbols being implicitly global.

This might change in llvm-mc and it is nice to be explicit in a test.

llvm-svn: 308506

5 years ago[docs] Minor formatting fixes.
Eli Friedman [Wed, 19 Jul 2017 18:18:37 +0000 (18:18 +0000)]
[docs] Minor formatting fixes.

Patch by Tarun Rajendran.

llvm-svn: 308505

5 years agoLTO: Export functions referenced by the CFI jump table.
Peter Collingbourne [Wed, 19 Jul 2017 18:18:19 +0000 (18:18 +0000)]
LTO: Export functions referenced by the CFI jump table.

If the LowerTypeTests pass decides to add a function to a jump
table for CFI, it will add its name to the set cfiFunctionDefs,
which among other things will cause the function to be renamed in
the ThinLTO backend.

One other thing that we must do with such functions is to not
internalize them, because the jump table in the full LTO object will
contain a reference to the actual function body in the ThinLTO object.

This patch handles that by ensuring that we export any functions
whose names appear in the cfiFunctionDefs set.

Fixes PR33831.

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

llvm-svn: 308504

5 years ago[X86] Don't try to scale down if that exceeds the bitwidth.
Davide Italiano [Wed, 19 Jul 2017 18:09:46 +0000 (18:09 +0000)]
[X86] Don't try to scale down if that exceeds the bitwidth.

Fixes the crash reported in PR33844.

llvm-svn: 308503

5 years ago[Hexagon] Handle subregisters in areMemAccessesTriviallyDisjoint
Krzysztof Parzyszek [Wed, 19 Jul 2017 18:03:46 +0000 (18:03 +0000)]
[Hexagon] Handle subregisters in areMemAccessesTriviallyDisjoint

llvm-svn: 308502

5 years ago[FIX] Update test/ScheduleOptimizer/pattern-matching-based-opts_11.ll.
Roman Gareev [Wed, 19 Jul 2017 18:01:51 +0000 (18:01 +0000)]
[FIX] Update test/ScheduleOptimizer/pattern-matching-based-opts_11.ll.

llvm-svn: 308501

5 years agoThinLTOBitcodeWriter: Do not rewrite intrinsic functions when splitting modules.
Peter Collingbourne [Wed, 19 Jul 2017 17:54:29 +0000 (17:54 +0000)]
ThinLTOBitcodeWriter: Do not rewrite intrinsic functions when splitting modules.

Changing the type of an intrinsic may invalidate the IR.

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

llvm-svn: 308500

5 years ago[FIX] Fix pattern-matching-based-opts_11.ll.
Roman Gareev [Wed, 19 Jul 2017 17:33:42 +0000 (17:33 +0000)]
[FIX] Fix pattern-matching-based-opts_11.ll.

llvm-svn: 308499

5 years agoAdd AlignedAllocation.h.
Akira Hatanaka [Wed, 19 Jul 2017 17:26:42 +0000 (17:26 +0000)]
Add AlignedAllocation.h.

I forgot to "git add" it in r308496.

llvm-svn: 308498

5 years ago[PDB] Emit TPI and IPI hashes
Reid Kleckner [Wed, 19 Jul 2017 17:26:07 +0000 (17:26 +0000)]
[PDB] Emit TPI and IPI hashes

llvm-svn: 308497

5 years ago[Sema] Improve diagnostic message for unavailable C++17 aligned
Akira Hatanaka [Wed, 19 Jul 2017 17:17:50 +0000 (17:17 +0000)]
[Sema] Improve diagnostic message for unavailable C++17 aligned
allocation functions.

This changes the error message Sema prints when an unavailable C++17
aligned allocation function is selected.

Original message: "... possibly unavailable on x86_64-apple-macos10.12"
New message: "... only available on macOS 10.13 or newer"

This is a follow-up to r306722.


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

llvm-svn: 308496

5 years ago[ScopInfo] Integrate ScalarDefUseChain into polly::Scop. NFC.
Michael Kruse [Wed, 19 Jul 2017 17:11:25 +0000 (17:11 +0000)]
[ScopInfo] Integrate ScalarDefUseChain into polly::Scop. NFC.

Before this patch, ScalarDefUseChain was a tool used by DeLICM to find
all reads and writes of scalar accesses. It iterated once over all
accesses and stores the accesses into maps.

By integrating it into the Scop class, we can keep the maps up-to-date
without the need for recomputing them. It will be needed for more than
DeLICM in the future, such as SCoP simplification, code movement between
virtual statements, and array expansion (GSoC project).

Compared to ScalarUseDefChain, we save two maps by finding the ScopStmt
a Def/PHIRead must reside in, and use its already existing lookup
function to find the MemoryAccess.

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

llvm-svn: 308495

5 years agoMake the pattern matching work with modified memory accesses
Roman Gareev [Wed, 19 Jul 2017 16:59:06 +0000 (16:59 +0000)]
Make the pattern matching work with modified memory accesses

Some optimizations (e.g., DeLICM) can modify memory accesses (e.g., change
their MemoryKind). Consequently, the pattern matching should take it into
the account.

Reviewed-by: Tobias Grosser <tobias@grosser.es>,
             Michael Kruse <llvm@meinersbur.de>

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

llvm-svn: 308494

5 years agoGlobalISel: select G_EXTRACT and G_INSERT instructions on AArch64.
Tim Northover [Wed, 19 Jul 2017 16:47:07 +0000 (16:47 +0000)]
GlobalISel: select G_EXTRACT and G_INSERT instructions on AArch64.

llvm-svn: 308493

5 years agoBring back r307364.
Rafael Espindola [Wed, 19 Jul 2017 16:45:05 +0000 (16:45 +0000)]
Bring back r307364.

In addition this includes a change to prefer symbols with a default
version @@ over unversioned symbols.

Original commit message:

[ELF] - Handle symbols with default version early.

This fixes last testcase provided in PR28414.
In short issue is next: when we had X@@Version symbol in object A,
we did not resolve it to X early. Then when in another object B
we had reference to undefined X, symbol X from archive was fetched.
Since both archive and object A contains another symbol Z, duplicate
symbol definition was triggered as a result.

Correct behavior is to use X@@Version from object A instead and do not fetch
any symbols from archive.

Differential revision: https://reviews.llvm.org/D35059

llvm-svn: 308492

5 years ago[ScopInfo] Do not create entries in map if non exists
Tobias Grosser [Wed, 19 Jul 2017 16:31:10 +0000 (16:31 +0000)]
[ScopInfo] Do not create entries in map if non exists

Suggested-by: Michael Kruse <llvm@meinersbur.de>
llvm-svn: 308491

5 years ago[Solaris] enable --whole-archive for shared-library build, disable --version-script...
Sylvestre Ledru [Wed, 19 Jul 2017 16:07:51 +0000 (16:07 +0000)]
[Solaris] enable --whole-archive for shared-library build, disable --version-script for Solaris-ld
Shared-library build on Solaris requires --whole-archive to be specified (option accepted by all available linkers).

At the same time, --version-script can not be handled by Solaris-ld, so it should be skipped.
-M is of no use here, since there is no syntax in Solaris-ld mapfiles that allows to version all global symbols,
not just the named ones (at least this is my impression from digging deep into the docs).

Patch by Fedor Sergeev <fedor.sergeev@oracle.com>

llvm-svn: 308490

5 years agosilence a couple of -Wqual-cast warning from GCC (NFC)
Saleem Abdulrasool [Wed, 19 Jul 2017 15:46:21 +0000 (15:46 +0000)]
silence a couple of -Wqual-cast warning from GCC (NFC)

Cast to `const uint8_t *` instead of `uint8_t *` to avoid the warning
from GCC.

  EmulationStateARM.cpp:206:34: warning: cast from type 'const void*' to type 'uint8_t* {aka unsigned char*}' casts away qualifiers [-Wcast-qual]

Cast to `const uint32_t *` and the explicitly cast away the const-ness
of the value.  This seems pretty sketchy as the `DataExtractor` holds a
const reference to the data.  However, this is no worse than before.

  ObjectFilePECOFF.cpp:540:78: warning: cast from type 'const uint8_t* {aka const unsigned char*}' to type 'uint32_t* {aka unsigned int*}' casts away qualifiers [-Wcast-qual]

llvm-svn: 308489

5 years ago[clangd] Allow specifying -resource-dir
Krasimir Georgiev [Wed, 19 Jul 2017 15:43:35 +0000 (15:43 +0000)]
[clangd] Allow specifying -resource-dir

Summary: This patch allows clangd to specify its -resource-dir.

Reviewers: bkramer, klimek

Reviewed By: bkramer

Subscribers: cfe-commits

Tags: #clang-tools-extra

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

llvm-svn: 308486

5 years ago[Hexagon] Handle subregisters and non-immediates in getBaseAndOffset
Krzysztof Parzyszek [Wed, 19 Jul 2017 15:39:28 +0000 (15:39 +0000)]
[Hexagon] Handle subregisters and non-immediates in getBaseAndOffset

llvm-svn: 308485

5 years agoDefeat another -Wunused-but-set-variable warning
Hans Wennborg [Wed, 19 Jul 2017 15:06:31 +0000 (15:06 +0000)]
Defeat another -Wunused-but-set-variable warning

llvm-svn: 308484

5 years agoDefeat a GCC -Wunused-result warning
Hans Wennborg [Wed, 19 Jul 2017 15:03:38 +0000 (15:03 +0000)]
Defeat a GCC -Wunused-result warning

It was warning like:

../llvm-project/llvm/lib/Support/ErrorHandling.cpp:172:51: warning:
ignoring return value of ‘ssize_t write(int, const void*, size_t)’,
         declared with attribute warn_unused_result [-Wunused-result]
            (void)::write(2, OOMMessage, strlen(OOMMessage));

Work around the warning by storing the return value in a variable and
casting that to void instead. We already did this for the other write()
call in this file.

llvm-svn: 308483

5 years agoExpose hit count via SBBreakpointLocation.
Bruce Mitchener [Wed, 19 Jul 2017 14:31:19 +0000 (14:31 +0000)]
Expose hit count via SBBreakpointLocation.

SBBreakpointLocation exposed the ignore count, but didn't expose
the hit count. Both values were exposed by SBBreakpoint and
SBWatchpoint, so this makes things a bit more consistent.

Reviewers: lldb-commits

Subscribers: lldb-commits

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

llvm-svn: 308480

5 years agoClear release notes for 6.0.0
Hans Wennborg [Wed, 19 Jul 2017 14:15:27 +0000 (14:15 +0000)]
Clear release notes for 6.0.0

llvm-svn: 308479

5 years agoClear release notes for 6.0.0
Hans Wennborg [Wed, 19 Jul 2017 14:14:07 +0000 (14:14 +0000)]
Clear release notes for 6.0.0

llvm-svn: 308478

5 years agoClear release notes for 6.0.0
Hans Wennborg [Wed, 19 Jul 2017 14:11:00 +0000 (14:11 +0000)]
Clear release notes for 6.0.0

llvm-svn: 308477

5 years ago[docs] Document how to debug instruction scheduling model generation
Joel Jones [Wed, 19 Jul 2017 14:10:42 +0000 (14:10 +0000)]
[docs] Document how to debug instruction scheduling model generation


+ Exact tablegen command and how to get it
+ tablegen command debug option for subtarget generation
+ Use of schedcover.py on the debug output to determine coverage

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

llvm-svn: 308476

5 years agoClear release notes for 6.0.0
Hans Wennborg [Wed, 19 Jul 2017 14:09:52 +0000 (14:09 +0000)]
Clear release notes for 6.0.0

llvm-svn: 308475

5 years agoClear release notes for 6.0.0
Hans Wennborg [Wed, 19 Jul 2017 14:09:16 +0000 (14:09 +0000)]
Clear release notes for 6.0.0

llvm-svn: 308474

5 years ago[Simplify] Ensure all counters are reset before next SCoP is processed. NFC.
Michael Kruse [Wed, 19 Jul 2017 14:07:21 +0000 (14:07 +0000)]
[Simplify] Ensure all counters are reset before next SCoP is processed. NFC.

llvm-svn: 308473

5 years agoUpdate _LIBCPP_VERSION and the version in CMakeLists to 6.0
Hans Wennborg [Wed, 19 Jul 2017 13:57:10 +0000 (13:57 +0000)]
Update _LIBCPP_VERSION and the version in CMakeLists to 6.0

llvm-svn: 308468

5 years agoBump docs version to 6.0
Hans Wennborg [Wed, 19 Jul 2017 13:51:07 +0000 (13:51 +0000)]
Bump docs version to 6.0

llvm-svn: 308467

5 years agoBump docs version to 6.0
Hans Wennborg [Wed, 19 Jul 2017 13:50:27 +0000 (13:50 +0000)]
Bump docs version to 6.0

llvm-svn: 308466

5 years agoBump docs version to 6.0
Hans Wennborg [Wed, 19 Jul 2017 13:49:39 +0000 (13:49 +0000)]
Bump docs version to 6.0

llvm-svn: 308465

5 years agoBump docs version to 6.0
Hans Wennborg [Wed, 19 Jul 2017 13:48:55 +0000 (13:48 +0000)]
Bump docs version to 6.0

llvm-svn: 308464

5 years agoBump docs version to 6.0
Hans Wennborg [Wed, 19 Jul 2017 13:47:08 +0000 (13:47 +0000)]
Bump docs version to 6.0

llvm-svn: 308463

5 years agoBump docs version to 6.0
Hans Wennborg [Wed, 19 Jul 2017 13:46:11 +0000 (13:46 +0000)]
Bump docs version to 6.0

llvm-svn: 308462

5 years agoUpdate version to 6.0.0svn
Hans Wennborg [Wed, 19 Jul 2017 13:42:18 +0000 (13:42 +0000)]
Update version to 6.0.0svn

llvm-svn: 308461

5 years ago{DAGCombine] Convert (Val & Mask) == Mask to Mask.isSubsetof(Val). NFCI.
Simon Pilgrim [Wed, 19 Jul 2017 13:39:58 +0000 (13:39 +0000)]
{DAGCombine] Convert (Val & Mask) == Mask to Mask.isSubsetof(Val). NFCI.

llvm-svn: 308460

5 years agoRevert "Reland "[mips] Teach the driver to accept -m(no-)gpopt.""
Simon Dardis [Wed, 19 Jul 2017 13:34:08 +0000 (13:34 +0000)]
Revert "Reland "[mips] Teach the driver to accept -m(no-)gpopt.""

This reverts r308458. Investigating further buildbot breakage.

llvm-svn: 308459

5 years agoReland "[mips] Teach the driver to accept -m(no-)gpopt."
Simon Dardis [Wed, 19 Jul 2017 13:12:37 +0000 (13:12 +0000)]
Reland "[mips] Teach the driver to accept -m(no-)gpopt."

This patch teaches the driver to pass -mgpopt by default to the backend when it
is supported, i.e. we are using -mno-abicalls.

Reviewers: atanasyan, slthakur

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

This version fixes a logic error that generated warnings incorrectly.

llvm-svn: 308458

5 years ago[ARM] Unify handling of M-Class system registers
Javed Absar [Wed, 19 Jul 2017 12:57:16 +0000 (12:57 +0000)]
[ARM] Unify handling of M-Class system registers

This patch cleans up and fixes issues in the M-Class system register handling:

1. It defines the system registers and the encoding (SYSm values) in one place:
   a new ARMSystemRegister.td using SearchableTable, thereby removing the
   hand-coded values which existed in multiple places.

2. Some system registers e.g. BASEPRI_MAX_NS which do not exist were being allowed!
   Ref: ARMv6/7/8M architecture reference manual.

Reviewed by: @t.p.northover, @olist01, @john.brawn
Differential Revision: https://reviews.llvm.org/D35209

llvm-svn: 308456

5 years agoRevert r308441 "Recommit r308327: Add a warning for missing '#pragma pack (pop)'...
Hans Wennborg [Wed, 19 Jul 2017 12:31:01 +0000 (12:31 +0000)]
Revert r308441 "Recommit r308327: Add a warning for missing '#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files"

This seems to have broken the sanitizer-x86_64-linux buildbot. Reverting until
it's fixed, especially since this landed just before the 5.0 branch.

> This commit adds a new -Wpragma-pack warning. It warns in the following cases:
> - When a translation unit is missing terminating #pragma pack (pop) directives.
> - When entering an included file if the current alignment value as determined
>   by '#pragma pack' directives is different from the default alignment value.
> - When leaving an included file that changed the state of the current alignment
>   value.
> rdar://10184173
> Differential Revision: https://reviews.llvm.org/D35484

llvm-svn: 308455

5 years agoUpdate trunk version to 6.0.0svn
Hans Wennborg [Wed, 19 Jul 2017 12:19:01 +0000 (12:19 +0000)]
Update trunk version to 6.0.0svn

llvm-svn: 308442

5 years agoRecommit r308327: Add a warning for missing '#pragma pack (pop)'
Alex Lorenz [Wed, 19 Jul 2017 11:30:41 +0000 (11:30 +0000)]
Recommit r308327: Add a warning for missing '#pragma pack (pop)'
and suspicious uses of '#pragma pack' in included files

This commit adds a new -Wpragma-pack warning. It warns in the following cases:

- When a translation unit is missing terminating #pragma pack (pop) directives.
- When entering an included file if the current alignment value as determined
  by '#pragma pack' directives is different from the default alignment value.
- When leaving an included file that changed the state of the current alignment


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

llvm-svn: 308441

5 years ago[ScopInfo] Use AnyPHINode in tryGetValueStored()
Tobias Grosser [Wed, 19 Jul 2017 11:30:18 +0000 (11:30 +0000)]
[ScopInfo] Use AnyPHINode in tryGetValueStored()

This was an oversight in the previous commit. Michael already suggested this

llvm-svn: 308440

5 years agoRecommit r274270, [CMake] Module builds depend on target intrinsics_gen to be built...
NAKAMURA Takumi [Wed, 19 Jul 2017 11:27:31 +0000 (11:27 +0000)]
Recommit r274270, [CMake] Module builds depend on target intrinsics_gen to be built first.

The builder clang-x86_64-linux-selfhost-modules-2 complains. Investigating.

llvm-svn: 308439

5 years agoFix compilation problem introduced in r308433
Erik Verbruggen [Wed, 19 Jul 2017 11:15:36 +0000 (11:15 +0000)]
Fix compilation problem introduced in r308433

llvm-svn: 308438

5 years ago[Test] Do not pipe binary data to FileCheck.
Michael Kruse [Wed, 19 Jul 2017 11:12:16 +0000 (11:12 +0000)]
[Test] Do not pipe binary data to FileCheck.

llvm-svn: 308437

5 years agoRevert "[mips] Teach the driver to accept -m(no-)gpopt."
Simon Dardis [Wed, 19 Jul 2017 11:11:02 +0000 (11:11 +0000)]
Revert "[mips] Teach the driver to accept -m(no-)gpopt."

Revert r308431 and r308432, these caused broke some buildbots.

llvm-svn: 308436

5 years ago[ScopInfo] Introduce tryGetValueStored
Tobias Grosser [Wed, 19 Jul 2017 11:09:16 +0000 (11:09 +0000)]
[ScopInfo] Introduce tryGetValueStored

This makes code more readable and allows to reuse this functionality in
the future at other places.

Suggested-by Michael Kruse in post-commit review of r307660.

Reviewers: Meinersbur, bollu, gareevroman, efriedma, huihuiz, sebpop, simbuerg

Reviewed By: Meinersbur

Subscribers: pollydev, llvm-commits

Tags: #polly

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

llvm-svn: 308435

5 years agoRevert r274270, "[CMake] Module builds depend on target intrinsics_gen to be built...
NAKAMURA Takumi [Wed, 19 Jul 2017 10:47:38 +0000 (10:47 +0000)]
Revert r274270, "[CMake] Module builds depend on target intrinsics_gen to be built first."

I think modulemap is sufficient for intrinsics_gen in trunk. I won't find any issues around that.

llvm-svn: 308434

5 years agoAdd default values for function parameter chunks
Erik Verbruggen [Wed, 19 Jul 2017 10:45:40 +0000 (10:45 +0000)]
Add default values for function parameter chunks

Append optional chunks with their default values. For example:
before - "int i", after - "int i = 10"

Patch by Ivan Donchevskii!

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

llvm-svn: 308433

5 years ago[mips] Add warning test for -mgpopt option.
Simon Dardis [Wed, 19 Jul 2017 10:39:15 +0000 (10:39 +0000)]
[mips] Add warning test for -mgpopt option.

llvm-svn: 308432

5 years ago[mips] Teach the driver to accept -m(no-)gpopt.
Simon Dardis [Wed, 19 Jul 2017 10:38:03 +0000 (10:38 +0000)]
[mips] Teach the driver to accept -m(no-)gpopt.

This patch teaches the driver to pass -mgpopt by default to the backend when it
is supported, i.e. we are using -mno-abicalls.

Reviewers: atanasyan, slthakur

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

llvm-svn: 308431

5 years ago[X86][XOP] Use default AVX2 lowering for v4i64 ashr by splat constants
Simon Pilgrim [Wed, 19 Jul 2017 10:29:31 +0000 (10:29 +0000)]
[X86][XOP] Use default AVX2 lowering for v4i64 ashr by splat constants

XOP shifts only support 128-bit vectors, so we were ending up with less optimal codegen requiring constants

llvm-svn: 308430

5 years ago[SystemZ] Minor fixing in SystemZScheduleZ14.td
Jonas Paulsson [Wed, 19 Jul 2017 10:19:21 +0000 (10:19 +0000)]
[SystemZ]  Minor fixing in SystemZScheduleZ14.td

Some minor corrections for recently added instructions.

Review: Ulrich Weigand
llvm-svn: 308429

5 years ago[LoopUtils] Add an extra parameter OpValue to propagateIRFlags function,
Dinar Temirbulatov [Wed, 19 Jul 2017 10:02:07 +0000 (10:02 +0000)]
[LoopUtils] Add an extra parameter OpValue to propagateIRFlags function,
If OpValue is non-null, we only consider operations similar to OpValue
when intersecting.

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

llvm-svn: 308428

5 years agoUpdate clang-cl options in the users manual
Hans Wennborg [Wed, 19 Jul 2017 09:52:24 +0000 (09:52 +0000)]
Update clang-cl options in the users manual

llvm-svn: 308427

5 years agoFix typos in documentation.
Bruce Mitchener [Wed, 19 Jul 2017 09:35:58 +0000 (09:35 +0000)]
Fix typos in documentation.

Reviewers: lldb-commits

Subscribers: lldb-commits

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

llvm-svn: 308426

5 years agoUpdate API headers.
Bruce Mitchener [Wed, 19 Jul 2017 09:30:04 +0000 (09:30 +0000)]
Update API headers.

* Provide API doc for SBProcess::SaveCore.
* Fix typo in SBAttachInfo doc comments.
* SBBreakpointList: Name some variables same as C++.

Subscribers: lldb-commits

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

llvm-svn: 308425

5 years ago[globalisel][tablegen] 80-col corrections.
Daniel Sanders [Wed, 19 Jul 2017 09:28:20 +0000 (09:28 +0000)]
[globalisel][tablegen] 80-col corrections.

llvm-svn: 308424

5 years agoOpenMP RTL cleanup: two PAUSEs per spin loop iteration replaced with single one
Andrey Churbanov [Wed, 19 Jul 2017 09:26:13 +0000 (09:26 +0000)]
OpenMP RTL cleanup: two PAUSEs per spin loop iteration replaced with single one

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

llvm-svn: 308423

5 years ago[SimplifyCFG] Defer folding unconditional branches to LateSimplifyCFG if it can destr...
Balaram Makam [Wed, 19 Jul 2017 08:53:34 +0000 (08:53 +0000)]
[SimplifyCFG] Defer folding unconditional branches to LateSimplifyCFG if it can destroy canonical loop structure.

When simplifying unconditional branches from empty blocks, we pre-test if the
BB belongs to a set of loop headers and keep the block to prevent passes from
destroying canonical loop structure. However, the current algorithm fails if
the destination of the branch is a loop header. Especially when such a loop's
latch block is folded into loop header it results in additional backedges and
LoopSimplify turns it into a nested loop which prevent later optimizations
from being applied (e.g., loop  unrolling and loop interleaving).

This patch augments the existing algorithm by further checking if the
destination of the branch belongs to a set of loop headers and defer
eliminating it if yes to LateSimplifyCFG.

Fixes PR33605: https://bugs.llvm.org/show_bug.cgi?id=33605

Reviewers: efriedma, mcrosier, pacxx, hsung, davidxl

Reviewed By: efriedma

Subscribers: ashutosh.nema, gberry, javed.absar, llvm-commits

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

llvm-svn: 308422

5 years ago[LV] Test once if vector trip count is zero, instead of twice
Ayal Zaks [Wed, 19 Jul 2017 05:16:39 +0000 (05:16 +0000)]
[LV] Test once if vector trip count is zero, instead of twice

Generate a single test to decide if there are enough iterations to jump to the
vectorized loop, or else go to the scalar remainder loop. This test compares the
Scalar Trip Count: if STC < VF * UF go to the scalar loop. If
requiresScalarEpilogue() holds, at-least one iteration must remain scalar; the
rest can be used to form vector iterations. So in this case the test checks
instead if (STC - 1) < VF * UF by comparing STC <= VF * UF, and going to the
scalar loop if so. Otherwise the vector loop is entered for at-least one vector

This test covers the case where incrementing the backedge-taken count will
overflow leading to an incorrect trip count of zero. In this (rare) case we will
also avoid the vector loop and jump to the scalar loop.

This patch simplifies the existing tests and effectively removes the basic-block
originally named "min.iters.checked", leaving the single test in block

Original observation and initial patch by Evgeny Stupachenko.

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

llvm-svn: 308421

5 years ago[X86][builtins] Sync getX86CpuIDAndInfoEx with llvm's Host.cpp again.
Craig Topper [Wed, 19 Jul 2017 05:11:20 +0000 (05:11 +0000)]
[X86][builtins] Sync getX86CpuIDAndInfoEx with llvm's Host.cpp again.

We now use __cpuidex intrinsics intead of inline asm on 32-bit Windows. We already used it on 64-bit.

llvm-svn: 308420

5 years ago[CGP] Allow cycles during Phi traversal in OptimizaMemoryInst
Serguei Katkov [Wed, 19 Jul 2017 04:49:17 +0000 (04:49 +0000)]
[CGP] Allow cycles during Phi traversal in OptimizaMemoryInst

Allowing cycles in Phi traversal increases the scope of optimize memory instruction
in case we are in loop.

The added test shows an example of enabling optimization inside a loop.

Reviewers: loladiro, spatel, efriedma
Reviewed By: efriedma
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D35294

llvm-svn: 308419

5 years agoRevert r308273 to reinstate part of r308100.
Chandler Carruth [Wed, 19 Jul 2017 04:15:30 +0000 (04:15 +0000)]
Revert r308273 to reinstate part of r308100.

That part was reverted because the underlying change necessitating it
(r308025) was reverted in r308271.

Nirav re-landed r308025 again in r308350, so re-landing this fix.

llvm-svn: 308418

5 years ago[PM/LCG] Follow-up fix to r308088 to handle deletion of library
Chandler Carruth [Wed, 19 Jul 2017 04:12:25 +0000 (04:12 +0000)]
[PM/LCG] Follow-up fix to r308088 to handle deletion of library

In the prior commit, we provide ordering to the LCG between functions
and library function definitions that they might begin to call through
transformations. But we still would delete these library functions from
the call graph if they became dead during inlining.

While this immediately crashed, it also exposed a loss of information.
We shouldn't remove definitions of library functions that can still
usefully participate in the LCG-powered CGSCC optimization process. If
new call edges are formed, we want to have definitions to be called.

We can still remove these functions if truly dead using global-dce, etc,
but removing them during the CGSCC walk is premature.

This fixes a crash in the new PM when optimizing some unusual libraries
that end up with "internal" lib functions such as the code in the "R"
language's libraries.

llvm-svn: 308417

5 years ago[analyzer] Add annotation attribute to trust retain count implementation
Devin Coughlin [Wed, 19 Jul 2017 04:10:44 +0000 (04:10 +0000)]
[analyzer] Add annotation attribute to trust retain count implementation

Add support to the retain-count checker for an annotation indicating that a
function's implementation should be trusted by the retain count checker.
Functions with these attributes will not be inlined and the arguments will
be treating as escaping.

Adding this annotation avoids spurious diagnostics when the implementation of
a reference counting operation is visible but the analyzer can't reason
precisely about the ref count.

Patch by Malhar Thakkar!

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

llvm-svn: 308416

5 years ago[SPARC] Add missing variable initialization after r308343.
James Y Knight [Wed, 19 Jul 2017 04:08:42 +0000 (04:08 +0000)]
[SPARC] Add missing variable initialization after r308343.

llvm-svn: 308415

5 years ago[CMake] Build runtimes for Fuchsia targets
Petr Hosek [Wed, 19 Jul 2017 02:57:47 +0000 (02:57 +0000)]
[CMake] Build runtimes for Fuchsia targets

This relies on the multi-target runtimes build support.

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

llvm-svn: 308412

5 years agoAMD znver1 Initial Scheduler model
Craig Topper [Wed, 19 Jul 2017 02:45:14 +0000 (02:45 +0000)]
AMD znver1 Initial Scheduler model

This patch adds the following
1. Adds a skeleton scheduler model for AMD Znver1.
2. Introduces the znver1 execution units and pipes.
3. Caters the instructions based on the generic scheduler classes.
4. Further additions to the scheduler model with instruction itineraries will be carried out incrementally based on
        a. Instructions types
        b. Registers used
5. Since itineraries are not added based on instructions, throughput information are bound to change when incremental changes are added.
6. Scheduler testcases are modified accordingly to suit the new model.

Patch by Ganesh Gopalasubramanian. With minor formatting tweaks from me.

Reviewers: craig.topper, RKSimon

Subscribers: javed.absar, shivaram, ddibyend, vprasad

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

llvm-svn: 308411

5 years agotest: remove duplicated test
Saleem Abdulrasool [Wed, 19 Jul 2017 02:39:00 +0000 (02:39 +0000)]
test: remove duplicated test

This test is folded into implib-name.  Don't bother with the racy test.
The use of %T results in left-overs from previous tests which write out
the same import library as this test.

llvm-svn: 308409

5 years ago[llvm-readobj] Install llvm-readelf alias
Petr Hosek [Wed, 19 Jul 2017 02:09:37 +0000 (02:09 +0000)]
[llvm-readobj] Install llvm-readelf alias

Install an llvm-readelf symlink to llvm-readobj.
When invoked as *readelf*, default to -elf-output-style=GNU.

Patch by Roland McGrath

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

llvm-svn: 308408

5 years agoCOFF: improve link conformance for import names
Saleem Abdulrasool [Wed, 19 Jul 2017 02:01:27 +0000 (02:01 +0000)]
COFF: improve link conformance for import names

Improve the link conformance for the import name embedded into the
import library.  This requires the associated change to the LLVM portion
for the DEF file parser.  The import file generation embeds a different
name based on whether the driver is invoked as "link" or "lib".
Furthermore, the LIBRARY keyword in the DEF file influences the import
name.  The behaviour can be summarised according to the following table:

      | LIBRARY w/ ext |   LIBRARY w/o ext   | no LIBRARY
 LINK | {value}        | {value}.{.dll/.exe} | {output name}
  LIB | {value}        | {value}.dll         | {output name}.dll

llvm-svn: 308407

5 years agoObject: preserve more information about DEF file
Saleem Abdulrasool [Wed, 19 Jul 2017 02:01:22 +0000 (02:01 +0000)]
Object: preserve more information about DEF file

Preserve the actual library name as provided by the user.  This is
required to properly replicate link's behaviour about the module import
name handling.  This requires an associated change to lld for updating
the tests for the proper behaviour for the import library module name
handling in various cases.

Associated tests will be part of the lld change.

llvm-svn: 308406

5 years agoFix DebugLoc propagation for unreachable LoadInst
Weiming Zhao [Wed, 19 Jul 2017 01:27:24 +0000 (01:27 +0000)]
Fix DebugLoc propagation for unreachable LoadInst

Summary: Currently, when GVN creates a load and when InstCombine creates a new store for unreachable Load, the DebugLoc info gets lost.

Reviewers: dberlin, davide, aprantl

Reviewed By: aprantl

Subscribers: davide, llvm-commits

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

llvm-svn: 308404

5 years ago[Polly][docs][Release Notes] Adding Information about Remarks to Release Notes and...
Tobias Grosser [Wed, 19 Jul 2017 01:16:55 +0000 (01:16 +0000)]
[Polly][docs][Release Notes] Adding Information about Remarks to Release Notes and Documentation

Summary: Based off of D35399

Reviewers: pollydev, llvm-commits, bollu, grosser

Reviewed By: grosser

Tags: #polly

Contributed-by: Tarun Ranjendran
Differential Revision: https://reviews.llvm.org/D35596

llvm-svn: 308403

5 years ago[scan-build-py] Patch to fix "-analyzer-config" option
Petr Hosek [Wed, 19 Jul 2017 00:29:41 +0000 (00:29 +0000)]
[scan-build-py] Patch to fix "-analyzer-config" option

I noticed that when I use "-analyze-config" option in scan-build-py, it
behaves differently from original perl based scan-build.

For example, command:

$ scan-build -analyzer-config ipa=basic-inlining make

Will work without any issues on perl version of scan-build. But on
scan-build-py it will throw an error message "error reading

After debugging, it turns out that the scan-build-py does not put
"-analyzer-config" flag in front of the analyzer config flags (in this
case is the "ipa=basic-inlining") in the final clang command line. This
patch fixes this issue.

Patch by Haowei Wu

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

llvm-svn: 308401

5 years agoUpdate for LLVM IR metadata changes (DIImportedEntity now needs a DIFile).
Adrian Prantl [Wed, 19 Jul 2017 00:09:58 +0000 (00:09 +0000)]
Update for LLVM IR metadata changes (DIImportedEntity now needs a DIFile).


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

llvm-svn: 308399

5 years agoDebug Info: Add a file: field to DIImportedEntity.
Adrian Prantl [Wed, 19 Jul 2017 00:09:54 +0000 (00:09 +0000)]
Debug Info: Add a file: field to DIImportedEntity.

DIImportedEntity has a line number, but not a file field. To determine
the decl_line/decl_file we combine the line number from the
DIImportedEntity with the file from the DIImportedEntity's scope. This
does not work correctly when the parent scope is a DINamespace or a
DIModule, both of which do not have a source file.

This patch adds a file field to DIImportedEntity to unambiguously
identify the source location of the using/import declaration.  Most
testcase updates are mechanical, the interesting one is the removal of
the FIXME in test/DebugInfo/Generic/namespace.ll.

This fixes PR33822. See https://bugs.llvm.org/show_bug.cgi?id=33822
for more context.


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

llvm-svn: 308398

5 years agoDebug Info: Set the MainFileName when generating -gmodules debug info for PCM.
Adrian Prantl [Tue, 18 Jul 2017 23:58:34 +0000 (23:58 +0000)]
Debug Info: Set the MainFileName when generating -gmodules debug info for PCM.

Previously it was uninitialized and thus always defaulted to "<stdin>".
This is mostly a cosmetic change that helps making the debug info more readable.

llvm-svn: 308397

5 years ago[llvm-readobj] Accept (and ignore) --wide (-W) command-line switch
Petr Hosek [Tue, 18 Jul 2017 23:58:15 +0000 (23:58 +0000)]
[llvm-readobj] Accept (and ignore) --wide (-W) command-line switch

Accept and ignore --wide/-W. In GNU readelf this switch is
necessary to get the output format that's consistent between
32-bit and 64-bit targets. llvm-readobj always produces that
output format.

Patch by Roland McGrath

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

llvm-svn: 308396

5 years agoRevert "Add MemoryMappedSection struct for two-level memory map iteration"
Francis Ricci [Tue, 18 Jul 2017 23:51:47 +0000 (23:51 +0000)]
Revert "Add MemoryMappedSection struct for two-level memory map iteration"

This reverts commit c8095ce74118dee8544b0f1ffaba8f46aa10215c.

Reverted due to some buildbot timeouts, perhaps due to 10.11 issues.

llvm-svn: 308395