[Passes] Replace OptimizationLevel with an enum (#209424)

Now that OptimizationLevel no longer has a size dimension, replace it
with a simple enum class.

GitOrigin-RevId: 5d5dd83a547ea555a8eada2dfd50413c44a3cfe9
diff --git a/lib/Support/RegisterPasses.cpp b/lib/Support/RegisterPasses.cpp
index b1c0e3c..a00176b 100644
--- a/lib/Support/RegisterPasses.cpp
+++ b/lib/Support/RegisterPasses.cpp
@@ -483,7 +483,7 @@
                                     llvm::OptimizationLevel Level,
                                     IntrusiveRefCntPtr<vfs::FileSystem> FS) {
   bool EnableForOpt =
-      shouldEnablePollyForOptimization() && Level.isOptimizingForSpeed();
+      shouldEnablePollyForOptimization() && Level != OptimizationLevel::O0;
   if (!shouldEnablePollyForDiagnostic() && !EnableForOpt)
     return;
 
@@ -513,7 +513,7 @@
                                    llvm::OptimizationLevel Level,
                                    IntrusiveRefCntPtr<vfs::FileSystem> FS) {
   bool EnableForOpt =
-      shouldEnablePollyForOptimization() && Level.isOptimizingForSpeed();
+      shouldEnablePollyForOptimization() && Level != OptimizationLevel::O0;
   if (!shouldEnablePollyForDiagnostic() && !EnableForOpt)
     return;