Skip to content

Commit 0487377

Browse files
authored
[flang] Pass to add frame pointer attribute (#74598)
Pass to add frame pointer attribute in Flang
1 parent 554feb0 commit 0487377

File tree

16 files changed

+174
-18
lines changed

16 files changed

+174
-18
lines changed

flang/include/flang/Frontend/CodeGenOptions.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ CODEGENOPT(Underscoring, 1, 1)
3838
ENUM_CODEGENOPT(RelocationModel, llvm::Reloc::Model, 3, llvm::Reloc::PIC_) ///< Name of the relocation model to use.
3939
ENUM_CODEGENOPT(DebugInfo, llvm::codegenoptions::DebugInfoKind, 4, llvm::codegenoptions::NoDebugInfo) ///< Level of debug info to generate
4040
ENUM_CODEGENOPT(VecLib, llvm::driver::VectorLibrary, 3, llvm::driver::VectorLibrary::NoLibrary) ///< Vector functions library to use
41+
ENUM_CODEGENOPT(FramePointer, llvm::FramePointerKind, 2, llvm::FramePointerKind::None) ///< Enable the usage of frame pointers
4142

4243
#undef CODEGENOPT
4344
#undef ENUM_CODEGENOPT

flang/include/flang/Optimizer/Transforms/Passes.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define FORTRAN_OPTIMIZER_TRANSFORMS_PASSES_H
1111

1212
#include "flang/Optimizer/Dialect/FIROps.h"
13+
#include "mlir/Dialect/LLVMIR/LLVMAttrs.h"
1314
#include "mlir/Pass/Pass.h"
1415
#include "mlir/Pass/PassRegistry.h"
1516
#include <memory>
@@ -83,6 +84,15 @@ std::unique_ptr<mlir::Pass> createVScaleAttrPass();
8384
std::unique_ptr<mlir::Pass>
8485
createVScaleAttrPass(std::pair<unsigned, unsigned> vscaleAttr);
8586

87+
struct FunctionAttrTypes {
88+
mlir::LLVM::framePointerKind::FramePointerKind framePointerKind =
89+
mlir::LLVM::framePointerKind::FramePointerKind::None;
90+
};
91+
92+
std::unique_ptr<mlir::Pass> createFunctionAttrPass();
93+
std::unique_ptr<mlir::Pass>
94+
createFunctionAttrPass(FunctionAttrTypes &functionAttr);
95+
8696
// declarative passes
8797
#define GEN_PASS_REGISTRATION
8898
#include "flang/Optimizer/Transforms/Passes.h.inc"

flang/include/flang/Optimizer/Transforms/Passes.td

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,4 +349,25 @@ def VScaleAttr : Pass<"vscale-attr", "mlir::func::FuncOp"> {
349349
let constructor = "::fir::createVScaleAttrPass()";
350350
}
351351

352+
def FunctionAttr : Pass<"function-attr", "mlir::func::FuncOp"> {
353+
let summary = "Pass that adds function attributes expected at LLVM IR level";
354+
let description = [{ This feature introduces a general attribute aimed at
355+
customizing function characteristics.
356+
Options include:
357+
Add "frame-pointer" attribute to functions: Set an attribute for the frame
358+
pointer on functions, to avoid saving the frame pointer in a register in
359+
functions where it is unnecessary. This eliminates the need for
360+
instructions to save, establish, and restore frame pointers, while also
361+
freeing up an additional register in numerous functions. However, this
362+
approach can make debugging unfeasible on certain machines.
363+
}];
364+
let options = [
365+
Option<"framePointerKind", "frame-pointer",
366+
"mlir::LLVM::framePointerKind::FramePointerKind",
367+
/*default=*/"mlir::LLVM::framePointerKind::FramePointerKind{}",
368+
"frame pointer">,
369+
];
370+
let constructor = "::fir::createFunctionAttrPass()";
371+
}
372+
352373
#endif // FLANG_OPTIMIZER_TRANSFORMS_PASSES

flang/include/flang/Tools/CLOptions.inc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
/// debugging the test tools. This file must be included into the tool.
1111

1212
#include "mlir/Conversion/SCFToControlFlow/SCFToControlFlow.h"
13+
#include "mlir/Dialect/LLVMIR/LLVMAttrs.h"
1314
#include "mlir/Pass/PassManager.h"
1415
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
1516
#include "mlir/Transforms/Passes.h"
@@ -311,6 +312,20 @@ inline void createDefaultFIRCodeGenPassPipeline(
311312
if (config.VScaleMin != 0)
312313
pm.addPass(fir::createVScaleAttrPass({config.VScaleMin, config.VScaleMax}));
313314

315+
// Add function attributes
316+
fir::FunctionAttrTypes functionAttrs;
317+
318+
if (config.FramePointerKind != llvm::FramePointerKind::None) {
319+
if (config.FramePointerKind == llvm::FramePointerKind::NonLeaf)
320+
functionAttrs.framePointerKind =
321+
mlir::LLVM::framePointerKind::FramePointerKind::NonLeaf;
322+
else
323+
functionAttrs.framePointerKind =
324+
mlir::LLVM::framePointerKind::FramePointerKind::All;
325+
326+
pm.addPass(fir::createFunctionAttrPass(functionAttrs));
327+
}
328+
314329
fir::addFIRToLLVMPass(pm, config);
315330
}
316331

flang/include/flang/Tools/CrossToolHelpers.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ struct MLIRToLLVMPassPipelineConfig {
3535
LoopVersioning = opts.LoopVersioning;
3636
DebugInfo = opts.getDebugInfo();
3737
AliasAnalysis = opts.AliasAnalysis;
38+
FramePointerKind = opts.getFramePointer();
3839
}
3940

4041
llvm::OptimizationLevel OptLevel; ///< optimisation level
@@ -44,6 +45,8 @@ struct MLIRToLLVMPassPipelineConfig {
4445
bool AliasAnalysis = false; ///< Add TBAA tags to generated LLVMIR
4546
llvm::codegenoptions::DebugInfoKind DebugInfo =
4647
llvm::codegenoptions::NoDebugInfo; ///< Debug info generation.
48+
llvm::FramePointerKind FramePointerKind =
49+
llvm::FramePointerKind::None; ///< Add frame pointer to functions.
4750
unsigned VScaleMin = 0; ///< SVE vector range minimum.
4851
unsigned VScaleMax = 0; ///< SVE vector range maximum.
4952
};

flang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,23 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts,
245245

246246
opts.AliasAnalysis = opts.OptimizationLevel > 0;
247247

248+
// -mframe-pointer=none/non-leaf/all option.
249+
if (const llvm::opt::Arg *a =
250+
args.getLastArg(clang::driver::options::OPT_mframe_pointer_EQ)) {
251+
std::optional<llvm::FramePointerKind> val =
252+
llvm::StringSwitch<std::optional<llvm::FramePointerKind>>(a->getValue())
253+
.Case("none", llvm::FramePointerKind::None)
254+
.Case("non-leaf", llvm::FramePointerKind::NonLeaf)
255+
.Case("all", llvm::FramePointerKind::All)
256+
.Default(std::nullopt);
257+
258+
if (!val.has_value()) {
259+
diags.Report(clang::diag::err_drv_invalid_value)
260+
<< a->getAsString(args) << a->getValue();
261+
} else
262+
opts.setFramePointer(val.value());
263+
}
264+
248265
for (auto *a : args.filtered(clang::driver::options::OPT_fpass_plugin_EQ))
249266
opts.LLVMPassPlugins.push_back(a->getValue());
250267

flang/lib/Optimizer/Transforms/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ add_flang_library(FIRTransforms
2020
OMPFunctionFiltering.cpp
2121
OMPMarkDeclareTarget.cpp
2222
VScaleAttr.cpp
23+
FunctionAttr.cpp
2324

2425
DEPENDS
2526
FIRDialect
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
//===- FunctionAttr.cpp ---------------------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
//===----------------------------------------------------------------------===//
10+
/// \file
11+
/// This is a generic pass for adding attributes to functions.
12+
//===----------------------------------------------------------------------===//
13+
#include "flang/Optimizer/Transforms/Passes.h"
14+
#include "mlir/Dialect/LLVMIR/LLVMAttrs.h"
15+
16+
namespace fir {
17+
#define GEN_PASS_DECL_FUNCTIONATTR
18+
#define GEN_PASS_DEF_FUNCTIONATTR
19+
#include "flang/Optimizer/Transforms/Passes.h.inc"
20+
} // namespace fir
21+
22+
#define DEBUG_TYPE "func-attr"
23+
24+
namespace {
25+
26+
class FunctionAttrPass : public fir::impl::FunctionAttrBase<FunctionAttrPass> {
27+
public:
28+
FunctionAttrPass(const fir::FunctionAttrOptions &options) {
29+
framePointerKind = options.framePointerKind;
30+
}
31+
FunctionAttrPass() {}
32+
void runOnOperation() override;
33+
};
34+
35+
} // namespace
36+
37+
void FunctionAttrPass::runOnOperation() {
38+
LLVM_DEBUG(llvm::dbgs() << "=== Begin " DEBUG_TYPE " ===\n");
39+
mlir::func::FuncOp func = getOperation();
40+
41+
LLVM_DEBUG(llvm::dbgs() << "Func-name:" << func.getSymName() << "\n");
42+
43+
mlir::MLIRContext *context = &getContext();
44+
if (framePointerKind != mlir::LLVM::framePointerKind::FramePointerKind::None)
45+
func->setAttr("frame_pointer", mlir::LLVM::FramePointerKindAttr::get(
46+
context, framePointerKind));
47+
48+
LLVM_DEBUG(llvm::dbgs() << "=== End " DEBUG_TYPE " ===\n");
49+
}
50+
51+
std::unique_ptr<mlir::Pass>
52+
fir::createFunctionAttrPass(fir::FunctionAttrTypes &functionAttr) {
53+
FunctionAttrOptions opts;
54+
// Frame pointer
55+
opts.framePointerKind = functionAttr.framePointerKind;
56+
57+
return std::make_unique<FunctionAttrPass>(opts);
58+
}
59+
60+
std::unique_ptr<mlir::Pass> fir::createFunctionAttrPass() {
61+
return std::make_unique<FunctionAttrPass>();
62+
}
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
! Test that flang-new forwards -fno-omit-frame-pointer and -fomit-frame-pointer Flang frontend
2-
! RUN: %flang -fno-omit-frame-pointer --target=x86-none-none -fsyntax-only -### %s -o %t 2>&1 | FileCheck %s
3-
! CHECK: "-mframe-pointer=all"
2+
! RUN: %flang --target=aarch64-none-none -fsyntax-only -### %s -o %t 2>&1 | FileCheck %s --check-prefix=CHECK-NOVALUE
3+
! CHECK-NOVALUE: "-fc1"{{.*}}"-mframe-pointer=non-leaf"
4+
5+
! RUN: %flang -fomit-frame-pointer --target=aarch64-none-none -fsyntax-only -### %s -o %t 2>&1 | FileCheck %s --check-prefix=CHECK-NONEFP
6+
! CHECK-NONEFP: "-fc1"{{.*}}"-mframe-pointer=none"
47

58
! RUN: %flang -fno-omit-frame-pointer --target=aarch64-none-none -fsyntax-only -### %s -o %t 2>&1 | FileCheck %s --check-prefix=CHECK-NONLEAFFP
6-
! CHECK-NONLEAFFP: "-mframe-pointer=non-leaf"
9+
! CHECK-NONLEAFFP: "-fc1"{{.*}}"-mframe-pointer=non-leaf"
710

8-
! RUN: %flang -fomit-frame-pointer --target=aarch64-none-none -fsyntax-only -### %s -o %t 2>&1 | FileCheck %s --check-prefix=CHECK-NONEFP
9-
! CHECK-NONEFP: "-mframe-pointer=none"
11+
! RUN: %flang -fno-omit-frame-pointer --target=x86-none-none -fsyntax-only -### %s -o %t 2>&1 | FileCheck %s --check-prefix=CHECK-ALLFP
12+
! CHECK-ALLFP: "-fc1"{{.*}}"-mframe-pointer=all"

flang/test/Driver/func-attr.f90

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
! Test that -mframe-pointer can accept only specific values and when given an invalid value, check it raises an error.
2+
3+
! RUN: %flang_fc1 -triple aarch64-none-none -mframe-pointer=none -emit-llvm -o - %s 2>&1| FileCheck %s --check-prefix=CHECK-NONEFP
4+
! RUN: %flang_fc1 -triple aarch64-none-none -mframe-pointer=non-leaf -emit-llvm -o - %s 2>&1| FileCheck %s --check-prefix=CHECK-NONLEAFFP
5+
! RUN: %flang_fc1 -triple aarch64-none-none -mframe-pointer=all -emit-llvm -o - %s 2>&1| FileCheck %s --check-prefix=CHECK-ALLFP
6+
! RUN: not %flang_fc1 -triple aarch64-none-none -mframe-pointer=wrongval -emit-llvm -o - %s 2>&1| FileCheck %s --check-prefix=CHECK-WRONGVALUEFP
7+
8+
! CHECK-NONEFP-LABEL: @func_() {
9+
10+
! CHECK-NONLEAFFP-LABEL: @func_()
11+
! CHECK-NONLEAFFP-SAME: #0
12+
13+
! CHECK-ALLFP-LABEL: @func_()
14+
! CHECK-ALLFP-SAME: #0
15+
16+
subroutine func
17+
end subroutine func
18+
19+
! CHECK-NONEFP-NOT: attributes #0 = { "frame-pointer"="{{.*}}" }
20+
! CHECK-NONLEAFFP: attributes #0 = { "frame-pointer"="non-leaf" }
21+
! CHECK-ALLFP: attributes #0 = { "frame-pointer"="all" }
22+
23+
! CHECK-WRONGVALUEFP:error: invalid value 'wrongval' in '-mframe-pointer=wrongval'

flang/test/Driver/mlir-debug-pass-pipeline.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,5 @@
8282
! ALL-NEXT: ExternalNameConversion
8383
! DEBUG-NEXT: AddDebugFoundation
8484
! NO-DEBUG-NOT: AddDebugFoundation
85-
! ALL-NEXT: FIRToLLVMLowering
85+
! ALL: FIRToLLVMLowering
8686
! ALL-NOT: LLVMIRLoweringPass

flang/test/Driver/save-mlir-temps.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@
5151
! Content to check from the MLIR outputs
5252
!--------------------------
5353
! MLIR-FIR-NOT: llvm.func
54-
! MLIR-FIR: func.func @{{.*}}main() {
54+
! MLIR-FIR: func.func @{{.*}}main(){{.*}}{
5555

5656
! MLIR-FIR-NOT: func.func
57-
! MLIR-LLVMIR: llvm.func @{{.*}}main() {
57+
! MLIR-LLVMIR: llvm.func @{{.*}}main(){{.*}}{
5858

5959
end program

flang/test/Fir/box-offset-codegen.fir

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ func.func @scalar_addr(%scalar : !fir.ref<!fir.box<!fir.type<t>>>) -> !fir.llvm_
77
return %addr : !fir.llvm_ptr<!fir.ref<!fir.type<t>>>
88
}
99
// CHECK-LABEL: define ptr @scalar_addr(
10-
// CHECK-SAME: ptr %[[BOX:.*]]) {
10+
// CHECK-SAME: ptr %[[BOX:.*]]){{.*}}{
1111
// CHECK: %[[VAL_0:.*]] = getelementptr { ptr, i64, i32, i8, i8, i8, i8, ptr, [1 x i64] }, ptr %[[BOX]], i32 0, i32 0
1212
// CHECK: ret ptr %[[VAL_0]]
1313

@@ -16,7 +16,7 @@ func.func @scalar_tdesc(%scalar : !fir.ref<!fir.box<!fir.type<t>>>) -> !fir.llvm
1616
return %tdesc : !fir.llvm_ptr<!fir.tdesc<!fir.type<t>>>
1717
}
1818
// CHECK-LABEL: define ptr @scalar_tdesc(
19-
// CHECK-SAME: ptr %[[BOX:.*]]) {
19+
// CHECK-SAME: ptr %[[BOX:.*]]){{.*}}{
2020
// CHECK: %[[VAL_0:.*]] = getelementptr { ptr, i64, i32, i8, i8, i8, i8, ptr, [1 x i64] }, ptr %[[BOX]], i32 0, i32 7
2121
// CHECK: ret ptr %[[VAL_0]]
2222

@@ -25,7 +25,7 @@ func.func @array_addr(%array : !fir.ref<!fir.class<!fir.ptr<!fir.array<?x!fir.ty
2525
return %addr : !fir.llvm_ptr<!fir.ptr<!fir.array<?x!fir.type<t>>>>
2626
}
2727
// CHECK-LABEL: define ptr @array_addr(
28-
// CHECK-SAME: ptr %[[BOX:.*]]) {
28+
// CHECK-SAME: ptr %[[BOX:.*]]){{.*}}{
2929
// CHECK: %[[VAL_0:.*]] = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]], ptr, [1 x i64] }, ptr %[[BOX]], i32 0, i32 0
3030
// CHECK: ret ptr %[[VAL_0]]
3131

@@ -34,6 +34,6 @@ func.func @array_tdesc(%array : !fir.ref<!fir.class<!fir.ptr<!fir.array<?x!fir.t
3434
return %tdesc : !fir.llvm_ptr<!fir.tdesc<!fir.type<t>>>
3535
}
3636
// CHECK-LABEL: define ptr @array_tdesc(
37-
// CHECK-SAME: ptr %[[BOX:.*]]) {
37+
// CHECK-SAME: ptr %[[BOX:.*]]){{.*}}{
3838
// CHECK: %[[VAL_0:.*]] = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]], ptr, [1 x i64] }, ptr %[[BOX]], i32 0, i32 8
3939
// CHECK: ret ptr %[[VAL_0]]

flang/test/Fir/polymorphic.fir

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ func.func @_QMpolymorphic_testPtest_allocate_unlimited_polymorphic_non_derived()
1010
return
1111
}
1212

13-
// CHECK-LABEL: define void @_QMpolymorphic_testPtest_allocate_unlimited_polymorphic_non_derived() {
13+
// CHECK-LABEL: define void @_QMpolymorphic_testPtest_allocate_unlimited_polymorphic_non_derived(){{.*}}{
1414
// CHECK: %[[MEM:.*]] = alloca { ptr, i64, i32, i8, i8, i8, i8, ptr, [1 x i64] }
1515
// CHECK: %[[DESC:.*]] = alloca { ptr, i64, i32, i8, i8, i8, i8, ptr, [1 x i64] }, i64 1
1616
// CHECK: store { ptr, i64, i32, i8, i8, i8, i8, ptr, [1 x i64] } { ptr null, i64 0, i32 20180515, i8 0, i8 -1, i8 1, i8 1, ptr null, [1 x i64] undef }, ptr %[[MEM]]
@@ -87,7 +87,7 @@ func.func @_QMunlimitedPsub1(%arg0: !fir.class<!fir.array<?xnone>> {fir.bindc_na
8787
}
8888

8989
// CHECK-LABEL: define void @_QMunlimitedPsub1(
90-
// CHECK-SAME: ptr %[[ARRAY:.*]]) {
90+
// CHECK-SAME: ptr %[[ARRAY:.*]]){{.*}}{
9191
// CHECK: %[[BOX:.*]] = alloca { ptr, i64, i32, i8, i8, i8, i8, ptr, [1 x i64] }
9292
// CHECK: %{{.}} = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]], ptr, [1 x i64] }, ptr %[[ARRAY]], i32 0, i32 7, i32 0, i32 2
9393
// CHECK: %[[TYPE_DESC_GEP:.*]] = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]], ptr, [1 x i64] }, ptr %[[ARRAY]], i32 0, i32 8
@@ -151,7 +151,7 @@ func.func @_QQmain() {
151151
return
152152
}
153153

154-
// CHECK-LABEL: define void @_QQmain() {
154+
// CHECK-LABEL: define void @_QQmain(){{.*}}{
155155
// CHECK: %[[CLASS_NONE:.*]] = alloca { ptr, i64, i32, i8, i8, i8, i8, ptr, [1 x i64] }
156156
// CHECK: %[[DESC:.*]] = alloca { ptr, i64, i32, i8, i8, i8, i8, ptr, [1 x i64] }, i64 1
157157
// CHECK: store { ptr, i64, i32, i8, i8, i8, i8, ptr, [1 x i64] } { ptr @_QMmod1Ea, i64 ptrtoint (ptr getelementptr (%_QMmod1TtK2, ptr null, i32 1) to i64), i32 20180515, i8 0, i8 42, i8 1, i8 1, ptr @_QMmod1E.dt.t.2, [1 x i64] undef }, ptr %[[CLASS_NONE]], align 8
@@ -175,7 +175,7 @@ func.func @_QMmod2Pinitp(%arg0: !fir.ref<!fir.class<!fir.ptr<none>>> {fir.bindc_
175175
func.func private @_FortranAPointerAssociate(!fir.ref<!fir.box<none>>, !fir.box<none>) -> none attributes {fir.runtime}
176176

177177
// CHECK-LABEL: define void @_QMmod2Pinitp(
178-
// CHECK-SAME: ptr %[[ARG0:.*]]) {
178+
// CHECK-SAME: ptr %[[ARG0:.*]]){{.*}}{
179179
// CHECK: %[[ALLOCA_CLASS_NONE:.*]] = alloca { ptr, i64, i32, i8, i8, i8, i8, ptr, [1 x i64] }
180180
// CHECK: %[[LOAD:.*]] = load { ptr, i64, i32, i8, i8, i8, i8, ptr, [1 x i64] }, ptr %[[ARG0]]
181181
// CHECK: store { ptr, i64, i32, i8, i8, i8, i8, ptr, [1 x i64] } %[[LOAD]], ptr %[[ALLOCA_CLASS_NONE]]

flang/test/Fir/tbaa-codegen.fir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module attributes {fir.defaultkind = "a1c4d8i4l4r4", fir.kindmap = "", llvm.targ
2828
}
2929

3030
// CHECK-LABEL: define void @_QPsimple(
31-
// CHECK-SAME: ptr %[[ARG0:.*]]) {
31+
// CHECK-SAME: ptr %[[ARG0:.*]]){{.*}}{
3232
// [...]
3333
// load a(2):
3434
// CHECK: %[[VAL20:.*]] = getelementptr i8, ptr %{{.*}}, i64 %{{.*}}

flang/test/Fir/tbaa-codegen2.fir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ module attributes {fir.defaultkind = "a1c4d8i4l4r4", fir.kindmap = "", llvm.targ
6060
}
6161
}
6262
// CHECK-LABEL: define void @_QPfunc(
63-
// CHECK-SAME: ptr %[[ARG0:.*]]) {
63+
// CHECK-SAME: ptr %[[ARG0:.*]]){{.*}}{
6464
// [...]
6565
// CHECK: %[[VAL5:.*]] = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %[[ARG0]], i32 0, i32 7, i32 0, i32 0
6666
// box access:

0 commit comments

Comments
 (0)