1 //===-- Scalar.cpp --------------------------------------------------------===// 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 implements the C bindings for libLLVMScalarOpts.a, which implements 11 // several scalar transformations over the LLVM intermediate representation. 12 // 13 //===----------------------------------------------------------------------===// 14 15 #include "llvm-c/Transforms/Scalar.h" 16 #include "llvm/PassManager.h" 17 #include "llvm/Transforms/Scalar.h" 18 19 using namespace llvm; 20 21 void LLVMAddAggressiveDCEPass(LLVMPassManagerRef PM) { 22 unwrap(PM)->add(createAggressiveDCEPass()); 23 } 24 25 void LLVMAddCFGSimplificationPass(LLVMPassManagerRef PM) { 26 unwrap(PM)->add(createCFGSimplificationPass()); 27 } 28 29 void LLVMAddCondPropagationPass(LLVMPassManagerRef PM) { 30 unwrap(PM)->add(createCondPropagationPass()); 31 } 32 33 void LLVMAddDeadStoreEliminationPass(LLVMPassManagerRef PM) { 34 unwrap(PM)->add(createDeadStoreEliminationPass()); 35 } 36 37 void LLVMAddGVNPass(LLVMPassManagerRef PM) { 38 unwrap(PM)->add(createGVNPass()); 39 } 40 41 void LLVMAddIndVarSimplifyPass(LLVMPassManagerRef PM) { 42 unwrap(PM)->add(createIndVarSimplifyPass()); 43 } 44 45 void LLVMAddInstructionCombiningPass(LLVMPassManagerRef PM) { 46 unwrap(PM)->add(createInstructionCombiningPass()); 47 } 48 49 void LLVMAddJumpThreadingPass(LLVMPassManagerRef PM) { 50 unwrap(PM)->add(createJumpThreadingPass()); 51 } 52 53 void LLVMAddLICMPass(LLVMPassManagerRef PM) { 54 unwrap(PM)->add(createLICMPass()); 55 } 56 57 void LLVMAddLoopDeletionPass(LLVMPassManagerRef PM) { 58 unwrap(PM)->add(createLoopDeletionPass()); 59 } 60 61 void LLVMAddLoopIndexSplitPass(LLVMPassManagerRef PM) { 62 unwrap(PM)->add(createLoopIndexSplitPass()); 63 } 64 65 void LLVMAddLoopRotatePass(LLVMPassManagerRef PM) { 66 unwrap(PM)->add(createLoopRotatePass()); 67 } 68 69 void LLVMAddLoopUnrollPass(LLVMPassManagerRef PM) { 70 unwrap(PM)->add(createLoopUnrollPass()); 71 } 72 73 void LLVMAddLoopUnswitchPass(LLVMPassManagerRef PM) { 74 unwrap(PM)->add(createLoopUnswitchPass()); 75 } 76 77 void LLVMAddMemCpyOptPass(LLVMPassManagerRef PM) { 78 unwrap(PM)->add(createMemCpyOptPass()); 79 } 80 81 void LLVMAddPromoteMemoryToRegisterPass(LLVMPassManagerRef PM) { 82 unwrap(PM)->add(createPromoteMemoryToRegisterPass()); 83 } 84 85 void LLVMAddReassociatePass(LLVMPassManagerRef PM) { 86 unwrap(PM)->add(createReassociatePass()); 87 } 88 89 void LLVMAddSCCPPass(LLVMPassManagerRef PM) { 90 unwrap(PM)->add(createSCCPPass()); 91 } 92 93 void LLVMAddScalarReplAggregatesPass(LLVMPassManagerRef PM) { 94 unwrap(PM)->add(createScalarReplAggregatesPass()); 95 } 96 97 void LLVMAddSimplifyLibCallsPass(LLVMPassManagerRef PM) { 98 unwrap(PM)->add(createSimplifyLibCallsPass()); 99 } 100 101 void LLVMAddTailCallEliminationPass(LLVMPassManagerRef PM) { 102 unwrap(PM)->add(createTailCallEliminationPass()); 103 } 104 105 void LLVMAddConstantPropagationPass(LLVMPassManagerRef PM) { 106 unwrap(PM)->add(createConstantPropagationPass()); 107 } 108 109 void LLVMAddDemoteMemoryToRegisterPass(LLVMPassManagerRef PM) { 110 unwrap(PM)->add(createDemoteRegisterToMemoryPass()); 111 } 112