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

Radu Salavat via flang-commits flang-commits at lists.llvm.org
Mon Dec 11 03:32:05 PST 2023


================
@@ -310,10 +311,17 @@ inline void createDefaultFIRCodeGenPassPipeline(
 
   if (config.VScaleMin != 0)
     pm.addPass(fir::createVScaleAttrPass({config.VScaleMin, config.VScaleMax}));
-
+  
+  // Add function attributes 
   fir::FunctionAttrTypes functionAttrs;
-  functionAttrs.framePointerKind = config.FramePointerKind;
-  pm.addPass(fir::createFunctionAttrPass(functionAttrs));
+  
+  if (config.FramePointerKind != llvm::FramePointerKind::None) {  
+    if (config.FramePointerKind == llvm::FramePointerKind::NonLeaf) 
+        functionAttrs.framePointerKind = mlir::LLVM::framePointerKind::FramePointerKind::NonLeaf;
+    else functionAttrs.framePointerKind = mlir::LLVM::framePointerKind::FramePointerKind::All;
----------------
Radu2k wrote:

Why do consider this is extra? 

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


More information about the flang-commits mailing list