Commit Graph

259103 Commits

Author SHA1 Message Date
Adrian Prantl 37b72b428a Add a test for debug info with the safestack sanitizer enabled.
llvm-svn: 299730
2017-04-06 23:30:51 +00:00
Eugene Zemtsov 5753710248 Add more tests for ExtractContextAndIdentifier
llvm-svn: 299729
2017-04-06 23:12:43 +00:00
Saleem Abdulrasool 671029daec COFF: support the /appcontainer flag
The /appcontainer flag indicates that the module may only be used inside
an application container (for isolation).  This has been supported by
link.exe since Windows 8.0.  It sets an additional bit in the PE DLL
Characteristics flag to indicate the behavioural change.

llvm-svn: 299728
2017-04-06 23:07:53 +00:00
Konstantin Zhuravlyov 4b3847e865 AMDGPU/GFX9: Fix shared and private aperture queries
Differential Revision: https://reviews.llvm.org/D31786

llvm-svn: 299727
2017-04-06 23:02:33 +00:00
Eric Christopher 380611addc Remove the default subtarget from the Power port. It's unnecessary and harmful if used.
llvm-svn: 299726
2017-04-06 23:01:30 +00:00
Craig Topper 740fe1a6eb [InstCombine] Add a few cases for OR we fail to optimize due to missing commuted patterns checks.
llvm-svn: 299725
2017-04-06 23:00:22 +00:00
Yi Kong 60b5a1cd17 Revert "Revert "[ARM] Add Kryo to available targets""
This reverts commit dc9458d5a747a02a9a8f198b84c2b92a6939a8dd.

Added missing case for PreISelOperandLatencyAdjustment.

llvm-svn: 299724
2017-04-06 22:47:47 +00:00
Eli Friedman 5fba1e53f2 Turn on -addr-sink-using-gep by default.
The new codepath has been in the tree for years, and there isn't any
reason to use two codepaths here.

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

llvm-svn: 299723
2017-04-06 22:42:18 +00:00
Rui Ueyama 5eb8ea8872 Rename refersToGotEntry needsGot and add comments.
This patch addresses a post-commit review comment for r299615.

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

llvm-svn: 299722
2017-04-06 22:39:11 +00:00
Eugene Zemtsov a633ee6e4a New C++ function name parsing logic (Resubmit)
Current implementation of CPlusPlusLanguage::MethodName::Parse() doesn't
get anywhere close to covering full extent of possible function declarations.
It causes incorrect behavior in avoid-stepping and sometimes messes
printing of thread backtrace.

This change implements more methodical parsing logic based on clang
lexer and simple recursive parser.

Examples:
void std::vector<Class, std::allocator<Class>>::_M_emplace_back_aux<Class const&>(Class const&)
void (*&std::_Any_data::_M_access<void (*)()>())()

Previous version of this change (D31451) was rolled back due to an issue
with Objective-C selectors being incorrectly recognized as a C++ identifier.

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

llvm-svn: 299721
2017-04-06 22:36:02 +00:00
Michael Kuperstein 6129887d21 [X86] Revert r299387 due to AVX legalization infinite loop.
llvm-svn: 299720
2017-04-06 22:33:25 +00:00
Zachary Turner 813de71329 Try to fix FreeBSD build after IWYU changes.
llvm-svn: 299719
2017-04-06 22:18:59 +00:00
Zachary Turner 720bd7af62 Fix build failure in unit test.
llvm-svn: 299718
2017-04-06 21:57:39 +00:00
Rafael Espindola d1960dc097 Call updateAlignment before assignAddresses.
The alignment expression cannot depend on '.', so we can compute it
early.

llvm-svn: 299717
2017-04-06 21:40:22 +00:00
Rafael Espindola feed750676 Move call to findMemoryRegion before assignAddresses.
This removes a bit more work from assignAddresses.

