1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
llvm-mirror/unittests
Nick Desaulniers c07423a078 [IR] CallBrInst: scan+update arg list when indirect dest list changes
Summary:
There's an unspoken invariant of callbr that the list of BlockAddress
Constants in the "function args" list match the BasicBlocks in the
"other labels" list. (This invariant is being added to the LangRef in
https://reviews.llvm.org/D67196).

When modifying the any of the indirect destinations of a callbr
instruction (possible jump targets), we need to update the function
arguments if the argument is a BlockAddress whose BasicBlock refers to
the indirect destination BasicBlock being replaced.  Otherwise, many
transforms that modify successors will end up violating that invariant.
A recent change to the arm64 Linux kernel exposed this bug, which
prevents the kernel from booting.

I considered maintaining a mapping from indirect destination BasicBlock
to argument operand BlockAddress, but this ends up being a one to
potentially many (though usually one) mapping.  Also, the list of
arguments to a function (or more typically inline assembly) ends up
being less than 10.  The implementation is significantly simpler to just
rescan the full list of arguments. Because of the one to potentially
many relationship, the full arg list must be scanned (we can't stop at
the first instance).

Thanks to the following folks that reported the issue and helped debug
it:
* Nathan Chancellor
* Will Deacon
* Andrew Murray
* Craig Topper

Link: https://bugs.llvm.org/show_bug.cgi?id=43222
Link: https://github.com/ClangBuiltLinux/linux/issues/649
Link: https://lists.infradead.org/pipermail/linux-arm-kernel/2019-September/678330.html

Reviewers: craig.topper, chandlerc

Reviewed By: craig.topper

Subscribers: void, javed.absar, kristof.beyls, hiraditya, llvm-commits, nathanchance, srhines

Tags: #llvm

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

llvm-svn: 371262
2019-09-06 21:50:11 +00:00
..
ADT [ADT] Removed VariadicFunction 2019-08-30 08:21:55 +00:00
Analysis [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
AsmParser Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BinaryFormat [BinaryFormat] Teach identify_magic about Tapi files. 2019-08-21 21:00:16 +00:00
Bitcode [Bitcode] Move Bitstream to a separate library 2019-07-03 22:40:07 +00:00
Bitstream [Bitcode] Move Bitstream to a separate library 2019-07-03 22:40:07 +00:00
CodeGen GlobalISel: Add G_FMAD instruction 2019-09-06 20:49:10 +00:00
DebugInfo Add encode and decode methods to InlineInfo and document encoding format to the GSYM file format. 2019-09-04 17:32:51 +00:00
Demangle Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
ExecutionEngine [ORC] Add a missing #include atomic. 2019-09-06 20:50:00 +00:00
FuzzMutate [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
IR [IR] CallBrInst: scan+update arg list when indirect dest list changes 2019-09-06 21:50:11 +00:00
LineEditor Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Linker [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
MC [MC] Fix undefined behavior in MCInstPrinter::formatHex 2019-09-06 01:13:32 +00:00
MI MachineModuleInfo: Store more specific reference to LLVMTargetMachine; NFC 2018-11-05 23:49:13 +00:00
Object Minidump: Add support for the MemoryList stream 2019-05-16 15:17:30 +00:00
ObjectYAML MinidumpYAML: move serialization code to MinidumpEmitter.cpp 2019-08-21 11:30:48 +00:00
Option Option spell checking: Penalize delimiter flags if input has no argument 2019-05-01 16:45:15 +00:00
Passes Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ProfileData [SampleFDO] Add profile symbol list section to discriminate function being 2019-08-31 02:27:26 +00:00
Remarks [Remarks] Add support for internalizing a remark in a string table 2019-09-06 17:22:51 +00:00
Support [Support] Add writeFileAtomically() to FileUtilities 2019-09-05 18:10:29 +00:00
Target [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
TextAPI [TextAPI] Update reader to be supported by lib/Object 2019-08-16 15:30:48 +00:00
tools Revert CMake: Make most target symbols hidden by default 2019-06-11 03:21:13 +00:00
Transforms Fix for "DICompileUnit not listed in llvm.dbg.cu" verification error after ... 2019-08-28 21:27:50 +00:00
XRay [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
CMakeLists.txt [Bitcode] Move Bitstream to a separate library 2019-07-03 22:40:07 +00:00
unittest.cfg.in Add support for unittest inputs. 2018-09-05 23:30:17 +00:00