Commit Graph

152999 Commits

Author SHA1 Message Date
Serguei Katkov
0c0ee9fbca [ImplicitNullCheck] Fix the bug when dependent instruction accesses memory
It is possible that dependent instruction may access memory.
In this case we must reject optimization because the memory change will
be visible in null handler basic block. So we will execute an instruction which
we must not execute if check fails.

Reviewers: sanjoy, reames
Reviewed By: sanjoy
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D36392


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310443 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-09 05:17:02 +00:00
Zachary Turner
00a76938ff Fix broken pdb test.
For some reason I didn't see this failure the first time.  The
output format changed slightly, so we just have to update the
test for the new format.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310442 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-09 04:48:16 +00:00
Zachary Turner
ea9294bda1 Fix -Wreorder-fields warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310440 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-09 04:34:11 +00:00
Zachary Turner
ed601f1b51 [PDB] Fix an issue writing the publics stream.
In the refactor to merge the publics and globals stream, a bug
was introduced that wrote the wrong value for one of the fields
of the PublicsStreamHeader.  This caused debugging in WinDbg
to break.

We had no way of dumping any of these fields, so in addition to
fixing the bug I've added dumping support for them along with a
test that verifies the correct value is written.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310439 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-09 04:23:59 +00:00
Zachary Turner
3be08b1e5e [PDB] Merge Global and Publics Builders.
The publics stream and globals stream are very similar. They both
contain a list of hash buckets that refer into a single shared stream,
the symbol record stream. Because of the need for each builder to manage
both an independent hash stream as well as a single shared record
stream, making the two builders be independent entities is not the right
design. This patch merges them into a single class, of which only a
single instance is needed to create all 3 streams.  PublicsStreamBuilder
and GlobalsStreamBuilder are now merged into the single GSIStreamBuilder
class, which writes all 3 streams at once.

Note that this patch does not contain any functionality change. So we're
still not yet writing any records to the globals stream. All we're doing
is making it so that when we do start writing records to the globals,
this refactor won't have to be part of that patch.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310438 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-09 04:23:25 +00:00
Craig Topper
94b1780d8a [InstCombine] Add a test case for a missed opportunity to turn a select into logic ops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310434 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-09 01:30:22 +00:00
Eugene Zelenko
b6826c707f [AMDGPU] Revert r310429 changes in AMDKernelCodeT.h which broke some build bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310430 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-09 00:06:29 +00:00
Eugene Zelenko
eced12eab7 [AMDGPU] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310429 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 23:53:55 +00:00
Quentin Colombet
f6b5ea76fb Revert "[GlobalISel] Remove the GISelAccessor API."
This reverts commit r310115.

It causes a linker failure for the one of the unittests of AArch64 on one
of the linux bot:
http://lab.llvm.org:8011/builders/clang-ppc64le-linux-multistage/builds/3429

: && /home/fedora/gcc/install/gcc-7.1.0/bin/g++   -fPIC
-fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -W
-Wno-unused-parameter -Wwrite-strings -Wcast-qual
-Wno-missing-field-initializers -pedantic -Wno-long-long
-Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment
-ffunction-sections -fdata-sections -O2
-L/home/fedora/gcc/install/gcc-7.1.0/lib64 -Wl,-allow-shlib-undefined
-Wl,-O3 -Wl,--gc-sections
unittests/Target/AArch64/CMakeFiles/AArch64Tests.dir/InstSizes.cpp.o  -o
unittests/Target/AArch64/AArch64Tests
lib/libLLVMAArch64CodeGen.so.6.0.0svn lib/libLLVMAArch64Desc.so.6.0.0svn
lib/libLLVMAArch64Info.so.6.0.0svn lib/libLLVMCodeGen.so.6.0.0svn
lib/libLLVMCore.so.6.0.0svn lib/libLLVMMC.so.6.0.0svn
lib/libLLVMMIRParser.so.6.0.0svn lib/libLLVMSelectionDAG.so.6.0.0svn
lib/libLLVMTarget.so.6.0.0svn lib/libLLVMSupport.so.6.0.0svn -lpthread
lib/libgtest_main.so.6.0.0svn lib/libgtest.so.6.0.0svn -lpthread
-Wl,-rpath,/home/buildbots/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/lib
&& :
unittests/Target/AArch64/CMakeFiles/AArch64Tests.dir/InstSizes.cpp.o:(.toc+0x0):
undefined reference to `vtable for llvm::LegalizerInfo'
unittests/Target/AArch64/CMakeFiles/AArch64Tests.dir/InstSizes.cpp.o:(.toc+0x8):
undefined reference to `vtable for llvm::RegisterBankInfo'

The particularity of this bot is that it is built with
BUILD_SHARED_LIBS=ON

