Clement Courbet [Fri, 21 Sep 2018 14:07:20 +0000 (14:07 +0000)]
[X86][Sched] Add zero idiom sched data to the SNB model.
Summary:
On SNB, renamer-based zeroing does not work for:
- 16 and 8-bit GPRs[1].
- MMX [2].
- ANDN variants [3]
[1] echo 'sub %ax, %ax' | /tmp/llvm-exegesis -mode=uops -snippets-file=-
[2] echo 'pxor %mm0, %mm0' | /tmp/llvm-exegesis -mode=uops -snippets-file=-
[3] echo 'andnps %xmm0, %xmm0' | /tmp/llvm-exegesis -mode=uops -snippets-file=-
Reviewers: RKSimon, andreadb
Subscribers: gbedwell, craig.topper, llvm-commits
Differential Revision: https://reviews.llvm.org/D52358
llvm-svn: 342736
Bruno Ricci [Fri, 21 Sep 2018 14:03:32 +0000 (14:03 +0000)]
[AST][NFC] DeclarationName.h : add missing parentheses to silence warnings
Some bots are complaining about missing parentheses in assertions added in
r342729: [AST] Various optimizations + refactoring in DeclarationName(Table)
llvm-svn: 342735
JF Bastien [Fri, 21 Sep 2018 13:54:09 +0000 (13:54 +0000)]
NFC: deduplicate isRepeatedBytePattern from clang to LLVM's isBytewiseValue
Summary:
This code was in CGDecl.cpp and really belongs in LLVM. It happened to have isBytewiseValue which served a very similar purpose but wasn't as powerful as clang's version. Remove the clang version, and augment isBytewiseValue to be as powerful so that clang does the same thing it used to.
LLVM part of this patch: D51751
Subscribers: dexonsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D51752
llvm-svn: 342734
Tatyana Krasnukha [Fri, 21 Sep 2018 13:40:22 +0000 (13:40 +0000)]
Add dependency on llc required by find-variable-dwo test
llvm-svn: 342733
Tatyana Krasnukha [Fri, 21 Sep 2018 13:20:26 +0000 (13:20 +0000)]
Skip test if gcc version is less than 7.1 since it doesn't support -gcolumn-info option
llvm-svn: 342732
Bruno Ricci [Fri, 21 Sep 2018 13:11:39 +0000 (13:11 +0000)]
[AST][NFC] Remove a superfluous enum in ObjCMethodDeclBitfields added in r338641
I originally added this enum to avoid including Basic/IdentifierTable.h
in AST/DeclBase.h. However I did not realise it is already included
transitively by AST/DeclarationName.h. Therefore remove this enum and
explicitly include Basic/IdentifierTable.h
llvm-svn: 342731
Eric Liu [Fri, 21 Sep 2018 13:04:57 +0000 (13:04 +0000)]
[clangd] Remember to serialize symbol origin in YAML.
llvm-svn: 342730
Bruno Ricci [Fri, 21 Sep 2018 12:53:22 +0000 (12:53 +0000)]
[AST] Various optimizations + refactoring in DeclarationName(Table)
Introduce the following optimizations in DeclarationName(Table):
1. Store common kinds inline in DeclarationName instead of
DeclarationNameExtra. Currently the kind of C++ constructor, destructor,
conversion function and overloaded operator names is stored in
DeclarationNameExtra. Instead store it inline in DeclarationName.
To do this align IdentifierInfo, CXXSpecialName, DeclarationNameExtra
and CXXOperatorIdName to 8 bytes so that we can use the lower 3 bits of
DeclarationName::Ptr. This is already the case on 64 bits archs anyway.
This also allow us to remove DeclarationNameExtra from CXXSpecialName
and CXXOperatorIdName, which shave off a pointer from CXXSpecialName.
2. Synchronize the enumerations DeclarationName::NameKind,
DeclarationName::StoredNameKind and Selector::IdentifierInfoFlag.
This makes DeclarationName::getNameKind much more efficient since we can
replace the switch table by a single comparison and an addition.
3. Put the overloaded operator names inline in DeclarationNameTable to remove
an indirection. This increase the size of DeclarationNameTable a little
bit but this is not important since it is only used in ASTContext, and
never copied nor moved from. This also get rid of the last dynamic
allocation in DeclarationNameTable.
Altogether these optimizations cut the run time of parsing all of Boost by
about 0.8%. While we are at it, do the following NFC modifications:
1. Put the internal classes CXXSpecialName, CXXDeductionGuideNameExtra,
CXXOperatorIdName, CXXLiteralOperatorIdName and DeclarationNameExtra
in a namespace detail since these classes are only meant to be used by
DeclarationName and DeclarationNameTable. Make this more explicit by making
the members of these classes private and friending DeclarationName(Table).
2. Make DeclarationName::getFETokenInfo a non-template since every users are
using it to get a void *. It was supposed to be used with a type to avoid
a subsequent static_cast.
3. Change the internal functions DeclarationName::getAs* to castAs* since when
we use them we already know the correct kind. This has no external impact
since all of these are private.
Reviewed By: erichkeane, rjmccall
Differential Revision: https://reviews.llvm.org/D52267
llvm-svn: 342729
Andrea Di Biagio [Fri, 21 Sep 2018 12:43:07 +0000 (12:43 +0000)]
[X86][BtVer2] Fix latency and resource cycles of AVX 256-bit zero-idioms.
This patch introduces a SchedWriteVariant to describe zero-idiom VXORP(S|D)Yrr
and VANDNP(S|D)Yrr.
This is a follow-up of r342555.
On Jaguar, a VXORPSYrr is 2 macro opcodes. Only one opcode is eliminated at
register-renaming stage. The other opcode has to be executed to set the upper
half of the destination YMM.
Same for VANDNP(S|D)Yrr.
Differential Revision: https://reviews.llvm.org/D52347
llvm-svn: 342728
Jonas Devlieghere [Fri, 21 Sep 2018 12:28:44 +0000 (12:28 +0000)]
[test] Fix Assembler/debug-info.ll
Update Assembler/debug-info.ll to contain discriminator.
llvm-svn: 342727
Andrea Di Biagio [Fri, 21 Sep 2018 12:22:14 +0000 (12:22 +0000)]
[X86] Add scheduling tests for AVX1 256-bit zero-idioms. NFC
llvm-svn: 342726
Jonas Devlieghere [Fri, 21 Sep 2018 12:03:14 +0000 (12:03 +0000)]
Ensure that variant part discriminator is read by MetadataLoader
https://reviews.llvm.org/D42082 introduced variant parts to debug info
in LLVM. Subsequent work on the Rust compiler has found a bug in that
patch; namely, there is a path in MetadataLoader that fails to restore
the discriminator.
This patch fixes the bug.
Patch by: Tom Tromey
Differential revision: https://reviews.llvm.org/D52340
llvm-svn: 342725
Jonas Devlieghere [Fri, 21 Sep 2018 11:55:17 +0000 (11:55 +0000)]
[dsymutil] Suppress CoreFoundation leaks in tests.
This suppresses CoreFoundation originated leaks in the dsymutil tests.
I'm not sure if this is a false positive or not, but either way we don't
have control over it and shouldn't keep the bot red.
http://lab.llvm.org:8080/green/job/clang-stage2-cmake-RgSan/
llvm-svn: 342724
Benjamin Kramer [Fri, 21 Sep 2018 11:38:35 +0000 (11:38 +0000)]
[ADT] Hack around GCC 5.4 miscompiling Optional of enum.
I'm still not 100% sure that this is not UB lingering (Optional has UB
and should use std::launder, but we don't have std::launder)
llvm-svn: 342723
Sameer Sahasrabuddhe [Fri, 21 Sep 2018 11:26:55 +0000 (11:26 +0000)]
[AMDGPU] lower-switch in preISel as a workaround for legacy DA
Summary:
The default target of the switch instruction may sometimes be an
"unreachable" block, when it is guaranteed that one of the cases is
always taken. The dominator tree concludes that such a switch
instruction does not have an immediate post dominator. This confuses
divergence analysis, which is unable to propagate sync dependence to
the targets of the switch instruction.
As a workaround, the AMDGPU target now invokes lower-switch as a
preISel pass. LowerSwitch is designed to handle the unreachable
default target correctly, allowing the divergence analysis to locate
the correct immediate dominator of the now-lowered switch.
Reviewers: arsenm, nhaehnle
Reviewed By: nhaehnle
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits, simoll
Differential Revision: https://reviews.llvm.org/D52221
llvm-svn: 342722
Ivan Donchevskii [Fri, 21 Sep 2018 11:23:22 +0000 (11:23 +0000)]
[CodeComplete] Generate completion fix-its for C code as well
Current completion fix-its approach does not provide OtherOpBase for C code.
But we can easily proceed in this case taking the original Base type.
Differential Revision: https://reviews.llvm.org/D52261
llvm-svn: 342721
Jeremy Morse [Fri, 21 Sep 2018 10:50:15 +0000 (10:50 +0000)]
[libfuzzer] Fix a test's run line
r342698 removed the 'UNSUPPORTED: windows' flags from a number of fuzzer
tests, however too many lines were removed from 'fuzzer-flags.test',
including the run-line that generates the test binary, which breaks that
test for me (and the clang-x64-ninja-win7 buildbot). This patch just
re-adds that line.
llvm-svn: 342720
Alexander Timofeev [Fri, 21 Sep 2018 10:31:22 +0000 (10:31 +0000)]
[AMDGPU] Divergence driven instruction selection. Part 1.
Summary: This change is the first part of the AMDGPU target description
change. The aim of it is the effective splitting the vector and scalar
flows at the selection stage. Selection uses predicate functions based
on the framework implemented earlier - https://reviews.llvm.org/D35267
Differential revision: https://reviews.llvm.org/D52019
Reviewers: rampitec
llvm-svn: 342719
Calixte Denizet [Fri, 21 Sep 2018 09:17:14 +0000 (09:17 +0000)]
[profile] Fix the tests for patch in https://reviews.llvm.org/D49916.
Summary:
The goal of D49916 is to remove some hit counters from lines like '}'.
So as a consequence, the tests must be fixed.
FYI, after holidays, I'll add more tests.
Reviewers: marco-c, davidxl
Reviewed By: marco-c
Subscribers: delcypher, llvm-commits, #sanitizers, sylvestre.ledru
Differential Revision: https://reviews.llvm.org/D49917
llvm-svn: 342718
Calixte Denizet [Fri, 21 Sep 2018 09:17:06 +0000 (09:17 +0000)]
[CodeGen] Add to emitted DebugLoc information about coverage when it's required
Summary:
Some lines have a hit counter where they should not have one.
Cleanup stuff is located to the last line of the body which is most of the time a '}'.
And Exception stuff is added at the beginning of a function and at the end (represented by '{' and '}').
So in such cases, the DebugLoc used in GCOVProfiling.cpp must be marked as not covered.
This patch is a followup of https://reviews.llvm.org/D49915.
Tests in projects/compiler_rt are fixed by: https://reviews.llvm.org/D49917
Reviewers: marco-c, davidxl
Reviewed By: marco-c
Subscribers: dblaikie, cfe-commits, sylvestre.ledru
Differential Revision: https://reviews.llvm.org/D49916
llvm-svn: 342717
Sylvestre Ledru [Fri, 21 Sep 2018 09:07:58 +0000 (09:07 +0000)]
fix the scan-build urls
llvm-svn: 342716
Dean Michael Berris [Fri, 21 Sep 2018 08:32:49 +0000 (08:32 +0000)]
[XRay][clang] Propagate -fxray-instrumentation-bundle to -cc1
Summary:
Add a test and ensure that we propagate the
-fxray-instrumentation-bundle flag from the driver invocation to the
-cc1 options.
Reviewers: mboerger, tejohnson
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D52342
llvm-svn: 342715
Jonas Devlieghere [Fri, 21 Sep 2018 07:50:21 +0000 (07:50 +0000)]
[dwarfdump] Verify DW_AT_type is set and points to a compatible DIE.
This extends the verifier to catch three new errors:
* Missing DW_AT_type attributes for DW_TAG_formal_parameter,
DW_TAG_variable and DW_TAG_array_type.
* Valid references for DW_AT_type pointing to a non-type tag.
Differential revision: https://reviews.llvm.org/D52223
llvm-svn: 342713
Jonas Devlieghere [Fri, 21 Sep 2018 07:49:29 +0000 (07:49 +0000)]
[dwarfdump] Verify compatibility of attribute TAGs.
Verify that DW_AT_specification and DW_AT_abstract_origin reference a
DIE with a compatible tag.
Differential revision: https://reviews.llvm.org/D38719
llvm-svn: 342712
JF Bastien [Fri, 21 Sep 2018 05:34:12 +0000 (05:34 +0000)]
Revert "[ADT] restrict bit_cast to trivially-constructible To"
Of course some bots don't have std::is_trivially_constructible...
llvm-svn: 342711
JF Bastien [Fri, 21 Sep 2018 05:18:49 +0000 (05:18 +0000)]
[ADT] restrict bit_cast to trivially-constructible To
Summary: As discussed in r341853 by blaikie, the reinterpret_cast was technically an aliasing violation. Restrict our bit_cast implementation to To which are trivially-constructible (and note the existing restriction to constexpr). Once we move to C++17 we can use a version of bit_cast without these restrictions, or if we care we can SFINAE a different implementation when To isn't trivially-constructible.
Reviewers: dblaikie, rsmith
Subscribers: dexonsmith, kristina, llvm-commits
Differential Revision: https://reviews.llvm.org/D52332
llvm-svn: 342710
JF Bastien [Fri, 21 Sep 2018 05:17:42 +0000 (05:17 +0000)]
Merge clang's isRepeatedBytePattern with LLVM's isBytewiseValue
Summary:
his code was in CGDecl.cpp and really belongs in LLVM's isBytewiseValue. Teach isBytewiseValue the tricks clang's isRepeatedBytePattern had, including merging undef properly, and recursing on more types.
clang part of this patch: D51752
Subscribers: dexonsmith, llvm-commits
Differential Revision: https://reviews.llvm.org/D51751
llvm-svn: 342709
Owen Pan [Fri, 21 Sep 2018 03:46:36 +0000 (03:46 +0000)]
[clang-format] Do not merge short case labels if followed by a block.
Do not allow short case labels on a single line if the label is followed by a
left brace.
Fixes PR38926.
llvm-svn: 342708
Dan Gohman [Fri, 21 Sep 2018 03:24:42 +0000 (03:24 +0000)]
[WebAssembly] Revert r342701, "Add WebAssembly to LLVM_ALL_TARGTS."
There is a memory leak which is detected in some of the sanitizer builds.
MCSymbolWasm contains SmallVectors for holding signature information,
however MCContext doesn't run destructors for MCSymbols, so in cases
where the SmallVectors heap-allocate, the memory is leaked.
llvm-svn: 342707
Dean Michael Berris [Fri, 21 Sep 2018 01:54:08 +0000 (01:54 +0000)]
[MCA] Remove dependency on CodeGen.
Summary:
There isn't any actual dependency - there's one #include from CodeGen
but nothing from the header is actually used.
With this change we can use the MCA library from CodeGen without
circular dependencies (e.g. for scheduling).
Reviewers: andreadb
Reviewed By: andreadb
Authored By: orodley
Subscribers: mgorny, gbedwell, llvm-commits
Differential Revision: https://reviews.llvm.org/D52288
llvm-svn: 342706
Kristina Brooks [Fri, 21 Sep 2018 01:53:51 +0000 (01:53 +0000)]
[Docs] [Support] Correct a missed reference and use up to date .inc examples.
In my original diff I missed #include "llvm/System/Thing.h" and forgot to update a
reference to .inc files a few lines down. This patch corrects these things as
they were missed in revision 342500.
llvm-svn: 342705
Petr Hosek [Fri, 21 Sep 2018 00:55:42 +0000 (00:55 +0000)]
[ELF] Use the Repl point to avoid the segfault when using ICF
This addresses PR38918.
Differential Revision: https://reviews.llvm.org/D52202
llvm-svn: 342704
Justin Bogner [Fri, 21 Sep 2018 00:51:04 +0000 (00:51 +0000)]
[MachineCopyPropagation] Refactor copy tracking into a class. NFC
This is a bit easier to follow than handling the copy and src maps
directly in the pass, and will make upcoming changes to how this is
done easier to follow.
llvm-svn: 342703
Jordan Rupprecht [Fri, 21 Sep 2018 00:47:31 +0000 (00:47 +0000)]
[llvm-objcopy/llvm-strip]: handle --version
Summary:
Implement --version for objcopy and strip.
I think there are LLVM utilities that automatically handle this, but that doesn't seem to work with custom parsing since this binary handles both objcopy and strip, so it uses custom parsing.
This fixes PR38298
Reviewers: jhenderson, alexshap, jakehehrlich
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D52328
llvm-svn: 342702
Dan Gohman [Fri, 21 Sep 2018 00:39:57 +0000 (00:39 +0000)]
[WebAssembly] Add WebAssembly to LLVM_ALL_TARGTS.
This makes WebAssembly build by default, rather than requiring
LLVM_EXPERIMENTAL_TARGETS_TO_BUILD!
Differential Revision: https://reviews.llvm.org/D43211
llvm-svn: 342701
Justin Bogner [Fri, 21 Sep 2018 00:08:33 +0000 (00:08 +0000)]
[MachineCopyPropagation] Minor clang-formatting. NFC
llvm-svn: 342700
Vedant Kumar [Thu, 20 Sep 2018 23:56:39 +0000 (23:56 +0000)]
[lldbtest] Fix self.filecheck check file lookup
The 'test_filename' property in TestBase changes over time, so
attempting to find a check file relative to the directory containing
'test_filename' is flaky.
Use the absolute path of the check file as that's always correct (and
simpler). This relies on the test driver changing into the test
directory, which it seems we can safely assume.
As a drive-by, make self.filecheck respect the trace (-t) option.
llvm-svn: 342699
Jonathan Metzman [Thu, 20 Sep 2018 23:24:48 +0000 (23:24 +0000)]
[fuzzer] Replace FuzzerExtFunctionsDlsymWin.cpp with FuzzerExtFunctionsWeakAlias.cpp
Summary:
Replace FuzzerExtFunctionsDlsymWin.cpp with FuzzerExtFunctionsWeakAlias.cpp
to get externally defined functions (eg: LLVMFuzzerInitialize,
LLVMFuzzerCustomMutator, etc) working again.
Also enable tests that depended on these functions (on windows)
Reviewers: rnk, morehouse
Reviewed By: rnk, morehouse
Subscribers: rnk, morehouse, mgorny
Differential Revision: https://reviews.llvm.org/D51700
llvm-svn: 342698
David Blaikie [Thu, 20 Sep 2018 23:11:27 +0000 (23:11 +0000)]
Fix DenseSet::ConstIterator typedefs
Fix DenseSet::ConstIterator pointer/reference typedefs to be const
Patch by Brad Moody!
Differential Revision: https://reviews.llvm.org/D52260
llvm-svn: 342697
Aditya Nandakumar [Thu, 20 Sep 2018 23:01:56 +0000 (23:01 +0000)]
Add the ability to register callbacks for removal and insertion of MachineInstrs
https://reviews.llvm.org/D52127
This patch adds the ability to watch for insertions/deletions of
MachineInstructions similar to MachineRegisterInfo.
llvm-svn: 342696
Rui Ueyama [Thu, 20 Sep 2018 22:58:00 +0000 (22:58 +0000)]
Make a member function non-member. NFC.
Non-member functions are generally preferred over member functions
because it is clear that non-member functions don't depend on an
internal state of an object.
llvm-svn: 342695
David Blaikie [Thu, 20 Sep 2018 22:48:09 +0000 (22:48 +0000)]
Remove an unused function
llvm-svn: 342694
Zachary Turner [Thu, 20 Sep 2018 22:32:51 +0000 (22:32 +0000)]
Remove failing test.
Removing on behalf of Jorge Moya. This test is broken on
Windows due to it actually being able to resolve the path. There
is an actual Windows-specific bug somewhere, but we already have
sufficient test coverage of this with a different test, so removing
this was the approach suggested by Jorge.
llvm-svn: 342693
Yonghong Song [Thu, 20 Sep 2018 22:24:27 +0000 (22:24 +0000)]
bpf: check illegal usage of XADD insn return value
Currently, BPF has XADD (locked add) insn support and the
asm looks like:
lock *(u32 *)(r1 + 0) += r2
lock *(u64 *)(r1 + 0) += r2
The instruction itself does not have a return value.
At the source code level, users often use
__sync_fetch_and_add()
which eventually translates to XADD. The return value of
__sync_fetch_and_add() is supposed to be the old value
in the xadd memory location. Since BPF::XADD insn does not
support such a return value, this patch added a PreEmit
phase to check such a usage. If such an illegal usage
pattern is detected, a fatal error will be reported like
line 4: Invalid usage of the XADD return value
if compiled with -g, or
Invalid usage of the XADD return value
if compiled without -g.
Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
llvm-svn: 342692
Thomas Lively [Thu, 20 Sep 2018 22:08:27 +0000 (22:08 +0000)]
[WebAssembly][NFC] Add missing tests for indirect calls
Summary: Depends on D52105.
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D52254
llvm-svn: 342691
Thomas Lively [Thu, 20 Sep 2018 22:07:18 +0000 (22:07 +0000)]
[WebAssembly] Add v128 value type
Reviewers: sbc100, aheejin, dschuff
Subscribers: jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D52106
llvm-svn: 342690
Thomas Lively [Thu, 20 Sep 2018 22:04:44 +0000 (22:04 +0000)]
[WebAssembly] Add V128 value type to binary format
Summary: Adds the necessary support to lib/ObjectYAML and fixes SIMD
calls to allow the tests to work. Also removes some dead code that
would otherwise have to have been updated.
Reviewers: aheejin, dschuff, sbc100
Subscribers: jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D52105
llvm-svn: 342689
Jessica Paquette [Thu, 20 Sep 2018 21:53:25 +0000 (21:53 +0000)]
[MachineOutliner][NFC] Don't add MBBs with a size < 2 to the search space
The suffix tree won't ever consider sequences with a length less than 2.
Therefore, we really ought to not even consider them in the first place.
Also add a FIXME explaining that this should be defined in terms of the size
in B of an outlined call versus the size in B of the MBB.
llvm-svn: 342688
Rui Ueyama [Thu, 20 Sep 2018 21:40:38 +0000 (21:40 +0000)]
Rename a function. NFC.
llvm-svn: 342687
Rui Ueyama [Thu, 20 Sep 2018 21:29:14 +0000 (21:29 +0000)]
Make variable names shorter. NFC.
llvm-svn: 342686
Rui Ueyama [Thu, 20 Sep 2018 21:18:56 +0000 (21:18 +0000)]
Simplify. NFC.
llvm-svn: 342685
Xin Tong [Thu, 20 Sep 2018 21:16:16 +0000 (21:16 +0000)]
[GlobalDCE] AvailableExternal linkage is checked in isDiscardableIfUnused [NFC].
Summary:
AvailableExternal was not handled in isDiscardableIfUnused when isDiscardableIfUnused
was added in r158476. Till it was handled in r247044. This is a NFC.
Reviewers: pcc, tejohnson
Reviewed By: tejohnson
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D52319
llvm-svn: 342684
Sanjay Patel [Thu, 20 Sep 2018 21:10:14 +0000 (21:10 +0000)]
[InstCombine] rename test file, simplify tests, regenerate full checks; NFC
Fast-math is irrelevant for these transforms.
llvm-svn: 342683
Walter Lee [Thu, 20 Sep 2018 20:05:57 +0000 (20:05 +0000)]
[RegAllocGreedy] Fix crash in tryLocalSplit
tryLocalSplit only handles a single use block, but an interval may
have multiple use blocks. So don't crash in that case. This fixes
PR38795.
Differential revision: https://reviews.llvm.org/D52277
llvm-svn: 342682
Zachary Turner [Thu, 20 Sep 2018 19:57:49 +0000 (19:57 +0000)]
[PDB] Fix -Wcovered-switch-default warning.
llvm-svn: 342681
David Carlier [Thu, 20 Sep 2018 19:30:51 +0000 (19:30 +0000)]
[Hwasan] interceptor macro / extra comma removal
gcc being pedantic, removing the unnecessary comma.
Reviewers: eugenis, kcc
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D52305
llvm-svn: 342680
Erik Pilkington [Thu, 20 Sep 2018 19:00:03 +0000 (19:00 +0000)]
Fix an assert in -Wquoted-include-in-framework-header
Fixes rdar://
43692300
Differential revision: https://reviews.llvm.org/D52253
llvm-svn: 342679
Vedant Kumar [Thu, 20 Sep 2018 18:59:33 +0000 (18:59 +0000)]
[Bitcode] Address backwards compat bug in r342631
r342631 expanded bitc::METADATA_LOCATION by one element. The bitcode
metadata loader was changed in a backwards-incompatible way, leading to
crashes when disassembling old bitcode:
assertion: empty() && "PlaceholderQueue hasn't been flushed before being destroyed"
Assertion failed: (empty() && "PlaceholderQueue hasn't been flushed before being destroyed")
This commit teaches the metadata loader to assume that the newly-added
IsImplicitCode bit is 'false' when not present in old bitcode. I've added a
bitcode compat regression test.
rdar://
44645820
llvm-svn: 342678
Jessica Paquette [Thu, 20 Sep 2018 18:53:53 +0000 (18:53 +0000)]
[MachineOutliner][NFC] Move debug info emission to createOutlinedFunction
When you create an outlined function, you know everything you need to know
to decide if debug info should be created. If we emit debug info in
createOutlinedFunction, then we don't need to keep track of every IR function
we create.
llvm-svn: 342677
Sameer AbuAsal [Thu, 20 Sep 2018 18:39:34 +0000 (18:39 +0000)]
[inline Cost] Don't mark functions accessing varargs as non-inlinable
Summary:
rL323619 marks functions that are calling va_end as not viable for
inlining. This patch reverses that since this va_end doesn't need
access to the vriadic arguments list that are saved on the stack, only
va_start does.
Reviewers: efriedma, fhahn
Reviewed By: fhahn
Subscribers: eraman, haicheng, llvm-commits
Differential Revision: https://reviews.llvm.org/D52067
llvm-svn: 342675
Rui Ueyama [Thu, 20 Sep 2018 18:26:38 +0000 (18:26 +0000)]
Fix -Wtrigraphs.
llvm-svn: 342674
Rui Ueyama [Thu, 20 Sep 2018 18:24:19 +0000 (18:24 +0000)]
Add paretntheses around a C macro parameter.
llvm-svn: 342673
Erik Pilkington [Thu, 20 Sep 2018 18:12:24 +0000 (18:12 +0000)]
[Sema] Retain __restrict qualifiers when substituting a reference type.
Fixes rdar://
43760099
Differential revision: https://reviews.llvm.org/D52271
llvm-svn: 342672
Tatyana Krasnukha [Thu, 20 Sep 2018 17:57:24 +0000 (17:57 +0000)]
Replace boolean parameter with enum value according r342633
llvm-svn: 342671
Zachary Turner [Thu, 20 Sep 2018 17:48:44 +0000 (17:48 +0000)]
Fix warnings.
llvm-svn: 342670
Sanjay Patel [Thu, 20 Sep 2018 17:34:08 +0000 (17:34 +0000)]
[SelectionDAG] replace duplicated peekThroughBitcast helper functions; NFCI
x86 had 2 versions of peekThroughBitcast. DAGCombiner had 1. Plus, it had a 1-off implementation for the one-use variant.
Move the x86 versions of the code to SelectionDAG, so we don't have different copies of the code.
No functional change intended.
I'm putting this next to isBitwiseNot() because I am planning to use it in there. Another option is next to the
helpers in the ISD namespace (eg, ISD::isConstantSplatVector()). But if there's no good reason for those to be
there, I'd prefer to pull other helpers over to SelectionDAG in follow-up steps.
Differential Revision: https://reviews.llvm.org/D52285
llvm-svn: 342669
Eric Christopher [Thu, 20 Sep 2018 17:22:43 +0000 (17:22 +0000)]
Add testcases for r342667.
llvm-svn: 342668
Eric Christopher [Thu, 20 Sep 2018 17:21:56 +0000 (17:21 +0000)]
r342177 introduced a hint in cases where an #included file is not found. It tries to find a suggestion by removing leading or trailing non-alphanumeric characters and checking if a matching file exists, then it reports an error like:
include-likely-typo.c:3:10: error: '<empty_file_to_include.h>' file not found, did you mean 'empty_file_to_include.h'?
^~~~~~~~~~~~~~~~~~~~~~~~~~~
"empty_file_to_include.h"
1 error generated.
However, if a hint is not found, the error message will show only the trimmed name we use to look for a hint, so:
will result in:
include-leading-nonalpha-no-suggest.c:3:10: fatal error: 'non_existing_file_to_include.h' file not found
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
where the name reported after "fatal error:" doesn't match what the user wrote.
Patch by Jorge Gorbe!
Differential Revision: https://reviews.llvm.org/D52280
This change reports the original file name instead of the trimmed one when a suggestion is not found.
llvm-svn: 342667
Mike Rice [Thu, 20 Sep 2018 17:19:41 +0000 (17:19 +0000)]
[OPENMP] Fix spelling of getLoopCounter (NFC)
llvm-svn: 342666
Sanjay Patel [Thu, 20 Sep 2018 17:10:38 +0000 (17:10 +0000)]
[InstCombine] add tests for vector concat with binop (PR33026); NFC
llvm-svn: 342665
Fedor Sergeev [Thu, 20 Sep 2018 17:08:45 +0000 (17:08 +0000)]
[New PM] Introducing PassInstrumentation framework
Pass Execution Instrumentation interface enables customizable instrumentation
of pass execution, as per "RFC: Pass Execution Instrumentation interface"
posted 06/07/2018 on llvm-dev@
The intent is to provide a common machinery to implement all
the pass-execution-debugging features like print-before/after,
opt-bisect, time-passes etc.
Here we get a basic implementation consisting of:
* PassInstrumentationCallbacks class that handles registration of callbacks
and access to them.
* PassInstrumentation class that handles instrumentation-point interfaces
that call into PassInstrumentationCallbacks.
* Callbacks accept StringRef which is just a name of the Pass right now.
There were some ideas to pass an opaque wrapper for the pointer to pass instance,
however it appears that pointer does not actually identify the instance
(adaptors and managers might have the same address with the pass they govern).
Hence it was decided to go simple for now and then later decide on what the proper
mental model of identifying a "pass in a phase of pipeline" is.
* Callbacks accept llvm::Any serving as a wrapper for const IRUnit*, to remove direct dependencies
on different IRUnits (e.g. Analyses).
* PassInstrumentationAnalysis analysis is explicitly requested from PassManager through
usual AnalysisManager::getResult. All pass managers were updated to run that
to get PassInstrumentation object for instrumentation calls.
* Using tuples/index_sequence getAnalysisResult helper to extract generic AnalysisManager's extra
args out of a generic PassManager's extra args. This is the only way I was able to explicitly
run getResult for PassInstrumentationAnalysis out of a generic code like PassManager::run or
RepeatedPass::run.
TODO: Upon lengthy discussions we agreed to accept this as an initial implementation
and then get rid of getAnalysisResult by improving RepeatedPass implementation.
* PassBuilder takes PassInstrumentationCallbacks object to pass it further into
PassInstrumentationAnalysis. Callbacks registration should be performed directly
through PassInstrumentationCallbacks.
* new-pm tests updated to account for PassInstrumentationAnalysis being run
* Added PassInstrumentation tests to PassBuilderCallbacks unit tests.
Other unit tests updated with registration of the now-required PassInstrumentationAnalysis.
Made getName helper to return std::string (instead of StringRef initially) to fix
asan builtbot failures on CGSCC tests.
Reviewers: chandlerc, philip.pfaffe
Differential Revision: https://reviews.llvm.org/D47858
llvm-svn: 342664
Shafik Yaghmour [Thu, 20 Sep 2018 17:06:34 +0000 (17:06 +0000)]
Refactor FindVariable() core functionality into StackFrame out of SBFrame
rdar://problem/
14365983
Patch by Shafik Yaghmour
Differential Revision: https://reviews.llvm.org/D52247
llvm-svn: 342663
Sid Manning [Thu, 20 Sep 2018 16:32:19 +0000 (16:32 +0000)]
[ELF][HEXAGON] Set DefaultMaxPageSize to 64K
Update testcase to reflect the change.
llvm-svn: 342662
Calixte Denizet [Thu, 20 Sep 2018 16:21:09 +0000 (16:21 +0000)]
[profile] Fix tests in compiler-rt for patch in gcov (https://reviews.llvm.org/D49659)
Summary: Some tests are broken if patch in D49659 is accepted so this patch fixes them.
Reviewers: marco-c
Reviewed By: marco-c
Subscribers: dberris, delcypher, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D49721
llvm-svn: 342661
Zachary Turner [Thu, 20 Sep 2018 16:18:15 +0000 (16:18 +0000)]
Fix one more test failure.
llvm-svn: 342660
Zachary Turner [Thu, 20 Sep 2018 16:12:27 +0000 (16:12 +0000)]
[PDB] Fix failing test.
This test was missed on the last run since I only ran a subset
of them before commiting.
llvm-svn: 342659
Zachary Turner [Thu, 20 Sep 2018 16:12:05 +0000 (16:12 +0000)]
[PDB] Better printing of builtin types when using DIA dumper.
llvm-svn: 342658
Calixte Denizet [Thu, 20 Sep 2018 16:09:30 +0000 (16:09 +0000)]
[gcov] Fix wrong line hit counts when multiple blocks are on the same line
Summary:
The goal of this patch is to have the same behaviour than gcc-gcov.
Currently the hit counts for a line is the sum of the counts for each block on that line.
The idea is to detect the cycles in the graph of blocks in using the algorithm by Hawick & James.
The count for a cycle is the min of the counts for each edge in the cycle.
Once we've the count for each cycle, we can sum them and add the transition counts of those cycles.
Fix both https://bugs.llvm.org/show_bug.cgi?id=38065 and https://bugs.llvm.org/show_bug.cgi?id=38066
Reviewers: marco-c, davidxl
Reviewed By: marco-c
Subscribers: vsk, lebedev.ri, sylvestre.ledru, dblaikie, llvm-commits
Differential Revision: https://reviews.llvm.org/D49659
llvm-svn: 342657
Zachary Turner [Thu, 20 Sep 2018 15:50:13 +0000 (15:50 +0000)]
[PDB] Add the ability to map forward references to full decls.
Some records point to an LF_CLASS, LF_UNION, LF_STRUCTURE, or LF_ENUM
which is a forward reference and doesn't contain complete debug
information. In these cases, we'd like to be able to quickly locate the
full record. The TPI stream stores an array of pre-computed record hash
values, one for each type record. If we pre-process this on startup, we
can build a mapping from hash value -> {list of possible matching type
indices}. Since hashes of full records are only based on the name and or
unique name and not the full record contents, we can then use forward
ref record to compute the hash of what *would* be the full record by
just hashing the name, use this to get the list of possible matches, and
iterate those looking for a match on name or unique name.
llvm-pdbutil is updated to resolve forward references for the purposes
of testing (plus it's just useful).
Differential Revision: https://reviews.llvm.org/D52283
llvm-svn: 342656
Andrea Di Biagio [Thu, 20 Sep 2018 15:48:23 +0000 (15:48 +0000)]
[llvm-mca][BtVer2] Modify ANDN tests in zero-idioms-avx-256.s. NFC
Two test cases should have tested 256-bit variants of VANDN zero-idioms instead
of the 128-bit variants.
llvm-svn: 342655
David Major [Thu, 20 Sep 2018 15:22:21 +0000 (15:22 +0000)]
Fix test after r342652
llvm-svn: 342654
Sanjay Patel [Thu, 20 Sep 2018 15:21:52 +0000 (15:21 +0000)]
[IR] add shuffle query for vector concatenation
This can be used for combining and in the vectorizers/cost models.
llvm-svn: 342653
David Major [Thu, 20 Sep 2018 14:59:33 +0000 (14:59 +0000)]
[winasan] Unpoison the stack in NtTerminateThread
In long-running builds we've seen some ASan complaints during thread creation that we suspect are due to leftover poisoning from previous threads whose stacks occupied that memory. This patch adds a hook that unpoisons the stack just before the NtTerminateThread syscall.
Differential Revision: https://reviews.llvm.org/D52091
llvm-svn: 342652
Kostya Kortchinsky [Thu, 20 Sep 2018 14:50:06 +0000 (14:50 +0000)]
[sanitizer] Make __sanitizer::CheckFailed not public
Summary:
As far as I can tell, there is no reason why `__sanitizer::CheckFailed` should
be exported. Looking back in time, it was added with the FIXME with the
following by @timurrrr:
```
[*San/RTL] Fix minor breakage
Grumbling: this hasn't been caught by running 'make check-{a,l,t}san check-sanitizer'
```
I can't find any detail about the breakage, all tests seem to work for me, so
maybe Windows (@rnk?) or something I have no setup for.
The reason to make it private (past the FIXME) is that Scudo defines its own
(without callback) and I am trying to make the .so be loadable with the UBsan
one (that has its own public `CheckFailed`) with as little drama as possible.
Reviewers: eugenis, rnk
Reviewed By: eugenis, rnk
Subscribers: kubamracek, delcypher, #sanitizers, timurrrr, rnk, llvm-commits
Differential Revision: https://reviews.llvm.org/D52279
llvm-svn: 342651
Sanjay Patel [Thu, 20 Sep 2018 14:36:09 +0000 (14:36 +0000)]
[IR] reduce duplication in unittest for shuffles; NFC
llvm-svn: 342650
David Major [Thu, 20 Sep 2018 14:28:50 +0000 (14:28 +0000)]
[winasan] Reduce hotpatch prefix check to 8 bytes
Same idea as r310419: The 8 byte nop is a suffix of the 9 byte nop, and we need at most 6 bytes.
Differential Revision: https://reviews.llvm.org/D51788
llvm-svn: 342649
Alexey Bataev [Thu, 20 Sep 2018 13:54:02 +0000 (13:54 +0000)]
[OPENMP] Add support for mapping memory pointed by member pointer.
Added support for map(s, s.ptr[0:1]) kind of mapping.
llvm-svn: 342648
Jesper Antonsson [Thu, 20 Sep 2018 13:37:28 +0000 (13:37 +0000)]
[InstCombine] Handle vector compares in foldGEPIcmp()
Summary:
This is to fix PR38984 "InstCombine assertion at vector gep/icmp folding":
https://bugs.llvm.org/show_bug.cgi?id=38984
Reviewers: majnemer, spatel, lattner, lebedev.ri
Reviewed By: lebedev.ri
Subscribers: lebedev.ri, llvm-commits
Differential Revision: https://reviews.llvm.org/D52263
llvm-svn: 342647
Guillaume Chatelet [Thu, 20 Sep 2018 13:37:04 +0000 (13:37 +0000)]
[llvm-exegesis] Fix broken build bots.
Reviewers: javed.absar
Subscribers: tschuett, courbet, llvm-commits
Differential Revision: https://reviews.llvm.org/D52302
llvm-svn: 342646
Simon Pilgrim [Thu, 20 Sep 2018 13:10:22 +0000 (13:10 +0000)]
[X86][SSE] Remove UNPCKL(SHUFFLE)->UNPCKH custom combine
This can be achieved more generally by combineX86ShufflesRecursively.
llvm-svn: 342645
Guillaume Chatelet [Thu, 20 Sep 2018 12:22:18 +0000 (12:22 +0000)]
[llvm-exegesis] Improve Register Setup (roll forward of D51856).
Summary:
Added function to set a register to a particular value + tests.
Add EFLAGS test, use new setRegTo instead of setRegToConstant.
Reviewers: courbet, javed.absar
Subscribers: llvm-commits, tschuett, mgorny
Differential Revision: https://reviews.llvm.org/D52297
llvm-svn: 342644
Benjamin Kramer [Thu, 20 Sep 2018 12:21:24 +0000 (12:21 +0000)]
[ADT] Bring back memmove to make GCC 5.4 happy
All other GCCs look good so far. GCC 5.4 complains about strict
aliasing, so fix that.
llvm-svn: 342643
Simon Pilgrim [Thu, 20 Sep 2018 12:11:38 +0000 (12:11 +0000)]
[X86][SSE] Remove PSHUFLW/PSHUFHW combineRedundantHalfShuffle combine
This can be achieved more generally by combineX86ShufflesRecursively and was causing a fuzz test failure found by Mikael Holmén.
llvm-svn: 342642
Alex Bradbury [Thu, 20 Sep 2018 11:40:43 +0000 (11:40 +0000)]
[RISCV][MC] Modify evaluateConstantImm interface to allow reuse from addExpr
This is a trivial refactoring that I'm committing now as it makes a patch I'm
about to post for review easier to follow. There is some overlap between
evaluateConstantImm and addExpr in RISCVAsmParser. This patch allows
evaluateConstantImm to be reused from addExpr to remove this overlap. The
benefit will be greater when a future patch adds extra code to allows
immediates to be evaluated from constant symbols (e.g. `.equ CONST, 0x1234`).
No functional change intended.
llvm-svn: 342641
Andrea Di Biagio [Thu, 20 Sep 2018 11:07:57 +0000 (11:07 +0000)]
Fix -Wdocumentation warnings introduced by r342555. NFC
These were reported by buildbot llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast (see
build #36798).
llvm-svn: 342640
Simon Pilgrim [Thu, 20 Sep 2018 10:59:08 +0000 (10:59 +0000)]
Fix line-endings. NFCI.
llvm-svn: 342639
Sven van Haastregt [Thu, 20 Sep 2018 10:07:27 +0000 (10:07 +0000)]
[OpenCL] Diagnose redundant address space conversion
Add a warning if a parameter with a named address space is passed
to a to_addr builtin.
For example:
int i;
to_private(&i); // generate warning as conversion from private to private is redundant.
Patch by Alistair Davies.
Differential Revision: https://reviews.llvm.org/D51411
llvm-svn: 342638
Benjamin Kramer [Thu, 20 Sep 2018 10:02:06 +0000 (10:02 +0000)]
[ADT] Try again to use the same version of llvm::Optional on all compilers
The miscompile doesn't reproduce for me anymore with GCC 7.3. I'll watch
the buildbots closely.
Having different versions of Optional is an ABI violation when linking
GCC- and clang-built code together.
llvm-svn: 342637
Hans Wennborg [Thu, 20 Sep 2018 09:29:35 +0000 (09:29 +0000)]
FileCheckify test/Driver/Xarch.c
llvm-svn: 342636
George Rimar [Thu, 20 Sep 2018 09:17:36 +0000 (09:17 +0000)]
[DWARF] - Emit the correct value for DW_AT_addr_base.
Currently, we emit DW_AT_addr_base that points to the beginning of
the .debug_addr section. That is not correct for the DWARF5 case because address
table contains the header and the attribute should point to the first entry
following the header.
This is currently the reason why LLDB does not work with such executables correctly.
Patch fixes the issue.
Differential revision: https://reviews.llvm.org/D52168
llvm-svn: 342635