1 //===- ADCE.h - Aggressive dead code elimination --------------------------===// 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/Function.h" 21 #include "llvm/IR/PassManager.h" 22 23 namespace llvm { 24 25 /// A DCE pass that assumes instructions are dead until proven otherwise. 26 /// 27 /// This pass eliminates dead code by optimistically assuming that all 28 /// instructions are dead until proven otherwise. This allows it to eliminate 29 /// dead computations that other DCE passes do not catch, particularly involving 30 /// loop computations. 31 class ADCEPass { 32 public: name()33 static StringRef name() { return "ADCEPass"; } 34 PreservedAnalyses run(Function &F); 35 }; 36 } 37 38 #endif // LLVM_TRANSFORMS_SCALAR_ADCE_H 39