However, I was not able to reproduce the problem so far.
Reverting to unblock the bot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310425 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 22:22:30 +00:00
Nemanja Ivanovic
c7c257e345 My commit r310346 introduced some valid warnings. This cleans them up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310424 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 22:17:31 +00:00
Jessica Paquette
13e21d9045 [MachineOutliner] Ensure AArch64 outliner doesn't mess with W30 or LR
Before, the outliner would mark all instructions that read from/modify LR as
illegal. This doesn't handle W30, which overlaps with LR. This shouldn't be
outlined.

This commit fixes that by making modifiesRegister() and readsRegister() look at
W30 + take in a TRI argument. This makes sure that modifiesRegister() and
readsRegister() won't outline either of W30 and LR.

https://reviews.llvm.org/D36435



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310422 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 21:51:26 +00:00
Wei Mi
a39bc3c640 [GVN] Remove stale entries in phitranslate cache when new phi is generated for PRE
When a new phi is generated for scalarpre of an expression, the phiTranslate cache
will become stale: Before PRE, the candidate expression must not be available in a
predecessor block, and phitranslate will cache the information. After PRE, the
expression will become available in all predecessor blocks, so the related entries
in phiTranslate cache becomes stale. The patch will simply remove the stale entries
so phiTranslate can be recomputed next time.

The stale entries in phitranslate cache will not affect correctness but will cause
missing PRE opportunity for later instructions.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310421 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 21:40:14 +00:00
Nuno Lopes
b95a570738 BasicAA: assert on another case where aliasGEP shouldn't get a PartialAlias response
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310420 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 21:25:26 +00:00
Dehao Chen
8a7a8e6735 Make ICP uses PSI to check for hotness.
Summary: Currently, ICP checks the count against a fixed value to see if it is hot enough to be promoted. This does not work for SamplePGO because sampled count may be much smaller. This patch uses PSI to check if the count is hot enough to be promoted.

Reviewers: davidxl, tejohnson, eraman

Reviewed By: davidxl

Subscribers: sanjoy, llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310416 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 20:57:33 +00:00
Reid Kleckner
9d69b6f1cd [codeview] Emit nested enums and typedefs from classes
Previously we limited ourselves to only emitting nested classes, but we
need other kinds of types as well.

This fixes the Visual Studio STL visualizers, so that users can
visualize std::string and other objects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310410 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 20:30:14 +00:00
Craig Topper
2fe6bd41fe [InstCombine] Support pulling left shifts through a subtract with constant LHS
We already support pulling through an add with constant RHS. We can do the same for subtract.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310407 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 20:14:11 +00:00
Nirav Dave
ca52e101f7 [DAG] Introduce peekThroughBitcast function. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310405 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 20:01:18 +00:00
Nirav Dave
a0c1eb4244 [DAG] Update comments. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310404 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 19:52:19 +00:00
Connor Abbott
8e92b2817e [AMDGPU] Add llvm.amdgpu.update.dpp intrinsic
Summary:
Now that we've made all the necessary backend changes, we can add a new
intrinsic which exposes the new capabilities to IR producers. Since
llvm.amdgpu.update.dpp is a strict superset of llvm.amdgpu.mov.dpp, we
should deprecate the former. We also add tests for all the functionality
that was added in previous changes, now that we can access it via an IR
construct.

Reviewers: tstellar, arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310399 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 18:52:22 +00:00
Chad Rosier
02ffffd209 [NewGVN] Use a cast instead of a dyn_cast.
Differential Revision: https://reviews.llvm.org/D36478

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310397 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 18:41:49 +00:00
Zachary Turner
e87e5c313d [PDB] Fix linking of function symbols and local variables.
The compiler outputs PROC32_ID symbols into the object files
for functions, and these symbols have an embedded type index
which, when copied to the PDB, refer to the IPI stream.  However,
the symbols themselves are also converted into regular symbols
(e.g. S_GPROC32_ID -> S_GPROC32), and type indices in the regular
symbol records refer to the TPI stream.  So this patch applies
two fixes to function records.
  1. It converts ID symbols to the proper non-ID record type.
  2. After remapping the type index from the object file's index
     space to the PDB file/IPI stream's index space, it then
     remaps that index to the TPI stream's index space by.

Besides functions, during the remapping process we were also
discarding symbol record types which we did not recognize.
In particular, we were discarding S_BPREL32 records, which is
what MSVC uses to describe local variables on the stack.  So
this patch fixes that as well by copying them to the PDB.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310394 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 18:34:44 +00:00
Adrian Prantl
f3855901e0 dsymutil: support dwarf version mismatches between object and clang module
This adds a missing call to maybeUpdateMaxDwarfVersion when visitng a
clang module. Failing to do so will cause a failure when emitting
DWARF 4 forms into a CU that AsmPrinter believes to be DWARF 2.

