[flang-commits] [clang] [flang] [lld] [llvm] [polly] [Option] Make Passes, Scalar, Instrumentation, and CGData options per-context (PR #232599)
Alexis Engelke via flang-commits
flang-commits at lists.llvm.org
Fri Oct 16 03:15:14 PDT 2026
================
@@ -34,27 +34,33 @@
#include "llvm/Analysis/LoopAnalysisManager.h"
#include "llvm/IR/PassManager.h"
+#include <optional>
namespace llvm {
class LPMUpdater;
class Loop;
class LoopNest;
-
-/// Returns -licm-mssa-optimization-cap.
-LLVM_ABI unsigned getLicmMssaOptCap();
-/// Returns -licm-mssa-max-acc-promotion.
-LLVM_ABI unsigned getLicmMssaNoAccForPromotionCap();
+namespace cl {
+class LibraryOptionsContext;
+} // namespace cl
+
+/// Returns -licm-mssa-optimization-cap of LibraryOptions, or its global value
+/// if null.
+LLVM_ABI unsigned
+getLicmMssaOptCap(const cl::LibraryOptionsContext *LibraryOptions);
+/// Returns -licm-mssa-max-acc-promotion of LibraryOptions, or its global value
+/// if null.
+LLVM_ABI unsigned getLicmMssaNoAccForPromotionCap(
+ const cl::LibraryOptionsContext *LibraryOptions);
struct LICMOptions {
- unsigned MssaOptCap;
- unsigned MssaNoAccForPromotionCap;
+ // Unset means the -licm-mssa-* value of the loop's LLVMContext.
+ std::optional<unsigned> MssaOptCap;
+ std::optional<unsigned> MssaNoAccForPromotionCap;
----------------
aengelke wrote:
Unsure about this, ideally LICMOptions would extract the defaults itself.
https://github.com/llvm/llvm-project/pull/232599
More information about the flang-commits
mailing list