Skip to content

Commit 51b4011

Browse files
committed
[flang] use TBAAForest in TBAABuilder
This is important to ensure that tags end up in the same trees that were created in the FIR TBAA pass. If they are in different trees then everything in one tree will be assumed to MayAlias with everything in the other tree. This leads to poor performance. @vzakhari requested that the old (not-per-function) trees are maintained so I left the old test intact.
1 parent d5b464e commit 51b4011

File tree

5 files changed

+175
-72
lines changed

5 files changed

+175
-72
lines changed

flang/include/flang/Optimizer/CodeGen/TBAABuilder.h

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#ifndef FORTRAN_OPTIMIZER_CODEGEN_TBAABUILDER_H
1414
#define FORTRAN_OPTIMIZER_CODEGEN_TBAABUILDER_H
1515

16+
#include "flang/Optimizer/Analysis/TBAAForest.h"
1617
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
17-
#include "mlir/IR/BuiltinAttributes.h"
1818

1919
namespace fir {
2020

@@ -25,9 +25,9 @@ namespace fir {
2525
//
2626
// TBAA type information is represented with LLVM::MetadataOp operation
2727
// with specific symbol name `TBAABuilder::tbaaMetaOpName`. The basic
28-
// TBAA tree used for Flang consists of the following nodes:
28+
// TBAA trees used for Flang consists of the following nodes:
2929
// llvm.metadata @__flang_tbaa {
30-
// llvm.tbaa_root @root_0 {id = "Flang Type TBAA Root"}
30+
// llvm.tbaa_root @root_0 {id = "Flang Type TBAA Function Root funcName"}
3131
// llvm.tbaa_type_desc @type_desc_1 {id = "any access",
3232
// members = {<@root_0, 0>}}
3333
// llvm.tbaa_type_desc @type_desc_2 {id = "any data access",
@@ -162,6 +162,9 @@ namespace fir {
162162
// Given the storage association, all non-box accesses are represented
163163
// with the conservative data access tag:
164164
// < `<any data access>`, `<any data access>`, 0 >
165+
166+
// additional tags are added in flang/Optimizer/Transforms/AddAliasTags.cpp
167+
// (before CodeGen)
165168
class TBAABuilder {
166169
public:
167170
TBAABuilder(mlir::MLIRContext *context, bool applyTBAA);
@@ -184,56 +187,36 @@ class TBAABuilder {
184187

185188
// Returns TBAATagAttr representing access tag:
186189
// < <descriptor member>, <descriptor member>, 0 >
187-
mlir::LLVM::TBAATagAttr getAnyBoxAccessTag();
190+
mlir::LLVM::TBAATagAttr getAnyBoxAccessTag(mlir::LLVM::LLVMFuncOp func);
188191
// Returns TBAATagAttr representing access tag:
189192
// < <any data access>, <any data access>, 0 >
190-
mlir::LLVM::TBAATagAttr getAnyDataAccessTag();
193+
mlir::LLVM::TBAATagAttr getAnyDataAccessTag(mlir::LLVM::LLVMFuncOp func);
191194
// Returns TBAATagAttr representing access tag:
192195
// < <any access>, <any access>, 0 >
193-
mlir::LLVM::TBAATagAttr getAnyAccessTag();
196+
mlir::LLVM::TBAATagAttr getAnyAccessTag(mlir::LLVM::LLVMFuncOp func);
194197

195198
// Returns TBAATagAttr representing access tag described by the base and
196199
// access FIR types and the LLVM::GepOp representing the access in terms of
197200
// the FIR types converted to LLVM types. The base type must be derivative of
198201
// fir::BaseBoxType.
199202
mlir::LLVM::TBAATagAttr getBoxAccessTag(mlir::Type baseFIRType,
200203
mlir::Type accessFIRType,
201-
mlir::LLVM::GEPOp gep);
204+
mlir::LLVM::GEPOp gep,
205+
mlir::LLVM::LLVMFuncOp func);
202206

203207
// Returns TBAATagAttr representing access tag described by the base and
204208
// access FIR types and the LLVM::GepOp representing the access in terms of
205209
// the FIR types converted to LLVM types. The FIR types must describe the
206210
// "data" access, i.e. not an access of any box/descriptor member.
207211
mlir::LLVM::TBAATagAttr getDataAccessTag(mlir::Type baseFIRType,
208212
mlir::Type accessFIRType,
209-
mlir::LLVM::GEPOp gep);
213+
mlir::LLVM::GEPOp gep,
214+
mlir::LLVM::LLVMFuncOp func);
210215

211216
// Set to true, if TBAA builder is active, otherwise, all public
212217
// methods are no-ops.
213218
bool enableTBAA;
214219

215-
// LLVM::TBAARootAttr identifying Flang's TBAA root.
216-
mlir::LLVM::TBAARootAttr flangTBAARoot;
217-
// Identity string for Flang's TBAA root.
218-
static constexpr llvm::StringRef flangTBAARootId = "Flang Type TBAA Root";
219-
220-
// LLVM::TBAATypeDescriptorAttr identifying "any access".
221-
mlir::LLVM::TBAATypeDescriptorAttr anyAccessTypeDesc;
222-
// Identity string for "any access" type descriptor.
223-
static constexpr llvm::StringRef anyAccessTypeDescId = "any access";
224-
225-
// LLVM::TBAATypeDescriptorAttr identifying "any data access" (i.e. non-box
226-
// memory access).
227-
mlir::LLVM::TBAATypeDescriptorAttr anyDataAccessTypeDesc;
228-
// Identity string for "any data access" type descriptor.
229-
static constexpr llvm::StringRef anyDataAccessTypeDescId = "any data access";
230-
231-
// LLVM::TBAATypeDescriptorAttr identifying "descriptor member" access, i.e.
232-
// any access within the bounds of a box/descriptor.
233-
mlir::LLVM::TBAATypeDescriptorAttr boxMemberTypeDesc;
234-
// Identity string for "descriptor member" type descriptor.
235-
static constexpr llvm::StringRef boxMemberTypeDescId = "descriptor member";
236-
237220
// Number of attached TBAA tags (used for debugging).
238221
unsigned tagAttachmentCounter = 0;
239222

@@ -247,6 +230,8 @@ class TBAABuilder {
247230
std::tuple<mlir::LLVM::TBAANodeAttr, mlir::LLVM::TBAANodeAttr, int64_t>,
248231
mlir::LLVM::TBAATagAttr>
249232
tagsMap;
233+
234+
TBAAForrest trees;
250235
};
251236

252237
} // namespace fir

flang/lib/Optimizer/CodeGen/TBAABuilder.cpp

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
#include "llvm/ADT/TypeSwitch.h"
1616
#include "llvm/Support/CommandLine.h"
1717
#include "llvm/Support/Debug.h"
18+
#include <mlir/Dialect/LLVMIR/LLVMAttrs.h>
19+
#include <mlir/Dialect/LLVMIR/LLVMDialect.h>
20+
#include <mlir/Dialect/LLVMIR/LLVMTypes.h>
1821

1922
#define DEBUG_TYPE "flang-tbaa-builder"
2023

@@ -27,6 +30,13 @@ static llvm::cl::opt<bool> disableTBAA(
2730
"to override default Flang behavior"),
2831
llvm::cl::init(false));
2932

33+
// disabling this will play badly with the FIR TBAA pass, leading to worse
34+
// performance
35+
static llvm::cl::opt<bool> perFunctionTBAATrees(
36+
"per-function-tbaa-trees",
37+
llvm::cl::desc("Give each function an independent TBAA tree (default)"),
38+
llvm::cl::init(true), llvm::cl::Hidden);
39+
3040
// tagAttachmentLimit is a debugging option that allows limiting
3141
// the number of TBAA access tag attributes attached to operations.
3242
// It is set to kTagAttachmentUnlimited by default denoting "no limit".
@@ -39,26 +49,10 @@ static llvm::cl::opt<unsigned>
3949
namespace fir {
4050

4151
TBAABuilder::TBAABuilder(MLIRContext *context, bool applyTBAA)
42-
: enableTBAA(applyTBAA && !disableTBAA) {
52+
: enableTBAA(applyTBAA && !disableTBAA),
53+
trees(/*separatePerFunction=*/perFunctionTBAATrees) {
4354
if (!enableTBAA)
4455
return;
45-
46-
// Root node.
47-
flangTBAARoot =
48-
TBAARootAttr::get(context, StringAttr::get(context, flangTBAARootId));
49-
50-
// Any access node.
51-
anyAccessTypeDesc = TBAATypeDescriptorAttr::get(
52-
context, anyAccessTypeDescId, TBAAMemberAttr::get(flangTBAARoot, 0));
53-
54-
// Any data access node.
55-
anyDataAccessTypeDesc =
56-
TBAATypeDescriptorAttr::get(context, anyDataAccessTypeDescId,
57-
TBAAMemberAttr::get(anyAccessTypeDesc, 0));
58-
59-
// Box member access node.
60-
boxMemberTypeDesc = TBAATypeDescriptorAttr::get(
61-
context, boxMemberTypeDescId, TBAAMemberAttr::get(anyAccessTypeDesc, 0));
6256
}
6357

6458
TBAATagAttr TBAABuilder::getAccessTag(TBAATypeDescriptorAttr baseTypeDesc,
@@ -73,26 +67,31 @@ TBAATagAttr TBAABuilder::getAccessTag(TBAATypeDescriptorAttr baseTypeDesc,
7367
return tag;
7468
}
7569

76-
TBAATagAttr TBAABuilder::getAnyBoxAccessTag() {
70+
TBAATagAttr TBAABuilder::getAnyBoxAccessTag(mlir::LLVM::LLVMFuncOp func) {
71+
TBAATypeDescriptorAttr boxMemberTypeDesc = trees[func].boxMemberTypeDesc;
7772
return getAccessTag(boxMemberTypeDesc, boxMemberTypeDesc, /*offset=*/0);
7873
}
7974

8075
TBAATagAttr TBAABuilder::getBoxAccessTag(Type baseFIRType, Type accessFIRType,
81-
GEPOp gep) {
82-
return getAnyBoxAccessTag();
76+
GEPOp gep,
77+
mlir::LLVM::LLVMFuncOp func) {
78+
return getAnyBoxAccessTag(func);
8379
}
8480

85-
TBAATagAttr TBAABuilder::getAnyDataAccessTag() {
81+
TBAATagAttr TBAABuilder::getAnyDataAccessTag(mlir::LLVM::LLVMFuncOp func) {
82+
TBAATypeDescriptorAttr anyDataAccessTypeDesc = trees[func].anyDataTypeDesc;
8683
return getAccessTag(anyDataAccessTypeDesc, anyDataAccessTypeDesc,
8784
/*offset=*/0);
8885
}
8986

9087
TBAATagAttr TBAABuilder::getDataAccessTag(Type baseFIRType, Type accessFIRType,
91-
GEPOp gep) {
92-
return getAnyDataAccessTag();
88+
GEPOp gep,
89+
mlir::LLVM::LLVMFuncOp func) {
90+
return getAnyDataAccessTag(func);
9391
}
9492

95-
TBAATagAttr TBAABuilder::getAnyAccessTag() {
93+
TBAATagAttr TBAABuilder::getAnyAccessTag(mlir::LLVM::LLVMFuncOp func) {
94+
TBAATypeDescriptorAttr anyAccessTypeDesc = trees[func].anyAccessDesc;
9695
return getAccessTag(anyAccessTypeDesc, anyAccessTypeDesc, /*offset=*/0);
9796
}
9897

@@ -101,6 +100,9 @@ void TBAABuilder::attachTBAATag(AliasAnalysisOpInterface op, Type baseFIRType,
101100
if (!enableTBAA)
102101
return;
103102

103+
mlir::LLVM::LLVMFuncOp func = op->getParentOfType<mlir::LLVM::LLVMFuncOp>();
104+
assert(func && "func.func should have already been converted to llvm.func");
105+
104106
++tagAttachmentCounter;
105107
if (tagAttachmentLimit != kTagAttachmentUnlimited &&
106108
tagAttachmentCounter > tagAttachmentLimit)
@@ -115,11 +117,11 @@ void TBAABuilder::attachTBAATag(AliasAnalysisOpInterface op, Type baseFIRType,
115117
// a mix of data members and descriptor members may alias
116118
// with both data and descriptor accesses.
117119
// Conservatively set any-access tag if there is any descriptor member.
118-
tbaaTagSym = getAnyAccessTag();
120+
tbaaTagSym = getAnyAccessTag(func);
119121
} else if (baseFIRType.isa<fir::BaseBoxType>()) {
120-
tbaaTagSym = getBoxAccessTag(baseFIRType, accessFIRType, gep);
122+
tbaaTagSym = getBoxAccessTag(baseFIRType, accessFIRType, gep, func);
121123
} else {
122-
tbaaTagSym = getDataAccessTag(baseFIRType, accessFIRType, gep);
124+
tbaaTagSym = getDataAccessTag(baseFIRType, accessFIRType, gep, func);
123125
}
124126

125127
if (!tbaaTagSym)

flang/test/Fir/tbaa-codegen.fir

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ module attributes {fir.defaultkind = "a1c4d8i4l4r4", fir.kindmap = "", llvm.targ
3939
// CHECK: store i32 %[[A2]], ptr %[[A1]], align 4, !tbaa ![[A_ACCESS_TAG]]
4040
// CHECK: ret void
4141
// CHECK: }
42+
// CHECK: ![[ANY_ACCESS_TYPE:.*]] = !{!"any access", ![[ROOT:.*]], i64 0}
43+
// CHECK: ![[ROOT]] = !{!"Flang function root _QPsimple"}
4244
// CHECK: ![[A_ACCESS_TAG]] = !{![[A_ACCESS_TYPE:.*]], ![[A_ACCESS_TYPE]], i64 0}
4345
// CHECK: ![[A_ACCESS_TYPE]] = !{!"dummy arg data/a", ![[DUMMY_ARG_TYPE:.*]], i64 0}
4446
// CHECK: ![[DUMMY_ARG_TYPE]] = !{!"dummy arg data", ![[DATA_ACCESS_TYPE:.*]], i64 0}
45-
// CHECK: ![[DATA_ACCESS_TYPE]] = !{!"any data access", ![[ANY_ACCESS_TYPE:.*]], i64 0}
46-
// CHECK: ![[ANY_ACCESS_TYPE]] = !{!"any access", ![[ROOT:.*]], i64 0}
47-
// CHECK: ![[ROOT]] = !{!"Flang function root _QPsimple"}
47+
// CHECK: ![[DATA_ACCESS_TYPE]] = !{!"any data access", ![[ANY_ACCESS_TYPE]], i64 0}

flang/test/Fir/tbaa-codegen2.fir

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
// test that tbaa attributes can be added to fir.load and fir.store
2+
// and that these attributes are propagated to LLVMIR and that these
3+
// interoperrate with tbaa tags added during codegen
4+
5+
// RUN: tco %s | FileCheck %s
6+
7+
// subroutine func(a)
8+
// integer, intent(inout) :: a(:)
9+
// a = a+1
10+
// a(1) = a(2)
11+
#tbaa_root = #llvm.tbaa_root<id = "Flang function root _QPfunc">
12+
#tbaa_type_desc = #llvm.tbaa_type_desc<id = "any access", members = {<#tbaa_root, 0>}>
13+
#tbaa_type_desc1 = #llvm.tbaa_type_desc<id = "any data access", members = {<#tbaa_type_desc, 0>}>
14+
#tbaa_type_desc2 = #llvm.tbaa_type_desc<id = "dummy arg data", members = {<#tbaa_type_desc1, 0>}>
15+
#tbaa_type_desc3 = #llvm.tbaa_type_desc<id = "dummy arg data/a", members = {<#tbaa_type_desc2, 0>}>
16+
#tbaa_tag = #llvm.tbaa_tag<base_type = #tbaa_type_desc3, access_type = #tbaa_type_desc3, offset = 0>
17+
module attributes {fir.defaultkind = "a1c4d8i4l4r4", fir.kindmap = "", llvm.target_triple = "aarch64-unknown-linux-gnu"} {
18+
func.func @_QPfunc(%arg0: !fir.box<!fir.array<?xi32>> {fir.bindc_name = "a"}) {
19+
%c3_i32 = arith.constant 3 : i32
20+
%c1_i32 = arith.constant 1 : i32
21+
%c0 = arith.constant 0 : index
22+
%c2 = arith.constant 2 : index
23+
%c1 = arith.constant 1 : index
24+
%0 = fir.alloca !fir.box<!fir.array<?xi32>>
25+
%1 = fir.declare %arg0 {fortran_attrs = #fir.var_attrs<intent_inout>, uniq_name = "_QFfuncEa"} : (!fir.box<!fir.array<?xi32>>) -> !fir.box<!fir.array<?xi32>>
26+
%2 = fir.rebox %1 : (!fir.box<!fir.array<?xi32>>) -> !fir.box<!fir.array<?xi32>>
27+
%3:3 = fir.box_dims %2, %c0 : (!fir.box<!fir.array<?xi32>>, index) -> (index, index, index)
28+
%4 = fir.shape %3#1 : (index) -> !fir.shape<1>
29+
%5 = fir.allocmem !fir.array<?xi32>, %3#1 {bindc_name = ".tmp.array", uniq_name = ""}
30+
%6 = fir.declare %5(%4) {uniq_name = ".tmp.array"} : (!fir.heap<!fir.array<?xi32>>, !fir.shape<1>) -> !fir.heap<!fir.array<?xi32>>
31+
%7 = fir.embox %6(%4) : (!fir.heap<!fir.array<?xi32>>, !fir.shape<1>) -> !fir.box<!fir.array<?xi32>>
32+
fir.do_loop %arg1 = %c1 to %3#1 step %c1 unordered {
33+
%16 = fir.array_coor %2 %arg1 : (!fir.box<!fir.array<?xi32>>, index) -> !fir.ref<i32>
34+
// load with tbaa
35+
%17 = fir.load %16 {tbaa = [#tbaa_tag]} : !fir.ref<i32>
36+
%18 = arith.addi %17, %c1_i32 : i32
37+
%19 = fir.array_coor %6(%4) %arg1 : (!fir.heap<!fir.array<?xi32>>, !fir.shape<1>, index) -> !fir.ref<i32>
38+
// store without tbaa
39+
fir.store %18 to %19 : !fir.ref<i32>
40+
}
41+
fir.store %2 to %0 : !fir.ref<!fir.box<!fir.array<?xi32>>>
42+
%8 = fir.address_of(@_QQcl.2F746D702F73696D706C652E66393000) : !fir.ref<!fir.char<1,16>>
43+
%9 = fir.convert %0 : (!fir.ref<!fir.box<!fir.array<?xi32>>>) -> !fir.ref<!fir.box<none>>
44+
%10 = fir.convert %7 : (!fir.box<!fir.array<?xi32>>) -> !fir.box<none>
45+
%11 = fir.convert %8 : (!fir.ref<!fir.char<1,16>>) -> !fir.ref<i8>
46+
%12 = fir.call @_FortranAAssign(%9, %10, %11, %c3_i32) : (!fir.ref<!fir.box<none>>, !fir.box<none>, !fir.ref<i8>, i32) -> none
47+
fir.freemem %6 : !fir.heap<!fir.array<?xi32>>
48+
%13 = fir.array_coor %2 %c2 : (!fir.box<!fir.array<?xi32>>, index) -> !fir.ref<i32>
49+
// load modified not to have tbaa
50+
%14 = fir.load %13 : !fir.ref<i32>
51+
%15 = fir.array_coor %2 %c1 : (!fir.box<!fir.array<?xi32>>, index) -> !fir.ref<i32>
52+
// store with tbaa
53+
fir.store %14 to %15 {tbaa = [#tbaa_tag]} : !fir.ref<i32>
54+
return
55+
}
56+
func.func private @_FortranAAssign(!fir.ref<!fir.box<none>>, !fir.box<none>, !fir.ref<i8>, i32) -> none attributes {fir.runtime}
57+
fir.global linkonce @_QQcl.2F746D702F73696D706C652E66393000 constant : !fir.char<1,16> {
58+
%0 = fir.string_lit "/tmp/simple.f90\00"(16) : !fir.char<1,16>
59+
fir.has_value %0 : !fir.char<1,16>
60+
}
61+
}
62+
// CHECK-LABEL: define void @_QPfunc(
63+
// CHECK-SAME: ptr %[[ARG0:.*]]) {
64+
// [...]
65+
// 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
66+
// box access:
67+
// CHECK: %[[VAL6:.*]] = load i64, ptr %[[VAL5]], align 4, !tbaa ![[BOX_ACCESS_TAG:.*]]
68+
// CHECK: %[[VAL7:.*]] = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i32 0, i32 7, i32 0, i32 1
69+
// box access:
70+
// CHECK: %[[VAL8:.*]] = load i64, ptr %[[VAL7]], align 4, !tbaa ![[BOX_ACCESS_TAG]]
71+
// CHECK: %[[VAL9:.*]] = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %[[ARG0]], i32 0, i32 7, i32 0, i32 2
72+
// box access:
73+
// CHECK: %[[VAL10:.*]] = load i64, ptr %[[VAL9]], align 4, !tbaa ![[BOX_ACCESS_TAG]]
74+
// CHECK: %[[VAL11:.*]] = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %[[ARG0]], i32 0, i32 0
75+
// box access:
76+
// CHECK: %[[VAL12:.*]] = load ptr, ptr %[[VAL11]], align 8, !tbaa ![[BOX_ACCESS_TAG]]
77+
// CHECK: %[[VAL15:.*]] = insertvalue { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] } %14, ptr %[[VAL12]], 0
78+
// CHECK: store { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] } %[[VAL15]], ptr %{{.*}}, align 8, !tbaa ![[BOX_ACCESS_TAG]]
79+
// CHECK: %[[VAL16:.*]] = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %{{.*}}, i32 0, i32 7, i64 0, i32 0
80+
// box access:
81+
// CHECK: %[[VAL17:.*]] = load i64, ptr %[[VAL16]], align 4, !tbaa ![[BOX_ACCESS_TAG]]
82+
// CHECK: %[[VAL18:.*]] = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %{{.*}}, i32 0, i32 7, i64 0, i32 1
83+
// box access:
84+
// CHECK: %[[VAL19:.*]] = load i64, ptr %[[VAL18]], align 4, !tbaa ![[BOX_ACCESS_TAG]]
85+
// CHECK: %[[VAL20:.*]] = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %{{.*}}, i32 0, i32 7, i64 0, i32 2
86+
// box access:
87+
// CHECK: %[[VAL21:.*]] = load i64, ptr %[[VAL20]], align 4, !tbaa ![[BOX_ACCESS_TAG]]
88+
// [...]
89+
// box access:
90+
// CHECK: store { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] } %{{.*}}, ptr %{{.*}}, align 8, !tbaa ![[BOX_ACCESS_TAG]]
91+
// [...]
92+
93+
// [...]
94+
// CHECK: %[[VAL40:.*]] = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %{{.*}}, i32 0, i32 0
95+
// box access:
96+
// CHECK: %[[VAL41:.*]] = load ptr, ptr %[[VAL40]], align 8, !tbaa ![[BOX_ACCESS_TAG]]
97+
// CHECK: %[[VAL42:.*]] = getelementptr i8, ptr %[[VAL41]], i64 %{{.*}}
98+
// access to 'a':
99+
// CHECK: %[[VAL43:.*]] = load i32, ptr %[[VAL42]], align 4, !tbaa ![[A_ACCESS_TAG:.*]]
100+
// [...]
101+
// CHECK: %[[VAL50:.*]] = getelementptr i32, ptr %{{.*}}, i64 %{{.*}}
102+
// store to the temporary:
103+
// CHECK: store i32 %{{.*}}, ptr %[[VAL50]], align 4, !tbaa ![[DATA_ACCESS_TAG:.*]]
104+
// [...]
105+
106+
// CHECK: [[BOX_ACCESS_TAG]] = !{![[BOX_ACCESS_TYPE:.*]], ![[BOX_ACCESS_TYPE]], i64 0}
107+
// CHECK: ![[BOX_ACCESS_TYPE]] = !{!"descriptor member", ![[ANY_ACCESS_TYPE:.*]], i64 0}
108+
// CHECK: ![[ANY_ACCESS_TYPE]] = !{!"any access", ![[ROOT_TYPE:.*]], i64 0}
109+
// CHECK: ![[ROOT_TYPE]] = !{!"Flang function root _QPfunc"}
110+
// CHECK: ![[A_ACCESS_TAG]] = !{![[A_ACCESS_TYPE:.*]], ![[A_ACCESS_TYPE]], i64 0}
111+
// CHECK: ![[A_ACCESS_TYPE]] = !{!"dummy arg data/a", ![[ARG_ACCESS_TYPE:.*]], i64 0}
112+
// CHECK: ![[ARG_ACCESS_TYPE]] = !{!"dummy arg data", ![[DATA_ACCESS_TYPE:.*]], i64 0}
113+
// CHECK: ![[DATA_ACCESS_TYPE]] = !{!"any data access", ![[ANY_ACCESS_TYPE]], i64 0}
114+
// CHECK: ![[DATA_ACCESS_TAG]] = !{![[DATA_ACCESS_TYPE]], ![[DATA_ACCESS_TYPE]], i64 0}

0 commit comments

Comments
 (0)