rdar://problem/33666528

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310392 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 18:26:12 +00:00
Anna Thomas
0428548839 [LoopVectorize] Fix assertion failure in Fcmp vectorization
Summary:
When vectorizing fcmps we can trip on incorrect cast assertion when setting the
FastMathFlags after generating the vectorized FCmp.
This can happen if the FCmp can be folded to true or false directly. The fix
here is to set the FastMathFlag using the FastMathFlagBuilder *before* creating
the FCmp Instruction. This is what's done by other optimizations such as
InstCombine.
Added a test case which trips on cast assertion without this patch.

Reviewers: Ayal, mssimpso, mkuper, gilr

Reviewed by: Ayal, mssimpso

Subscribers: llvm-commits, mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310389 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 18:07:44 +00:00
Tim Northover
eb72b7e53d Revert "[ARM] Fix assembly and disassembly for VMRS/VMSR"
This reverts r310243. Only MVFR2 is actually restricted to v8 and it'll be a
little while before we can get a proper fix together. Better that we allow
incorrect code than reject correct in the meantime.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310384 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 17:16:46 +00:00
Sanjoy Das
0128b415ef [DomTree] Use a non-recursive DFS instead of a recursive one; NFC
Summary: The recursive DFS can stack overflow in pathological cases.

Reviewers: kuhar

Subscribers: mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310383 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 17:15:29 +00:00
Craig Topper
c9b3b5dd57 [KnownBits][ValueTracking] Move the math for calculating known bits for add/sub into a static method in KnownBits object
I want to reuse this code in SimplifyDemandedBits handling of Add/Sub. This will make that easier.

Wonder if we should use it in SelectionDAG's computeKnownBits too.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310378 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 16:29:35 +00:00
Alex Bradbury
b22eff0ff6 [RISCV] Fix warning about unused getSubtargetFeatureName()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310375 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 16:20:39 +00:00
Nuno Lopes
db16a7c44a BasicAA: aliasGEP shouldn't get a PartialAlias response here
add an assert() to ensure that's the case (as I'm not convinced it won't happen)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310373 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 16:13:24 +00:00
Simon Pilgrim
47bcf0d5a6 [DAGCombiner] simplifyShuffleMask - handle UNDEF inputs from shuffles as well as BUILD_VECTOR
Minor extension to D36393

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310372 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 16:10:33 +00:00
Alex Bradbury
8566fbfb25 [RISCV] Add basic RISCVAsmParser (missing files)
This commit adds the files missing from rL310361. Apologies for the noise.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310363 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 14:43:36 +00:00
Alex Bradbury
f869506955 [RISCV] Add basic RISCVAsmParser
This doesn't yet support parsing things like %pcrel_hi(foo), but will handle
basic instructions with register or immediate operands.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310361 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 14:32:35 +00:00
Nemanja Ivanovic
ccf6aaba91 [PowerPC] Don't crash on larger splats achieved through 1-byte splats
We've implemented a 1-byte splat using XXSPLTISB on P9. However, LLVM will
produce a 1-byte splat even for wider element BUILD_VECTOR nodes. This patch
prevents crashing in that situation.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310358 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 13:52:45 +00:00
Daniel Sanders
0e484a9fbc [globalisel][tablegen] Remove unnecessary ; to satisfy ubuntu-gcc7.1-werror.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310357 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 13:21:26 +00:00
Nemanja Ivanovic
b5087f140c Appease compilers that have the -Wcovered-switch-default switch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310356 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 12:41:56 +00:00
Amjad Aboud
6857e48262 [X86] Improved X86::CMOV to Branch heuristic.
Resolved PR33954.
This patch contains two more constraints that aim to reduce the noise cases where we convert CMOV into branch for small gain, and end up spending more cycles due to overhead.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310352 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 12:17:56 +00:00
Nemanja Ivanovic
4db6f31bda [PowerPC] Eliminate compares - add i32 sext/zext handling for SETLE/SETGE
Adds handling for SETLE/SETGE comparisons on i32 values. Furthermore, it adds
the handling for the special case where RHS == 0.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310346 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 11:20:44 +00:00
Simon Pilgrim
c6a1f940fd [DAGCombiner] Simplify shuffle mask index if the referenced input element is UNDEF
Fixes one of the cases in PR34041.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310344 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 11:03:30 +00:00
Daniel Sanders
2ce2d5b785 [globalisel][tablegen] Add support for importing 'imm' operands.
Summary:
This patch enables the import of rules containing 'imm' operands that do not
constrain the acceptable values using predicates. Support for ImmLeaf will
arrive in a later patch.

