llvm-project/llvm/lib
Fedor Sergeev 6660fd0f95 [PM][FunctionAttrs] add NoUnwind attribute inference to PostOrderFunctionAttrs pass
Summary:
This was motivated by absence of PrunEH functionality in new PM.
It was decided that a proper way to do PruneEH is to add NoUnwind inference
into PostOrderFunctionAttrs and then perform normal SimplifyCFG on top.

This change generalizes attribute handling implemented for (a removal of)
Convergent attribute, by introducing a generic builder-like class
   AttributeInferer

It registers all the attribute inference requests, storing per-attribute
predicates into a vector, and then goes through an SCC Node, scanning all
the instructions for not breaking attribute assumptions.

The main idea is that as soon all the instructions from all the functions
of SCC Node conform to attribute assumptions then we are free to infer
the attribute as set for all the functions of SCC Node.

It handles two distinct cases of attributes:
   - those that might break due to derefinement of the function code

     for these attributes we are allowed to apply inference only if all the
     functions are "exact definitions". Example - NoUnwind.

   - those that do not care about derefinement

     for these attributes we are allowed to apply inference as soon as we see
     any function definition. Example - removal of Convergent attribute.

Also in this commit:
* Converted all the FunctionAttrs tests to use FileCheck and added new-PM
  invocations to them

* FunctionAttrs/convergent.ll test demonstrates a difference in behavior between
   new and old PM implementations. Marked with FIXME.

* PruneEH tests were converted to new-PM as well, using function-attrs+simplify-cfg
  combo as intended

* some of "other" tests were updated since function-attrs now infers 'nounwind'
  even for old PM pipeline

* -disable-nounwind-inference hidden option added as a possible workaround for a supposedly
  rare case when nounwind being inferred by default presents a problem

Reviewers: chandlerc, jlebar

Reviewed By: jlebar

Subscribers: eraman, llvm-commits

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

llvm-svn: 328377
2018-03-23 21:46:16 +00:00
..
Analysis Revert r325687 (workaround for PR36032). 2018-03-22 22:04:39 +00:00
AsmParser [SimplifyCFG] Create attribute for fuzzing-specific optimizations. 2018-03-22 17:07:51 +00:00
BinaryFormat Fix build broken by r328090 2018-03-21 12:18:03 +00:00
Bitcode [SimplifyCFG] Create attribute for fuzzing-specific optimizations. 2018-03-22 17:07:51 +00:00
CodeGen Re-commit: [MachineLICM] Add functions to MachineLICM to hoist invariant stores 2018-03-23 15:28:15 +00:00
DebugInfo [PDB] Resubmit "Support embedding natvis files in PDBs." 2018-03-23 19:57:25 +00:00
Demangle Reapply Support layering fixes. 2018-03-21 17:31:49 +00:00
ExecutionEngine [ORC] Don't fully qualify explicit destructor call -- it confuses some compilers. 2018-03-20 05:56:58 +00:00
FuzzMutate [llvm-opt-fuzzer] Add irce to the fuzzing options 2018-03-20 11:32:13 +00:00
Fuzzer [libFuzzer] Delete llvm/lib/Fuzzer 2017-10-16 20:48:19 +00:00
IR [MIR] Making MIR Printing, opt -dot-cfg, and -debug printing faster 2018-03-22 21:29:07 +00:00
IRReader LLParser: add an argument for overriding data layout and do not check alloca addr space 2018-01-30 22:32:39 +00:00
LTO Sink Analysis/ObjectUtil(canBeOmittedFromSymbolTable) into IR so it can be legitimately be used by Object/IRSymtab 2018-03-21 19:23:45 +00:00
LineEditor
Linker [ThinLTO] Recommit of import global variables 2018-03-12 10:30:50 +00:00
MC [DWARF] Fix mixing assembler -g with DWARF .file directives. 2018-03-22 15:48:01 +00:00
Object Sink Analysis/ObjectUtil(canBeOmittedFromSymbolTable) into IR so it can be legitimately be used by Object/IRSymtab 2018-03-21 19:23:45 +00:00
ObjectYAML Reland "[DebugInfo] Support DWARF expressions in eh_frame" 2018-03-08 00:46:53 +00:00
Option [NFC] Replace iterators in PrintHelp with range-based for 2018-03-12 18:31:07 +00:00
Passes Move SampleProfile.h into IPO along with the rest of the IPO pass headers 2018-03-22 22:42:44 +00:00
ProfileData Revert "Revert "[InstrProf] Support for external functions in text format."" 2018-03-22 21:26:52 +00:00
Support [AMDGPU] Remove use of OpenCL triple environment and replace with function attribute for AMDGPU 2018-03-23 18:45:18 +00:00
TableGen TableGen: Remove redundant loop in ListInit::resolveReferences 2018-03-21 17:13:10 +00:00
Target [Hexagon] Make findLoopInstr member of HexagonInstrInfo 2018-03-23 20:43:02 +00:00
Testing Force #define GTEST_LANG_CXX11. 2017-10-27 21:12:28 +00:00
ToolDrivers [COFF] Keep the underscore on exported decorated stdcall functions in MSVC mode 2018-01-20 11:44:32 +00:00
Transforms [PM][FunctionAttrs] add NoUnwind attribute inference to PostOrderFunctionAttrs pass 2018-03-23 21:46:16 +00:00
WindowsManifest
XRay [XRay] clarify error messages when parsing broken traces 2018-01-30 13:41:34 +00:00
CMakeLists.txt
LLVMBuild.txt