1 //===- ADCE.h - Aggressive dead code elimination ----------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // This file provides the interface for the Aggressive Dead Code Elimination 11 // pass. This pass optimistically assumes that all instructions are dead until 12 // proven otherwise, allowing it to eliminate dead computations that other DCE 13 // passes do not catch, particularly involving loop computations. 14 // 15 //===----------------------------------------------------------------------===// 16 17 #ifndef LLVM_TRANSFORMS_SCALAR_ADCE_H 18 #define LLVM_TRANSFORMS_SCALAR_ADCE_H 19 20 #include "llvm/IR/PassManager.h" 21 22 namespace llvm { 23 24 class Function; 25 26 /// A DCE pass that assumes instructions are dead until proven otherwise. 27 /// 28 /// This pass eliminates dead code by optimistically assuming that all 29 /// instructions are dead until proven otherwise. This allows it to eliminate 30 /// dead computations that other DCE passes do not catch, particularly involving 31 /// loop computations. 32 struct ADCEPass : PassInfoMixin<ADCEPass> { 33 PreservedAnalyses run(Function &F, FunctionAnalysisManager &); 34 }; 35 36 } // end namespace llvm 37 38 #endif // LLVM_TRANSFORMS_SCALAR_ADCE_H 39