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

Radu Salavat via flang-commits flang-commits at lists.llvm.org
Thu Dec 7 02:09:51 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:

As in Clang, FramePointerKind is usually set, even if it is not specified, therefore the current logic accommodates this dynamic. In flang/include/flang/Tools/CrossToolHelpers.h it is either updated or set to None. As well the FunctionAttrs is meant to be reused for multiple function attributes that require to be added in LLVM IR. 

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


More information about the flang-commits mailing list