llvm-svn: 299716
2017-04-06 21:31:24 +00:00
Craig Topper a521c30dc6 [InstCombine] Remove testing assert I accidentally left in r299710.
llvm-svn: 299715
2017-04-06 21:29:43 +00:00
Zachary Turner 2f3df6137a iwyu fixes for lldbCore.
This adjusts header file includes for headers and source files
in Core.  In doing so, one dependency cycle is eliminated
because all the includes from Core to that project were dead
includes anyway.  In places where some files in other projects
were only compiling due to a transitive include from another
header, fixups have been made so that those files also include
the header they need.  Tested on Windows and Linux, and plan
to address failures on OSX and FreeBSD after watching the
bots.

llvm-svn: 299714
2017-04-06 21:28:29 +00:00
Rafael Espindola 1902b337e9 Remove redundant argument. NFC.
llvm-svn: 299713
2017-04-06 21:26:03 +00:00
Matt Arsenault 21a438255d AMDGPU: Diagnose illegal SGPR to VGPR copies
This is possible in ways that are not compiler bugs,
so stop asserting on them.

This emits an extra error when emitting objects when it
can't encode the new pseudo, but I'm not sure that matters.

llvm-svn: 299712
2017-04-06 21:09:53 +00:00
Petr Hosek 7dc0e3d357 [CMake][libcxx] Use check_c_compiler_flag to check for nodefaultlibs
We're using -nodefaultlibs to avoid the dependency on C++ library
when using check_cxx_compiler_flag, and as such we cannot use
check_cxx_compiler_flag to check the availability of -nodefaultlibs
itself.

llvm-svn: 299711
2017-04-06 21:06:33 +00:00
Craig Topper b4da6840d8 [InstCombine] When checking to see if we can turn subtracts of 2^n - 1 into xor, we only need to call computeKnownBits on the RHS not the whole subtract. While there use isMask instead of isPowerOf2(C+1)
Calling computeKnownBits on the RHS should allows us to recurse one step further. isMask is equivalent to the isPowerOf2(C+1) except in the case where C is all ones. But that was already handled earlier by creating a not which is an Xor with all ones. So this should be fine.

llvm-svn: 299710
2017-04-06 21:06:03 +00:00
Rafael Espindola 9b9800951d Cache the result of findSection.
This avoids calling it multiple times. In particular, we don't have to
call in in assignAddresses any more.

llvm-svn: 299709
2017-04-06 21:05:39 +00:00
Matt Arsenault 5cf4271883 AMDGPU: Replace fp16SrcZerosHighBits with a whitelist
FCOPYSIGN is lowered to bit operations which don't clear the high
bits.

llvm-svn: 299708
2017-04-06 20:58:30 +00:00
Rong Xu 2bf4c59025 [PGO] Preserve GlobalsAA in pgo-memop-opt pass.
Preserve GlobalsAA analysis in memory intrinsic calls optimization based on
profiled size.

llvm-svn: 299707
2017-04-06 20:56:00 +00:00
Keno Fischer 1505de5495 [llvm-extract] Add option for recursive extraction
Summary:
Particularly, with --delete, this can be very useful for testing
new optimizations on some hotspots, without having to run it on the whole
application. E.g. as such:
```
llvm-extract app.bc --recursive --rfunc .*hotspot.* > hotspot.bc
llvm-extract app.bc --recursive --delete --rfunc .*hotspot.* > residual.bc
llc -filetype=obj residual.bc > residual.o
llc -filetype=obj hotspot.bc > hotspot.o
cc -o app residual.o hotspot.o
```

Reviewed By: davide
Differential Revision: https://reviews.llvm.org/D31722

llvm-svn: 299706
2017-04-06 20:51:40 +00:00
Zachary Turner 8d4e2768be Try to fix FreeBSD build after iwyu changes.
llvm-svn: 299705
2017-04-06 20:51:22 +00:00
Craig Topper 7226d796aa [InstCombine] Remove redundant combine from visitAnd
This combine is fully handled by SimplifyDemandedInstructionBits as of r299658 where I fixed this code to ensure the Add/Sub had only a single user. Otherwise it would fire and create additional instructions. That fix resulted in an improvement to code generated for tsan which is why I committed it before deleting.

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

