[llvm] d620bae - [opt][NFC] Simplify GetCodeGenOptLevel()
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 28 09:31:22 PST 2022
Author: Arthur Eubanks
Date: 2022-11-28T09:30:54-08:00
New Revision: d620bae999465f4a418c38b6451b11d80523c6de
URL: https://github.com/llvm/llvm-project/commit/d620bae999465f4a418c38b6451b11d80523c6de
DIFF: https://github.com/llvm/llvm-project/commit/d620bae999465f4a418c38b6451b11d80523c6de.diff
LOG: [opt][NFC] Simplify GetCodeGenOptLevel()
Removed code is unreachable after D137663.
Added:
Modified:
llvm/tools/opt/opt.cpp
Removed:
################################################################################
diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp
index 3728c0b54de75..4eca3de1904f2 100644
--- a/llvm/tools/opt/opt.cpp
+++ b/llvm/tools/opt/opt.cpp
@@ -327,15 +327,7 @@ static inline void addPass(legacy::PassManagerBase &PM, Pass *P) {
//
static CodeGenOpt::Level GetCodeGenOptLevel() {
- if (CodeGenOptLevel.getNumOccurrences())
- return static_cast<CodeGenOpt::Level>(unsigned(CodeGenOptLevel));
- if (OptLevelO1)
- return CodeGenOpt::Less;
- if (OptLevelO2)
- return CodeGenOpt::Default;
- if (OptLevelO3)
- return CodeGenOpt::Aggressive;
- return CodeGenOpt::None;
+ return static_cast<CodeGenOpt::Level>(unsigned(CodeGenOptLevel));
}
// Returns the TargetMachine instance or zero if no triple is provided.
More information about the llvm-commits
mailing list