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

Radu Salavat via flang-commits flang-commits at lists.llvm.org
Fri Dec 8 01:54:24 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));
----------------
Radu2k wrote:

Since the pass "createFunctionAttrPass" should serve in the future as a general pass to add function attributes, this will be called either way, therefore there are two options:
1. We keep the current implementation that adds this even if the value is None 
2. The type used predominantly in FunctionAttr.cpp and in the general Pass definition is std::optional<[DataType]>

I will update the files with the implementation of the latest case and we can compare which is more appropriate in this case.

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


More information about the flang-commits mailing list