[clang] [flang] [llvm] add -floop-fuse to clang and flang (PR #142686)

Ryotaro Kasuga via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 31 03:04:05 PDT 2025


================
@@ -204,6 +205,10 @@ static cl::opt<bool>
     EnableLoopInterchange("enable-loopinterchange", cl::init(false), cl::Hidden,
                           cl::desc("Enable the LoopInterchange Pass"));
 
+static cl::opt<bool> EnableLoopFusion("enable-loopfusion", cl::init(false),
----------------
kasuga-fj wrote:

I still don't quite understand why you want to add both a clang flag and an opt flag. But if that's the intention, `EnableLoopFusino` should be defined in `tools/opt/NewPMDriver.cpp`, not here. The same applies to `EnableLoopInterchange`. IIUC, declaring this here allows specifying like `clang -mllvm -enable-loopfusion`, but it will be overwritten after `PipelineTuningOptions`'s ctor is invoked.

On the other hand, options defined in `tools/opt/NewPMDriver.cpp` aren't recognized by the clang driver, IIUC.

But again, I'm not sure why clang/flang flags are really needed. Why isn't the opt flag sufficient? IMHO, at the very least, you should clarify the reason.

https://github.com/llvm/llvm-project/pull/142686


More information about the llvm-commits mailing list