[flang-commits] [flang] [flang] Pass to add frame pointer attribute (PR #74598)

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Thu Dec 7 08:32:02 PST 2023


================
@@ -311,6 +311,10 @@ inline void createDefaultFIRCodeGenPassPipeline(
   if (config.VScaleMin != 0)
     pm.addPass(fir::createVScaleAttrPass({config.VScaleMin, config.VScaleMax}));
 
+  fir::FunctionAttrTypes functionAttrs;
+  functionAttrs.framePointerKind = config.FramePointerKind;
+  pm.addPass(fir::createFunctionAttrPass(functionAttrs));
----------------
tblah wrote:

I think Jean means something like this
```
if (config.FramePointerKind != FramePointerKind::None) {
  fir::FunctionAttrTypes functionAttrs;
  functionAttrs.framePointerKind = config.FramePointerKind;
  pm.addPass(fir::createFunctionAttrPass(functionAttrs);
}
```

Even if framepointer is set by the frontend, there isn't much point setting it on every function if it is None, as this is the default anyway.

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


More information about the flang-commits mailing list