llvm-svn: 299704
2017-04-06 20:41:48 +00:00
Davide Italiano 18ad20eab5 [BFIterator] Remove an assertion that doesn't hold. NFCI.
llvm-svn: 299703
2017-04-06 20:32:10 +00:00
Mehdi Amini db11fdfda5 Revert "Turn some C-style vararg into variadic templates"
This reverts commit r299699, the examples needs to be updated.

llvm-svn: 299702
2017-04-06 20:23:57 +00:00
Huihui Zhang 98240e9643 [SelectionDAG] [ARM CodeGen] Fix chain information of LowerMUL
In LowerMUL, the chain information is not preserved for the new
created Load SDNode.

For example, if a Store alias with one of the operand of Mul.
The Load for that operand need to be scheduled before the Store.
The dependence is recorded in the chain of Store, in TokenFactor.
However, when lowering MUL, the SDNodes for the new Loads for
VMULL are not updated in the TokenFactor for the Store. Thus the
chain is not preserved for the lowered VMULL.

llvm-svn: 299701
2017-04-06 20:22:51 +00:00
Chih-Hung Hsieh 90fccec5ee [clang-tidy] Reuse FileID in getLocation
One FileID per warning will increase and overflow NextLocalOffset
when input file is large with many warnings.
Reusing FileID avoids this problem.

This requires changes in getColumnNumber, D31406, rL299681.

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

llvm-svn: 299700
2017-04-06 20:19:26 +00:00
Mehdi Amini 579540a8f7 Turn some C-style vararg into variadic templates
Module::getOrInsertFunction is using C-style vararg instead of
variadic templates.

From a user prospective, it forces the use of an annoying nullptr
to mark the end of the vararg, and there's not type checking on the
arguments. The variadic template is an obvious solution to both
issues.

Patch by: Serge Guelton <serge.guelton@telecom-bretagne.eu>

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

llvm-svn: 299699
2017-04-06 20:09:31 +00:00
Evgeniy Stepanov 0680968ff3 [asan] Fix dead stripping of globals on Linux (compiler-rt).
This is a re-land of r298173, r298169, r298159.

llvm-svn: 299698
2017-04-06 19:55:52 +00:00
Evgeniy Stepanov 6c3a8cbc4d [asan] Fix dead stripping of globals on Linux.
Use a combination of !associated, comdat, @llvm.compiler.used and
custom sections to allow dead stripping of globals and their asan
metadata. Sometimes.

Currently this works on LLD, which supports SHF_LINK_ORDER with
sh_link pointing to the associated section.

This also works on BFD, which seems to treat comdats as
all-or-nothing with respect to linker GC. There is a weird quirk
where the "first" global in each link is never GC-ed because of the
section symbols.

At this moment it does not work on Gold (as in the globals are never
stripped).

This is a re-land of r298158 rebased on D31358. This time,
asan.module_ctor is put in a comdat as well to avoid quadratic
behavior in Gold.

llvm-svn: 299697
2017-04-06 19:55:17 +00:00
Evgeniy Stepanov 5dfe420d10 [asan] Put ctor/dtor in comdat.
When possible, put ASan ctor/dtor in comdat.

The only reason not to is global registration, which can be
TU-specific. This is not the case when there are no instrumented
globals. This is also limited to ELF targets, because MachO does
not have comdat, and COFF linkers may GC comdat constructors.

The benefit of this is a lot less __asan_init() calls: one per DSO
instead of one per TU. It's also necessary for the upcoming
gc-sections-for-globals change on Linux, where multiple references to
section start symbols trigger quadratic behaviour in gold linker.

This is a rebase of r298756.

llvm-svn: 299696
2017-04-06 19:55:13 +00:00
Evgeniy Stepanov 039af609f1 [asan] Delay creation of asan ctor.
Create the constructor in the module pass.
This in needed for the GC-friendly globals change, where the constructor can be
put in a comdat  in some cases, but we don't know about that in the function
pass.

This is a rebase of r298731 which was reverted due to a false alarm.