Depends on D35681

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

Reviewed By: rovka

Subscribers: kristof.beyls, javed.absar, igorb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310343 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 10:44:31 +00:00
Chandler Carruth
55e10a5d82 [PM] Fix a likely more critical infloop bug in the CGSCC pass manager.
This was just a bad oversight on my part. The code in question should
never have worked without this fix. But it turns out, there are
relatively few places that involve libfunctions that participate in
a single SCC, and unless they do, this happens to not matter.

The effect of not having this correct is that each time through this
routine, the edge from write_wrapper to write was toggled between a call
edge and a ref edge. First time through, it becomes a demoted call edge
and is turned into a ref edge. Next time it is a promoted call edge from
a ref edge. On, and on it goes forever.

I've added the asserts which should have always been here to catch silly
mistakes like this in the future as well as a test case that will
actually infloop without the fix.

The other (much scarier) infinite-inlining issue I think didn't actually
occur in practice, and I simply misdiagnosed this minor issue as that
much more scary issue. The other issue *is* still a real issue, but I'm
somewhat relieved that so far it hasn't happened in real-world code
yet...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310342 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 10:13:23 +00:00
Craig Topper
c445a93ef8 [InstCombine] Cast to BinaryOperator earlier in foldSelectIntoOp to simplify the code.
We no longer need the explicit operand count check or the later dynamic cast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310339 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 06:19:24 +00:00
Tom Stellard
56199e7135 AMDGPU: Fix warnings introduced by r310336
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310337 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 05:52:00 +00:00
Tom Stellard
39aad0ab08 AMDGPU: Move R600 parts of AMDGPUISelDAGToDAG into their own class
Summary: This refactoring is required in order to split the R600 and GCN tablegen files.

Reviewers: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, llvm-commits, t-tye

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310336 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 04:57:55 +00:00
Konstantin Zhuravlyov
84577c6f35 AMDGPU: Also remove SI from docs
Differential Revision: https://reviews.llvm.org/D36424


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310335 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 04:28:31 +00:00
Chandler Carruth
6b0837c5da [PM] Relax the spelling of a pass name slightly in this test.
I forgot that MSVC doesn't preserve this typedef, my bad.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310334 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 02:27:49 +00:00
Chandler Carruth
f4c6127fb8 [PM] Fix new LoopUnroll function pass by invalidating loop analysis
results when a loop is completely removed.

This is very hard to manifest as a visible bug. You need to arrange for
there to be a subsequent allocation of a 'Loop' object which gets the
exact same address as the one which the unroll deleted, and you need the
LoopAccessAnalysis results to be significant in the way that they're
stale. And you need a million other things to align.

But when it does, you get a deeply mysterious crash due to actually
finding a stale analysis result. This fixes the issue and tests for it
by directly checking we successfully invalidate things. I have not been
able to get *any* test case to reliably trigger this. Changes to LLVM
itself caused the only test case I ever had to cease to crash.

I've looked pretty extensively at less brittle ways of fixing this and
they are actually very, very hard to do. This is a somewhat strange and
unusual case as we have a pass which is deleting an IR unit, but is not
running within that IR unit's pass framework (which is what handles this
cleanly for the normal loop unroll). And where there isn't a definitive
way to clear *all* of the stale cache entries. And where the pass *is*
updating the core analysis that provides the IR units!

For example, we don't have any of these problems with Function analyses
because it is easy to clear out function analyses when the functions
themselves may have been deleted -- we clear an entire module's worth!
But that is too heavy of a hammer down here in the LoopAnalysisManager
layer.

A better long-term solution IMO is to require that AnalysisManager's
make their keys durable to this kind of thing. Specifically, when
caching an analysis for one IR unit that is conceptually "owned" by
a higher level IR unit, the AnalysisManager should incorporate this into
its data structures so that we can reliably clear these results without
having to teach each and every pass to do so manually as we do here. But
that is a change for another day as it will be a fairly invasive change
to the AnalysisManager infrastructure. Until then, this fortunately
seems to be quite rare.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310333 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 02:24:20 +00:00
Eugene Zelenko
5ca94f31ee [AMDGPU] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310328 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 00:47:13 +00:00
Kostya Serebryany
1aea640366 [libFuzzer] simplify code, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310326 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 00:17:20 +00:00
Kostya Serebryany
7550cbd415 [libFuzzer] remove stale code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310325 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 00:14:49 +00:00
Kostya Serebryany
468107aa76 [libFuzzer] simplify the implementation of -print_coverage=1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310324 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 00:12:09 +00:00
Craig Topper
7f0f9c8531 [KnownBits] Fix copy pasto in comment. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310320 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-07 22:35:55 +00:00