1 //===--- SelectOptimize.cpp - Convert select to branches if profitable ---===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // This pass converts selects to conditional jumps when profitable. 10 // 11 //===----------------------------------------------------------------------===// 12 13 #include "llvm/CodeGen/Passes.h" 14 #include "llvm/IR/Function.h" 15 #include "llvm/InitializePasses.h" 16 #include "llvm/Pass.h" 17 18 using namespace llvm; 19 20 namespace { 21 22 class SelectOptimize : public FunctionPass { 23 public: 24 static char ID; 25 SelectOptimize() : FunctionPass(ID) { 26 initializeSelectOptimizePass(*PassRegistry::getPassRegistry()); 27 } 28 29 bool runOnFunction(Function &F) override; 30 31 void getAnalysisUsage(AnalysisUsage &AU) const override {} 32 }; 33 } // namespace 34 35 char SelectOptimize::ID = 0; 36 INITIALIZE_PASS(SelectOptimize, "select-optimize", "Optimize selects", false, 37 false) 38 39 FunctionPass *llvm::createSelectOptimizePass() { return new SelectOptimize(); } 40 41 bool SelectOptimize::runOnFunction(Function &F) { 42 llvm_unreachable("Unimplemented"); 43 } 44