llvm-svn: 299695
2017-04-06 19:55:09 +00:00
Peter Collingbourne db4cafa6c4 Bitcode: Do not create FNENTRYs for aliases of functions.
There doesn't seem to be any point in doing this.

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

llvm-svn: 299694
2017-04-06 19:39:24 +00:00
Rafael Espindola 8024cac19a Replace a few uses of basename.
This replaces a few uses of basename with the recently introduced lit
replacements.

llvm-svn: 299693
2017-04-06 19:38:24 +00:00
Keno Fischer bacc64b5fa [StripDeadDebugInfo] Drop dead CUs entirely
Summary:
Prior to this while it would delete the dead DIGlobalVariables, it would
leave dead DICompileUnits and everything referenced therefrom. For a bit
bitcode file with thousands of compile units those dead nodes easily
outnumbered the real ones. Clean that up.

Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D31720

llvm-svn: 299692
2017-04-06 19:26:22 +00:00
Yaxun Liu b122ed9181 [AMDGPU] Temporarily change constant address space from 4 to 2 for the new address space mapping
Change constant address space from 4 to 2 for the new address space mapping in Clang.

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

llvm-svn: 299691
2017-04-06 19:18:36 +00:00
Yaxun Liu 76ae47cb35 [AMDGPU] Temporarily change constant address space from 4 to 2
Our final address space mapping is to let constant address space to be 4 to match nvptx.
However for now we will make it 2 to avoid unnecessary work in FE/BE/devlib
about intrinsics returning constant pointers.

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

llvm-svn: 299690
2017-04-06 19:17:32 +00:00
Yi Kong 5e7059b702 Revert "[ARM] Add Kryo to available targets"
This reverts commit 942d6e6f58bf7e63810dd7cbcbce1fdfa5ebc6d4.

Build breakage.

llvm-svn: 299689
2017-04-06 19:16:14 +00:00
Nirav Dave 974f7c23ae [SDAG] Fix visitAND optimization to deal with vector extract case again.
Summary:
Fix case elided by rL298920.

Fixes PR32545.

Reviewers: eli.friedman, RKSimon

Subscribers: llvm-commits

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

llvm-svn: 299688
2017-04-06 19:05:41 +00:00
Craig Topper 8ef20ea7c2 [InstSimplify] Remove unreachable default from SimplifyBinOp.
We have dedicated handlers for every opcode so nothing can get here anymore. The switch doesn't get detected as fully covered because Opcode is an unsigned. Casting to Instruction::BinaryOps still doesn't detect it because BinaryOpsEnd is in the enum and 1 past the last opcode.

llvm-svn: 299687
2017-04-06 18:59:08 +00:00
Marshall Clow 14764c2200 Some of Eric's buildbots don't like this test. Disable it while I figure out why.
llvm-svn: 299686
2017-04-06 18:54:37 +00:00
Daniel Berlin 21279bd37a NewGVN: Rename some functions for consistency
llvm-svn: 299685
2017-04-06 18:52:58 +00:00
Daniel Berlin 08fe6e0f74 NewGVN: Fixup some small issues
llvm-svn: 299684
2017-04-06 18:52:55 +00:00
Daniel Berlin 5845e0549e NewGVN: Fix a small formatting issue in performSymbolicLoadEvaluation.
llvm-svn: 299683
2017-04-06 18:52:53 +00:00
Daniel Berlin 1316a94ebc NewGVN: This patch makes memory congruence work for all types of
memorydefs, not just stores.  Along the way, we audit and fixup issues
about how we were tracking memory leaders, and improve the verifier
to notice more memory congruency issues.

llvm-svn: 299682
2017-04-06 18:52:50 +00:00
Chih-Hung Hsieh a0b99e45e9 [Basic] getColumnNumber returns location of CR+LF on Windows
When fixing a Clang-Tidy bug in D31406,
reuse of FileID enabled the missing highlightRange function.
Assertion in highlightRange failed because the end-of-range column
number was 2 + the last column of a line on Windows.
This fix is required to enable D31406.

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

llvm-svn: 299681
2017-04-06 18:36:50 +00:00