1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
llvm-mirror/lib/IR
Artur Pilipenko f6ba1c09d2 SafepointIRVerifier should ignore dead blocks and dead edges
Not only should SafepointIRVerifier ignore unreachable blocks (as suggested in https://reviews.llvm.org/D47011) but it also has to ignore dead blocks.

In @test2 (see the new tests):

  br i1 true, label %right, label %left
left:
  ...
right:
  ...
merge:
  %val = phi i8 addrspace(1)* [ ..., %left ], [ ..., %right ]
  use %val
both left and right branches are reachable.
If they collide then SafepointIRVerifier reports an error.

Because of the foldable branch condition GVN finds the left branch dead and removes the phi node entry that merges values from right and left. Then the use comes from the right branch. This results in no collision.

So, SafepointIRVerifier ends up in different results depending on either GVN is run or not.

To solve this issue this patch adds Dead Block detection to SafepointIRVerifier which can ignore dead blocks while validating IR. The Dead Block detection algorithm is taken from GVN but modified to not split critical edges. That is needed to keep CFG unchanged by SafepointIRVerifier.

Patch by Yevgeny Rouban.

Reviewed By: anna, apilipenko, DaniilSuchkov

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

llvm-svn: 335473
2018-06-25 13:51:11 +00:00
..
AsmWriter.cpp [ADT] Make escaping fn conform to coding guidelines 2018-05-31 17:01:42 +00:00
AttributeImpl.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
Attributes.cpp [ADT] Make escaping fn conform to coding guidelines 2018-05-31 17:01:42 +00:00
AttributesCompatFunc.td
AutoUpgrade.cpp [X86] Remove masking from 512-bit floating max/min intrinsics. Use select instruction instead. 2018-06-21 05:00:56 +00:00
BasicBlock.cpp [IR] Introduce helpers to skip debug instructions (NFC) 2018-06-19 23:42:17 +00:00
CMakeLists.txt [IR][CodeGen] Remove dependency on EVT from IR/Function.cpp. Move EVT to CodeGen layer. 2018-03-29 17:21:10 +00:00
Comdat.cpp [LLVM-C] [bindings/go] Add C and Golang bindings for COMDAT 2018-03-14 18:33:53 +00:00
ConstantFold.cpp [IR] add/use isIntDivRem convenience function 2018-06-20 19:02:17 +00:00
ConstantFold.h
ConstantRange.cpp [IR] Use Instruction::isBinaryOp helper instead of raw enum range tests. NFCI. 2018-06-22 10:48:02 +00:00
Constants.cpp [IR] Use Instruction::isBinaryOp helper instead of raw enum range tests. NFCI. 2018-06-22 10:48:02 +00:00
ConstantsContext.h Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
Core.cpp [LLVM-C] Improve Bindings For Aliases 2018-05-20 23:49:08 +00:00
DataLayout.cpp Use uniform mechanism for OOM errors handling 2018-06-09 05:19:45 +00:00
DebugInfo.cpp Extend the GlobalObject metadata interface 2018-05-31 13:29:58 +00:00
DebugInfoMetadata.cpp [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
DebugLoc.cpp IWYU for llvm-config.h in llvm, additions. 2018-04-30 14:59:11 +00:00
DiagnosticHandler.cpp Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
DiagnosticInfo.cpp This change add's optimization remark in LoopVersioning LICM pass. 2018-01-23 09:47:28 +00:00
DiagnosticPrinter.cpp
DIBuilder.cpp [DebugInfo] Refactoring DIType::setFlags to DIType::cloneWithFlags, NFC 2018-06-01 23:15:09 +00:00
Dominators.cpp Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
Function.cpp [IR] Split Intrinsics.inc into enums and implementations 2018-06-23 02:02:38 +00:00
Globals.cpp Sink Analysis/ObjectUtil(canBeOmittedFromSymbolTable) into IR so it can be legitimately be used by Object/IRSymtab 2018-03-21 19:23:45 +00:00
GVMaterializer.cpp
InlineAsm.cpp
Instruction.cpp [IR] Introduce helpers to skip debug instructions (NFC) 2018-06-19 23:42:17 +00:00
Instructions.cpp [IR] move shuffle mask queries from TTI to ShuffleVectorInst 2018-06-19 18:44:00 +00:00
IntrinsicInst.cpp Re-apply "[DebugInfo] Check size of variable in ConvertDebugDeclareToDebugValue" 2018-06-15 13:48:55 +00:00
IRBuilder.cpp [IRBuilder] Add APIs for creating calls to atomic memmove and memset intrinsics. (NFC) 2018-05-30 20:02:56 +00:00
IRPrintingPasses.cpp [Debugify] Add -debugify-each for testing each pass in a pipeline 2018-05-15 00:29:27 +00:00
LegacyPassManager.cpp Reland: [Timers] Use the pass argument name for JSON keys in time-passes 2018-06-13 21:03:56 +00:00
LLVMBuild.txt
LLVMContext.cpp allow custom OptBisect classes set to LLVMContext 2018-04-05 10:29:37 +00:00
LLVMContextImpl.cpp Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
LLVMContextImpl.h Extend the GlobalObject metadata interface 2018-05-31 13:29:58 +00:00
Mangler.cpp [IR] Avoid the need to prefix MS C++ symbols with '\01' 2018-03-16 20:13:32 +00:00
MDBuilder.cpp Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
Metadata.cpp Extend the GlobalObject metadata interface 2018-05-31 13:29:58 +00:00
MetadataImpl.h
Module.cpp Add remarks describing when a pass changes the IR instruction count of a module 2018-05-18 17:26:39 +00:00
ModuleSummaryIndex.cpp [ThinLTO] Add GraphTraits for FunctionSummaries 2018-02-19 15:14:50 +00:00
Operator.cpp Adding a width of the GEP index to the Data Layout. 2018-02-14 06:58:08 +00:00
OptBisect.cpp [NFC] OptPassGate extracted from OptBisect 2018-03-27 16:57:20 +00:00
Pass.cpp Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
PassManager.cpp
PassRegistry.cpp
ProfileSummary.cpp [ProfileSummary] Move a vector we're about to destroy anyway; NFC 2018-04-12 20:54:05 +00:00
SafepointIRVerifier.cpp SafepointIRVerifier should ignore dead blocks and dead edges 2018-06-25 13:51:11 +00:00
Statepoint.cpp
SymbolTableListTraitsImpl.h
Type.cpp
TypeFinder.cpp Use ranged for loops in TypeFinder.cpp, NFC 2018-02-08 18:02:27 +00:00
Use.cpp
User.cpp Remove redundant includes from lib/IR. 2017-12-13 21:30:52 +00:00
Value.cpp In thin and full LTO + CFI, direct function calls may go through jump table 2018-06-04 18:18:12 +00:00
ValueSymbolTable.cpp Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
Verifier.cpp Revert r335306 (and r335314) - the Call Graph Profile pass. 2018-06-22 05:33:57 +00:00