Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion flang/include/flang/Optimizer/Transforms/Passes.td
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,8 @@ def FunctionAttr : Pass<"function-attr", "mlir::func::FuncOp"> {
clEnumValN(mlir::LLVM::framePointerKind::FramePointerKind::None, "None", ""),
clEnumValN(mlir::LLVM::framePointerKind::FramePointerKind::NonLeaf, "NonLeaf", ""),
clEnumValN(mlir::LLVM::framePointerKind::FramePointerKind::All, "All", ""),
clEnumValN(mlir::LLVM::framePointerKind::FramePointerKind::Reserved, "Reserved", "")
clEnumValN(mlir::LLVM::framePointerKind::FramePointerKind::Reserved, "Reserved", ""),
clEnumValN(mlir::LLVM::framePointerKind::FramePointerKind::NonLeafNoReserve, "NonLeafNoReserve", "")
)}]>,
Option<"instrumentFunctionEntry", "instrument-function-entry",
"std::string", /*default=*/"",
Expand Down
3 changes: 3 additions & 0 deletions flang/lib/Optimizer/Passes/Pipelines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,9 @@ void createDefaultFIRCodeGenPassPipeline(mlir::PassManager &pm,
framePointerKind = mlir::LLVM::framePointerKind::FramePointerKind::All;
else if (config.FramePointerKind == llvm::FramePointerKind::Reserved)
framePointerKind = mlir::LLVM::framePointerKind::FramePointerKind::Reserved;
else if (config.FramePointerKind == llvm::FramePointerKind::NonLeafNoReserve)
framePointerKind =
mlir::LLVM::framePointerKind::FramePointerKind::NonLeafNoReserve;
else
framePointerKind = mlir::LLVM::framePointerKind::FramePointerKind::None;

Expand Down
5 changes: 5 additions & 0 deletions flang/test/Driver/func-attr.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

! RUN: %flang_fc1 -triple aarch64-none-none -mframe-pointer=none -emit-llvm -o - %s 2>&1| FileCheck %s --check-prefix=CHECK-NONEFP
! RUN: %flang_fc1 -triple aarch64-none-none -mframe-pointer=non-leaf -emit-llvm -o - %s 2>&1| FileCheck %s --check-prefix=CHECK-NONLEAFFP
! RUN: %flang_fc1 -triple aarch64-none-none -mframe-pointer=non-leaf-no-reserve -emit-llvm -o - %s 2>&1| FileCheck %s --check-prefix=CHECK-NONLEAFNORESERVEFP
! RUN: %flang_fc1 -triple aarch64-none-none -mframe-pointer=reserved -emit-llvm -o - %s 2>&1| FileCheck %s --check-prefix=CHECK-RESERVEDFP
! RUN: %flang_fc1 -triple aarch64-none-none -mframe-pointer=all -emit-llvm -o - %s 2>&1| FileCheck %s --check-prefix=CHECK-ALLFP
! RUN: not %flang_fc1 -triple aarch64-none-none -mframe-pointer=wrongval -emit-llvm -o - %s 2>&1| FileCheck %s --check-prefix=CHECK-WRONGVALUEFP
Expand All @@ -13,6 +14,9 @@
! CHECK-NONLEAFFP-LABEL: @func_()
! CHECK-NONLEAFFP-SAME: #0

! CHECK-NONLEAFNORESERVEFP-LABEL: @func_()
! CHECK-NONLEAFNORESERVEFP-SAME: #0

! CHECK-ALLFP-LABEL: @func_()
! CHECK-ALLFP-SAME: #0

Expand All @@ -21,6 +25,7 @@ end subroutine func

! CHECK-NONEFP-NOT: attributes #0 = { "frame-pointer"="{{.*}}" }
! CHECK-NONLEAFFP: attributes #0 = { "frame-pointer"="non-leaf" }
! CHECK-NONLEAFNORESERVEFP: attributes #0 = { "frame-pointer"="non-leaf-no-reserve" }
! CHECK-RESERVEDFP: attributes #0 = { "frame-pointer"="reserved" }
! CHECK-ALLFP: attributes #0 = { "frame-pointer"="all" }

Expand Down
Loading