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

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Mon Dec 11 03:44:33 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;
----------------
tblah wrote:

Ahh never mind, I missed the conversion from an llvm frame pointer to an mlir frame pointer.

Why use an llvm frame pointer at all? We could just store the mlir frame pointer from the start and not need to convert

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


More information about the flang-commits mailing list