Erik Pilkington [Mon, 10 Sep 2018 22:20:09 +0000 (22:20 +0000)]
[Sema][ObjC] Infer availability of +new from availability of -init.
When defined in NSObject, +new will call -init. If -init has been marked
unavailable, diagnose uses of +new.
rdar://
18335828
Differential revision: https://reviews.llvm.org/D51189
llvm-svn: 341874
Lang Hames [Mon, 10 Sep 2018 22:09:11 +0000 (22:09 +0000)]
[ORC] Render unresolved symbol addresses as "<not resolved>" in JITDylib::dump.
This is easier to spot among the real addresses than "0x0000000000000000".
llvm-svn: 341873
Lang Hames [Mon, 10 Sep 2018 22:08:57 +0000 (22:08 +0000)]
[ORC] Simplify LLJIT::Create by removing the ExecutionSession parameter.
The Create method can just construct the ExecutionSession, rather than having the
client pass it in.
llvm-svn: 341872
Erich Keane [Mon, 10 Sep 2018 21:57:53 +0000 (21:57 +0000)]
Fix test regression in r341862
The commit updates when AES is enabled, but failed to update the tests.
This patch fixes them.
llvm-svn: 341871
Petr Hosek [Mon, 10 Sep 2018 21:54:56 +0000 (21:54 +0000)]
[ELF] Don't emit .relr.dyn section if there are no relocs
This resolves PR38875.
Differential Revision: https://reviews.llvm.org/D51834
llvm-svn: 341870
Erik Pilkington [Mon, 10 Sep 2018 21:54:04 +0000 (21:54 +0000)]
[AST] Fix a crash on invalid.
Problem was that we were appending to the source location info buffer in the
copy assignment operator (instead of overwriting).
rdar://
42746401
llvm-svn: 341869
Craig Topper [Mon, 10 Sep 2018 21:49:01 +0000 (21:49 +0000)]
[X89] Explicitly enable aes in aes-schedule.ll to fix failures after r341861.
llvm-svn: 341868
JF Bastien [Mon, 10 Sep 2018 21:43:17 +0000 (21:43 +0000)]
Fix bit_cast properly
Mismatched braces.
llvm-svn: 341867
JF Bastien [Mon, 10 Sep 2018 21:41:14 +0000 (21:41 +0000)]
Fix bit_cast __is_trivially_copyable
It's a function-like builtin, not a template.
llvm-svn: 341866
JF Bastien [Mon, 10 Sep 2018 21:33:45 +0000 (21:33 +0000)]
[ADT] bit_cast: check for is_trivially_copyable more portably
Summary:
It turns out that isPodLike isn't a good workaround for is_trivially_copyable for bit_cast's purpose. In D51872 Louis points out that tuple and pair really aren't a good fit, and for bit_cast I want to capture array. This patch instead checks is_trivially_copyable directly in bit_cast for all but GCC 4.x. In GCC 4.x developers only check for sizeof match, which means any mistake they make will succeed locally and fail on the bots. Realistically that's few developers and they'll be left behind once we upgrade past C++11.
This will allow using bit_cast with std::array.
Subscribers: dexonsmith, llvm-commits, ldionne, rsmith
Differential Revision: https://reviews.llvm.org/D51888
llvm-svn: 341865
Zachary Turner [Mon, 10 Sep 2018 21:31:21 +0000 (21:31 +0000)]
Re-run clang-format on one file.
clang-format was getting confused due to the presence of a macro
invocation that was not terminated by a semicolon. Fixed this by
terminating the macro lines with semicolons and re-ran clang-format
on the file.
llvm-svn: 341864
Zachary Turner [Mon, 10 Sep 2018 21:30:59 +0000 (21:30 +0000)]
[PDB] Change uint32_t to SymIndex wherever it makes sense.
Although it's just a typedef, it helps for readability. NFC.
llvm-svn: 341863
Erich Keane [Mon, 10 Sep 2018 21:12:21 +0000 (21:12 +0000)]
Move AESNI generation to Skylake and Goldmont
The instruction set first appeared with Westmere, but not all processors
in that and the next few generations have the instructions. According to
Wikipedia[1], the first generation in which all SKUs have AES
instructions are Skylake and Goldmont. I can't find any Skylake,
Kabylake, Kabylake-R or Cannon Lake currently listed at
https://ark.intel.com that says "IntelĀ® AES New Instructions" "No".
This matches GCC commit
https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01940.html
[1] https://en.wikipedia.org/wiki/AES_instruction_set
Patch By: thiagomacieira
Differential Revision: https://reviews.llvm.org/D51510
llvm-svn: 341862
Erich Keane [Mon, 10 Sep 2018 21:12:19 +0000 (21:12 +0000)]
Move FeatureAES from SLM, WSM and SNB to GLM and SKL
Complements https://reviews.llvm.org/D51510 and matches
https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01940.html
GoldmontProc already has FeatureAES.
Patch By: thiagomacieira
Differential Revision: https://reviews.llvm.org/D51565
llvm-svn: 341861
JF Bastien [Mon, 10 Sep 2018 20:42:56 +0000 (20:42 +0000)]
Implement -Watomic-implicit-seq-cst
Summary:
_Atomic and __sync_* operations are implicitly sequentially-consistent. Some
codebases want to force explicit usage of memory order instead. This warning
allows them to know where implicit sequentially-consistent memory order is used.
The warning isn't on by default because _Atomic was purposefully designed to
have seq_cst as the default: the idea was that it's the right thing to use most
of the time. This warning allows developers who disagree to enforce explicit
usage instead.
A follow-up patch will take care of C++'s std::atomic. It'll be different enough
from this patch that I think it should be separate: for C++ the atomic
operations all have a memory order parameter (or two), but it's defaulted. I
believe this warning should trigger when the default is used, but not when
seq_cst is used explicitly (or implicitly as the failure order for cmpxchg).
<rdar://problem/
28172966>
Reviewers: rjmccall
Subscribers: dexonsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D51084
llvm-svn: 341860
Craig Topper [Mon, 10 Sep 2018 20:31:27 +0000 (20:31 +0000)]
[X86] Mark the ISD::SETLT/SETLE condition codes as illegal for v32i16/v64i8 to match the other vector types.
I'm having a hard time finding a test case for this, but we should be consistent here. The fact that we canonicalize all zeros and all ones constants to vXi32 and all other constants to loads makes this hard to hit the easy DAG combine infinite loop we get for some of the other types.
llvm-svn: 341859
Richard Smith [Mon, 10 Sep 2018 20:31:03 +0000 (20:31 +0000)]
Enhance -Wc++14-compat for class template argument deduction to list the
deduced type (if known).
llvm-svn: 341858
Martin Storsjo [Mon, 10 Sep 2018 20:28:06 +0000 (20:28 +0000)]
[Windows] Include BaseTsd.h with lowercase
This fixes building on a case sensitive filesystem with mingw-w64
headers, where all headers are lowercase. This header actually also
is named with a lowercase name in the Windows SDK as well.
Differential Revision: https://reviews.llvm.org/D51877
llvm-svn: 341857
Stella Stamenova [Mon, 10 Sep 2018 20:24:05 +0000 (20:24 +0000)]
[lit] Disable shtest-timeout on Windows
Summary: This is the only test that is still failing on Windows - or rather, it is expected to fail on the bots, but passes on the new bot that we're preparing causing a failure, so I'm going to disable it. Since the test has rarely, if ever, passed on the bots, this should have the same effect and it will unblock the creation of the new bot.
Reviewers: asmith, delcypher, zturner
Subscribers: stella.stamenova, llvm-commits
Differential Revision: https://reviews.llvm.org/D51871
llvm-svn: 341856
Alina Sbirlea [Mon, 10 Sep 2018 20:13:01 +0000 (20:13 +0000)]
API to update MemorySSA for cloned blocks and added CFG edges.
Summary:
End goal is to update MemorySSA in all loop passes. LoopUnswitch clones all blocks in a loop. SimpleLoopUnswitch clones some blocks. LoopRotate clones some instructions.
Some of these loop passes also make CFG changes.
This is an API based on what I found needed in LoopUnswitch, SimpleLoopUnswitch, LoopRotate, LoopInstSimplify, LoopSimplifyCFG.
Adding dependent patches using this API for context.
Reviewers: george.burgess.iv, dberlin
Subscribers: sanjoy, jlebar, Prazek, llvm-commits
Differential Revision: https://reviews.llvm.org/D45299
llvm-svn: 341855
Roman Lebedev [Mon, 10 Sep 2018 19:59:18 +0000 (19:59 +0000)]
[clang-tidy] ExprMutationAnalyzer: construct from references. Fixes PR38888
Summary:
I have hit this the rough way, while trying to use this in D51870.
There is no particular point in storing the pointers, and moreover
the pointers are assumed to be non-null, and that assumption is not
enforced. If they are null, it won't be able to do anything good
with them anyway.
Initially i thought about simply adding asserts() that they are
not null, but taking/storing references looks like even cleaner solution?
Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=38888 | PR38888 ]]
Reviewers: JonasToth, shuaiwang, alexfh, george.karpenkov
Reviewed By: shuaiwang
Subscribers: xazax.hun, a.sidorin, Szelethus, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D51884
llvm-svn: 341854
JF Bastien [Mon, 10 Sep 2018 19:56:42 +0000 (19:56 +0000)]
NFC: bit.h don't warn on strict aliasing for GCC <= 7.1
Summary: Addressed https://bugs.llvm.org/show_bug.cgi?id=38885
Subscribers: dexonsmith, llvm-commits, rsmith, steven_wu, RKSimon, Abhilash, srhines
Differential Revision: https://reviews.llvm.org/D51869
llvm-svn: 341853
Petr Hosek [Mon, 10 Sep 2018 19:34:44 +0000 (19:34 +0000)]
[ADT] Support converting to lowercase string in toHex
This is useful in certain use-cases such as D51833.
Differential Revision: https://reviews.llvm.org/D51835
llvm-svn: 341852
Krzysztof Parzyszek [Mon, 10 Sep 2018 18:49:16 +0000 (18:49 +0000)]
[Hexagon] Split large offsets into properly aligned addends
llvm-svn: 341851
Sanjay Patel [Mon, 10 Sep 2018 18:37:59 +0000 (18:37 +0000)]
[InstCombine] use SelectInst operand names to make code clearer; NFC
Cleanup step for D51433.
llvm-svn: 341850
Ted Woodward [Mon, 10 Sep 2018 18:19:01 +0000 (18:19 +0000)]
Fix raw address breakpoints not resolving
Summary: An address breakpoint of the form "b 0x1000" won't resolve if it's created while the process isn't running. This patch deletes Address::SectionWasDeleted, renames Address::SectionWasDeletedPrivate to SectionWasDeleted (and makes it public), and changes the section check in Breakpoint::ModulesChanged back to its original form
Reviewers: jingham, #lldb
Reviewed By: jingham
Subscribers: davide, lldb-commits
Differential Revision: https://reviews.llvm.org/D51816
llvm-svn: 341849
Shuai Wang [Mon, 10 Sep 2018 18:05:13 +0000 (18:05 +0000)]
[clang-tidy] Handle unresolved expressions in ExprMutationAnalyzer
Summary:
- If a function is unresolved, assume it mutates its arguments
- Follow unresolved member expressions for nested mutations
Reviewers: aaron.ballman, JonasToth, george.karpenkov
Subscribers: xazax.hun, a.sidorin, cfe-commits
Differential Revision: https://reviews.llvm.org/D50619
llvm-svn: 341848
Alexandre Ganea [Mon, 10 Sep 2018 17:54:32 +0000 (17:54 +0000)]
[clang-cl] Enable -march option
This change allows usage of -march when using the clang-cl driver. This is similar to MSVC's /arch; however -march can target precisely all supported CPUs, while /arch has a more restricted set.
Differential Revision: https://reviews.llvm.org/D51806
llvm-svn: 341847
Martin Storsjo [Mon, 10 Sep 2018 17:41:40 +0000 (17:41 +0000)]
[MinGW] Hook up the --require-defined option to -include:
Differential Revision: https://reviews.llvm.org/D51840
llvm-svn: 341846
Sanjay Patel [Mon, 10 Sep 2018 17:40:15 +0000 (17:40 +0000)]
[x86] test codegen for unsigned saturated add; NFC
All of the ISA holes are going to make this difficult,
but we can't canonicalize the IR and try to solve PR14613
until we have backend support to get this right.
https://bugs.llvm.org/show_bug.cgi?id=14613
https://rise4fun.com/Alive/Guv
https://rise4fun.com/Alive/AADG
llvm-svn: 341845
Tatyana Krasnukha [Mon, 10 Sep 2018 17:09:09 +0000 (17:09 +0000)]
[ARC] Fix macro usage (DEBUG -> LLVM_DEBUG)
llvm-svn: 341844
Alexander Timofeev [Mon, 10 Sep 2018 16:42:49 +0000 (16:42 +0000)]
[AMDGPU] Preliminary patch for divergence driven instruction selection. Inline immediate move to V_MADAK_F32.
Differential revision: https://reviews.llvm.org/D51586
Reviewer: rampitec
llvm-svn: 341843
Adrian Prantl [Mon, 10 Sep 2018 16:14:28 +0000 (16:14 +0000)]
Remove all uses of DIFlagBlockByrefStruct
This patch removes the last reason why DIFlagBlockByrefStruct from
Clang by directly implementing the drilling into the member type done
in DwarfDebug::DbgVariable::getType() into the frontend.
rdar://problem/
31629055
Differential Revision: https://reviews.llvm.org/D51807
llvm-svn: 341842
Philip Reames [Mon, 10 Sep 2018 16:00:27 +0000 (16:00 +0000)]
[AST] Visit memtransfer arguments in order
The only point to this change is the test diffs. When I remove this code entirely (in favor of the recently added generic handling), I don't want there to be any confusion due to spurious test diffs.
As an aside, the fact out tests are AST construction order dependent is not great. I thought about fixing that, but the reasonable schemes I might want (e.g. sort by name) need the test diffs anyways.
Philip
llvm-svn: 341841
Petar Jovanovic [Mon, 10 Sep 2018 15:56:52 +0000 (15:56 +0000)]
[MIPS GlobalISel] Select icmp
Select 32bit integer compare instructions for MIPS32.
Patch by Petar Avramovic.
Differential Revision: https://reviews.llvm.org/D51489
llvm-svn: 341840
Sebastian Pop [Mon, 10 Sep 2018 15:42:17 +0000 (15:42 +0000)]
HotColdSplitting: fix test failing because of last commit
llvm-svn: 341839
Sebastian Pop [Mon, 10 Sep 2018 15:08:02 +0000 (15:08 +0000)]
HotColdSplitting: check that target supports cold calling convention
Before tagging a function with coldcc make sure the target supports cold calling
convention. Without this patch HotColdSplitting pass fails on aarch64 with:
fatal error: error in backend: Unsupported calling convention.
llvm-svn: 341838
Sebastian Pop [Mon, 10 Sep 2018 15:07:59 +0000 (15:07 +0000)]
add flag instead of using a constant [NFC]
llvm-svn: 341837
Sebastian Pop [Mon, 10 Sep 2018 15:07:56 +0000 (15:07 +0000)]
make flag name more specific to gvn [NFC]
llvm-svn: 341836
Gil Rapaport [Mon, 10 Sep 2018 14:56:24 +0000 (14:56 +0000)]
[LSR] Add tests for small constants; NFC
LSR reassociates small constants that fit into add immediate operands as
unfolded offset. Since unfolded offset is not combined with loop-invariant
registers, LSR does not consider solutions that bump invariant registers by
these constants outside the loop.
llvm-svn: 341835
Joachim Protze [Mon, 10 Sep 2018 14:34:54 +0000 (14:34 +0000)]
[OMPT] Update types according to TR7
Some types and callback signatures have changed from TR6 to TR7.
Major changes (only adding signatures and stubs):
(-remove idle callback) done by D48362
-add reduction and dispatch callback
-add get_task_memory and finalize_tool runtime entry points
-ompt_invoker_t becomes ompt_parallel_flag_t
-more types of sync_regions
Patch provided by Simon Convent
Reviewers: hbae, protze.joachim
Differential Revision: https://reviews.llvm.org/D50774
llvm-svn: 341834
Erich Keane [Mon, 10 Sep 2018 14:31:56 +0000 (14:31 +0000)]
Prevent cpu-specific/cpu-dispatch from giong on a lambda.
It is non-sensical to use cpu-specific/cpu-dispatch multiversioning
on a lambda, so prevent it when trying to add the attribute.
llvm-svn: 341833
Kirill Bobyrev [Mon, 10 Sep 2018 14:31:38 +0000 (14:31 +0000)]
[clangd] Unbreak buildbots after r341802
Solution: use std::move when returning result from toJSON(...).
llvm-svn: 341832
Tim Northover [Mon, 10 Sep 2018 14:26:44 +0000 (14:26 +0000)]
InstCombine: move hasOneUse check to the top of foldICmpAddConstant
There were two combines not covered by the check before now, neither of which
actually differed from normal in the benefit analysis.
The most recent seems to be because it was just added at the top of the
function (naturally). The older is from way back in 2008 (r46687) when we just
didn't put those checks in so routinely, and has been diligently maintained
since.
llvm-svn: 341831
Kadir Cetinkaya [Mon, 10 Sep 2018 14:22:42 +0000 (14:22 +0000)]
[clangd] Add unittests for D51038
Reviewers: ilya-biryukov, ioeric, hokein
Reviewed By: ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, cfe-commits
Differential Revision: https://reviews.llvm.org/D51039
llvm-svn: 341830
Alexandre Ganea [Mon, 10 Sep 2018 14:07:11 +0000 (14:07 +0000)]
Buildfix for r341825
llvm-svn: 341827
Benjamin Kramer [Mon, 10 Sep 2018 13:55:38 +0000 (13:55 +0000)]
[Sparc] Move SparcTargetStreamer.h to the MC Desc, where the implementation is already
llvm-svn: 341826
Alexandre Ganea [Mon, 10 Sep 2018 13:51:21 +0000 (13:51 +0000)]
[LLD][COFF] Cleanup error messages / add more coverage tests
- Log the reason for a PDB or precompiled-OBJ load failure
- Properly handle out-of-date PDB or precompiled-OBJ signature by displaying a corresponding error
- Slightly change behavior on PDB failure: any subsequent load attempt from another OBJ would result in the same error message being logged
- Slightly change behavior on PDB failure: retry with filename only if previous error was ENOENT ("no such file or directory")
- Tests: a. for native PDB errors; b. cover all the cases above
Differential Revision: https://reviews.llvm.org/D51559
llvm-svn: 341825
Kadir Cetinkaya [Mon, 10 Sep 2018 13:46:28 +0000 (13:46 +0000)]
[clang] Make sure codecompletion is called for calls even when inside a token.
Summary:
Currently CodeCompleteCall only gets called after a comma or parantheses. This
patch makes sure it is called even at the cases like:
```foo(1^);```
Reviewers: ilya-biryukov, ioeric, hokein
Reviewed By: ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, cfe-commits
Differential Revision: https://reviews.llvm.org/D51038
llvm-svn: 341824
Nico Weber [Mon, 10 Sep 2018 13:20:16 +0000 (13:20 +0000)]
Remove an effectively unused local variable.
llvm-svn: 341823
Benjamin Kramer [Mon, 10 Sep 2018 12:53:46 +0000 (12:53 +0000)]
[Target] Untangle disassemblers
Disassemblers cannot depend on main target headers. The same is true for
MCTargetDesc, but there's a lot more cleanup needed for that.
llvm-svn: 341822
Benjamin Kramer [Mon, 10 Sep 2018 12:32:06 +0000 (12:32 +0000)]
Don't create a temporary vector of loop blocks just to iterate over them.
Loop's getBlocks returns an ArrayRef.
llvm-svn: 341821
John Brawn [Mon, 10 Sep 2018 12:23:05 +0000 (12:23 +0000)]
[GVN] Invalidate cached info for values replaced by equality propagation
When GVN propagates an equality by replacing one value with another it also
needs to invalidate the cached information for the value being replaced.
Differential Revision: https://reviews.llvm.org/D51218
llvm-svn: 341820
Matt Arsenault [Mon, 10 Sep 2018 12:16:11 +0000 (12:16 +0000)]
AMDGPU: Remove function pointer type hack
Now the pointer size should always be correct and
we don't need to improperly inspect the pointee type.
llvm-svn: 341806
Matt Arsenault [Mon, 10 Sep 2018 11:59:27 +0000 (11:59 +0000)]
AMDGPU: Stop reporting is-noop addrspacecast for constant 32-bit
This will require something to cast. Before this would eliminate
the cast, which would result in copies of $noreg.
llvm-svn: 341803
Kirill Bobyrev [Mon, 10 Sep 2018 11:51:05 +0000 (11:51 +0000)]
[clangd] Implement FuzzyFindRequest JSON (de)serialization
JSON (de)serialization of `FuzzyFindRequest` might be useful for both
D51090 and D51628. Also, this allows precise logging of the fuzzy find
requests.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D51852
llvm-svn: 341802
Matt Arsenault [Mon, 10 Sep 2018 11:49:23 +0000 (11:49 +0000)]
DAG: Handle odd vector sizes in calling conv splitting
This already worked if only one register piece was used,
but didn't if a type was split into multiple, unequal
sized pieces.
Fixes not splitting 3i16/v3f16 into two registers for
AMDGPU.
This will also allow fixing the ABI for 16-bit vectors
in a future commit so that it's the same for all subtargets.
llvm-svn: 341801
Kirill Bobyrev [Mon, 10 Sep 2018 11:46:07 +0000 (11:46 +0000)]
[clangd] Add symbol slab size to index memory consumption estimates
Currently, `SymbolIndex::estimateMemoryUsage()` returns the "overhead"
estimate, i.e. the estimate of the Index data structure excluding
backing data (such as Symbol Slab and Reference Slab). This patch
propagates information about paired data size where necessary.
Reviewed By: ioeric, sammccall
Differential Revision: https://reviews.llvm.org/D51539
llvm-svn: 341800
Simon Pilgrim [Mon, 10 Sep 2018 10:45:04 +0000 (10:45 +0000)]
[llvm-exegesis] Ignore double spaced separators in asm strings
Some asm has double spaces between operands, the deserializer was keeping these empty split pieces, causing assertions later on:
'ADC16mi RDI i_0x1x i_0x0x i_0x1x'
llvm-svn: 341799
Carl Ritson [Mon, 10 Sep 2018 10:14:48 +0000 (10:14 +0000)]
[AMDGPU] Prevent sequences of non-instructions disrupting GCNHazardRecognizer wait state counting
Summary:
This fixes a bug where a large number of implicit def instructions can fill the GCNHazardRecognizer lookahead buffer causing required NOPs to not be inserted.
Reviewers: nhaehnle, arsenm
Reviewed By: arsenm
Subscribers: sheredom, kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D51726
Change-Id: Ie75338f94de704ee5816b05afd0c922c6748a95b
llvm-svn: 341798
Sam McCall [Mon, 10 Sep 2018 10:00:47 +0000 (10:00 +0000)]
[clangd] Fix async index loading (from r341376).
Summary:
This wasn't actually async (due to std::future destructor blocking).
If it were, we would have clean shutdown issues if main returned
and destroyed Placeholder before the thread is done with it.
We could attempt to avoid any blocking by using shared_ptr or weak_ptr tricks so
the thread can detect Placeholder's destruction, but there are other potential
issues (e.g. loadIndex does tracing, and we'll destroy the tracer...)
Instead, once LSPServer::run returns, we wait for the index to finish loading
before exiting. Performance is not critical in this situation.
Reviewers: ilya-biryukov
Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D51674
llvm-svn: 341797
Adam Balogh [Mon, 10 Sep 2018 09:19:54 +0000 (09:19 +0000)]
[Analyzer] Commit fix for rL341790/rC341790
Test file was accidentally not added for rL341790/rC341790 and subsequant patches.
llvm-svn: 341795
Adam Balogh [Mon, 10 Sep 2018 09:07:47 +0000 (09:07 +0000)]
[Analyzer] Iterator Checker - Part 8: Support for assign, clear, insert, emplace and erase operations
This patch adds support for the following operations in the iterator checkers: assign, clear, insert, insert_after, emplace, emplace_after, erase and erase_after. This affects mismatched iterator checks ("this" and parameter must match) and invalidation checks (according to the standard).
Differential Revision: https://reviews.llvm.org/D32904
llvm-svn: 341794
Adam Balogh [Mon, 10 Sep 2018 09:06:31 +0000 (09:06 +0000)]
[Analyzer] Iterator Checker - Part 7: Support for push and pop operations
This patch adds support for the following operations in the iterator checkers: push_back, push_front, emplace_back, emplace_front, pop_back and pop_front. This affects iterator range checks (range is extended after push and emplace and reduced after pop operations) and invalidation checks (according to the standard).
Differential Revision: https://reviews.llvm.org/D32902
llvm-svn: 341793
Adam Balogh [Mon, 10 Sep 2018 09:05:31 +0000 (09:05 +0000)]
[Analyzer] Iterator Checker - Part 6: Mismatched iterator checker for constructors and comparisons
Extension of the mismatched iterator checker for constructors taking range of first..last (first and last must be iterators of the same container) and also for comparisons of iterators of different containers (one does not compare iterators of different containers, since the set of iterators is partially ordered, there are no relations between iterators of different containers, except that they are always non-equal).
Differential Revision: https://reviews.llvm.org/D32860
llvm-svn: 341792
Adam Balogh [Mon, 10 Sep 2018 09:04:27 +0000 (09:04 +0000)]
[Analyzer] Iterator Checker - Part 5: Move Assignment of Containers
If a container is moved by its move assignment operator, according to the standard all their iterators except the past-end iterators remain valid but refer to the new container. This patch introduces support for this case in the iterator checkers.
Differential Revision: https://reviews.llvm.org/D32859
llvm-svn: 341791
Adam Balogh [Mon, 10 Sep 2018 09:03:22 +0000 (09:03 +0000)]
[Analyzer] Iterator Checker - Part 4: Mismatched iterator checker for function parameters
New check added to the checker which checks whether iterator parameters of template functions typed by the same template parameter refer to the same container.
Differential Revision: https://reviews.llvm.org/D32845
llvm-svn: 341790
Hans Wennborg [Mon, 10 Sep 2018 08:57:12 +0000 (08:57 +0000)]
ReleaseNotes: update links to use https
llvm-svn: 341789
Hans Wennborg [Mon, 10 Sep 2018 08:52:31 +0000 (08:52 +0000)]
ReleaseNotes: update links to use https
llvm-svn: 341788
Hans Wennborg [Mon, 10 Sep 2018 08:52:04 +0000 (08:52 +0000)]
ReleaseNotes: update links to use https
llvm-svn: 341787
Hans Wennborg [Mon, 10 Sep 2018 08:51:25 +0000 (08:51 +0000)]
ReleaseNotes: update links to use https
llvm-svn: 341786
Hans Wennborg [Mon, 10 Sep 2018 08:50:31 +0000 (08:50 +0000)]
ReleaseNotes: update links to use https
llvm-svn: 341785
Kirill Bobyrev [Mon, 10 Sep 2018 08:23:53 +0000 (08:23 +0000)]
[clangd] NFC: Rename DexIndex to Dex
Also, cleanup some redundant includes.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D51774
llvm-svn: 341784
Aleksandr Urakov [Mon, 10 Sep 2018 08:08:43 +0000 (08:08 +0000)]
[PDB] Restore AST from PDB symbols
Summary:
This patch adds an implementation of retrieving of declarations and declaration
contexts based on PDB symbols.
PDB has different type symbols for const-qualified types, and this
implementation ensures that only one declaration was created for both const
and non-const types, but creates different compiler types for them.
The implementation also processes the case when there are two symbols
corresponding to a variable. It's possible e.g. for class static variables,
they has one global symbol and one symbol belonging to a class.
PDB has no info about namespaces, so this implementation parses the full symbol
name and tries to figure out if the symbol belongs to namespace or not,
and then creates nested namespaces if necessary.
Reviewers: asmith, zturner, labath
Reviewed By: asmith
Subscribers: aleksandr.urakov, teemperor, lldb-commits, stella.stamenova
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D51162
llvm-svn: 341782
Kirill Bobyrev [Mon, 10 Sep 2018 07:57:28 +0000 (07:57 +0000)]
[clangd] Make advanceTo() faster on Posting Lists
If the current element is already beyond advanceTo()'s DocID, just
return instead of doing binary search. This simple optimization saves up
to 6-7% performance,
Reviewed By: ilya-biryukov
Differential Revision: https://reviews.llvm.org/D51802
llvm-svn: 341781
Max Kazantsev [Mon, 10 Sep 2018 06:50:16 +0000 (06:50 +0000)]
[IndVars] Set Changed if rewriteFirstIterationLoopExitValues changes IR. PR38863
Currently, `rewriteFirstIterationLoopExitValues` does not set Changed flag even if it makes
changes in the IR. There is no clear evidence that it can cause a crash, but it
looks highly suspicious and likely invalid.
Differential Revision: https://reviews.llvm.org/D51779
Reviewed By: skatkov
llvm-svn: 341779
Richard Smith [Mon, 10 Sep 2018 06:35:32 +0000 (06:35 +0000)]
PR33222: Require the declared return type not the actual return type to
match when checking for redeclaration of a function template.
This properly handles differences in deduced return types, particularly
when performing redeclaration checks for a friend function template.
llvm-svn: 341778
Max Kazantsev [Mon, 10 Sep 2018 06:32:00 +0000 (06:32 +0000)]
[IndVars] Set Changed if sinkUnusedInvariants changes IR. PR38863
Currently, `sinkUnusedInvariants` does not set Changed flag even if it makes
changes in the IR. There is no clear evidence that it can cause a crash, but it
looks highly suspicious and likely invalid.
Differential Revision: https://reviews.llvm.org/D51777
Reviewed By: skatkov
llvm-svn: 341777
Vikram TV [Mon, 10 Sep 2018 06:16:44 +0000 (06:16 +0000)]
Move a transformation routine from LoopUtils to LoopVectorize.
Summary:
Move InductionDescriptor::transform() routine from LoopUtils to its only uses in LoopVectorize.cpp.
Specifically, the function is renamed as InnerLoopVectorizer::emitTransformedIndex().
This is a child to D51153.
Reviewers: dmgreen, llvm-commits
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D51837
llvm-svn: 341776
Richard Smith [Mon, 10 Sep 2018 05:32:13 +0000 (05:32 +0000)]
Part of PR33222: defer enforcing return type mismatch for dependent
friend function declarations of class templates.
llvm-svn: 341775
David Carlier [Mon, 10 Sep 2018 05:29:49 +0000 (05:29 +0000)]
[XRay] Fix buildbot failure
llvm-svn: 341774
Vikram TV [Mon, 10 Sep 2018 05:05:08 +0000 (05:05 +0000)]
Move createMinMaxOp() out of RecurrenceDescriptor.
Reviewers: dmgreen, llvm-commits
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D51838
llvm-svn: 341773
David Carlier [Mon, 10 Sep 2018 05:00:43 +0000 (05:00 +0000)]
[Xray] tooling allow MachO format support
Getting writable xray __DATA sections from MachO as well.
Reviewers: dberris
Reviewed By: dberris
Differential Revision: https://reviews.llvm.org/D51758
llvm-svn: 341772
Dean Michael Berris [Mon, 10 Sep 2018 02:57:05 +0000 (02:57 +0000)]
[XRay] Remove unused reference
The reference was only used in the assertion.
Follow-up on D51723.
llvm-svn: 341771
Matt Arsenault [Mon, 10 Sep 2018 02:54:25 +0000 (02:54 +0000)]
AMDGPU: Fix tests using old number for constant address space
llvm-svn: 341770
Dean Michael Berris [Mon, 10 Sep 2018 02:35:25 +0000 (02:35 +0000)]
[XRay] Add a BlockVerifier visitor for FDR Records
Summary:
This patch implements a `BlockVerifier` type which enforces the
invariants of the log structure of FDR mode logs on a per-block basis.
This ensures that the data we encounter from an FDR mode log
semantically correct (i.e. that records follow the documented "grammar"
for FDR mode log records).
This is another part of the refactoring of D50441.
This is a slightly modified version of rL341628, avoiding the
`std::tuple<...>` constructor that is not constexpr in C++11.
Reviewers: mboerger, eizan
Subscribers: mgorny, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D51723
llvm-svn: 341769
Matt Arsenault [Mon, 10 Sep 2018 02:23:39 +0000 (02:23 +0000)]
AMDGPU: Use GOT PSV since it has an address space now
llvm-svn: 341768
Matt Arsenault [Mon, 10 Sep 2018 02:23:30 +0000 (02:23 +0000)]
AMDGPU: Don't abort on unknown addrspace argument
llvm-svn: 341767
Kelvin Li [Mon, 10 Sep 2018 02:07:09 +0000 (02:07 +0000)]
[OpenMP] Add support for nested 'declare target' directives
Add the capability to nest multiple declare target directives
- including header files within a declare target region.
Differential Revision: https://reviews.llvm.org/D51378
Patch by Patrick Lyster
llvm-svn: 341766
Craig Topper [Sun, 9 Sep 2018 20:36:36 +0000 (20:36 +0000)]
[X86] Custom type legalize (v2i32 (fp_to_uint v2f64))) without avx512vl by widening to v4i32 and v4f64 instead of v8i32 and v8f64. Make it aware of x86-experimental-vector-widening-legalization
We have isel patterns for v4i32/v4f64 that artificially widen to v8i32/v8f64 so just use that.
If x86-experimental-vector-widening-legalization is enabled, we don't need any custom legalization and can just return. I've modified the test RUN lines to cover this case.
llvm-svn: 341765
Fangrui Song [Sun, 9 Sep 2018 17:20:03 +0000 (17:20 +0000)]
[Sema] Make typo correction slightly more efficient
edit_distance returns UpperBound+1 if the distance will exceed UpperBound. We can subtract 1 from UpperBound and change >= to > in the if condition. The threshold does not change but edit_distance will have more opportunity to bail out earlier.
llvm-svn: 341763
Sanjay Patel [Sun, 9 Sep 2018 14:13:22 +0000 (14:13 +0000)]
[SelectionDAG] enhance vector demanded elements to look at a vector select condition operand
This is the DAG equivalent of D51433.
If we know we're not using all vector lanes, use that knowledge to potentially simplify a vselect condition.
The reduction/horizontal tests show that we are eliminating AVX1 operations on the upper half of 256-bit
vectors because we don't need those anyway.
I'm not sure what the pr34592 test is showing. That's run with -O0; is SimplifyDemandedVectorElts supposed
to be running there?
Differential Revision: https://reviews.llvm.org/D51696
llvm-svn: 341762
Hamza Sood [Sun, 9 Sep 2018 13:12:53 +0000 (13:12 +0000)]
Fix build bots after a mistake in r341760
llvm-svn: 341761
Hamza Sood [Sun, 9 Sep 2018 12:06:35 +0000 (12:06 +0000)]
[Tooling] Improve handling of CL-style options
This patch fixes the handling of clang-cl options in InterpolatingCompilationDatabase.
They were previously ignored completely, which led to a lot of bugs:
Additional options were being added with the wrong syntax. E.g. a file was
specified as C++ by adding -x c++, which causes an error in CL mode.
The args were parsed and then rendered, which means that the aliasing information
was lost. E.g. /W4 was rendered to -Wall, which in CL mode means -Weverything.
CL options were ignored when checking things like -std=, so a lot of logic was
being bypassed.
Differential Revision: https://reviews.llvm.org/D51321
llvm-svn: 341760
Pavel Labath [Sun, 9 Sep 2018 08:42:00 +0000 (08:42 +0000)]
Speculative fix for NetBSD bot for r341758
llvm-svn: 341759
Pavel Labath [Sun, 9 Sep 2018 06:01:12 +0000 (06:01 +0000)]
Re-commit "Modernize NativeProcessProtocol::GetSoftwareBreakpointTrapOpcode"
This recommits r341487, which was reverted due to failing tests with
clang. It turned out I had incorrectly expected that the literal arrays
passed to ArrayRef constructor will have static (permanent) storage.
This was only the case with gcc, while clang was constructing them on
stack, leading to dangling pointers when the function returns.
The fix is to explicitly assign static storage duration to the opcode
arrays.
llvm-svn: 341758
Akira Hatanaka [Sun, 9 Sep 2018 05:22:49 +0000 (05:22 +0000)]
Revert r341754.
The commit broke a couple of bots:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/12347
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/7310
llvm-svn: 341757
Fangrui Song [Sun, 9 Sep 2018 01:54:18 +0000 (01:54 +0000)]
[Parser] Remove an unnecessary `mutable`
llvm-svn: 341756
Nico Weber [Sat, 8 Sep 2018 20:58:39 +0000 (20:58 +0000)]
ms: Insert $$Z in mangling between directly consecutive parameter packs.
Fixes PR38783.
Differential Revision: https://reviews.llvm.org/D51784
llvm-svn: 341755
Akira Hatanaka [Sat, 8 Sep 2018 20:03:00 +0000 (20:03 +0000)]
Distinguish `__block` variables that are captured by escaping blocks
from those that aren't.
This patch changes the way __block variables that aren't captured by
escaping blocks are handled:
- Since non-escaping blocks on the stack never get copied to the heap
(see https://reviews.llvm.org/D49303), Sema shouldn't error out when
the type of a non-escaping __block variable doesn't have an accessible
copy constructor.
- IRGen doesn't have to use the specialized byref structure (see
https://clang.llvm.org/docs/Block-ABI-Apple.html#id8) for a
non-escaping __block variable anymore. Instead IRGen can emit the
variable as a normal variable and copy the reference to the block
literal. Byref copy/dispose helpers aren't needed either.
rdar://problem/
39352313
Differential Revision: https://reviews.llvm.org/D51564
llvm-svn: 341754