Skip to content

Commit a456168

Browse files
committed
R6: Addressing review comments
1 parent bb992e8 commit a456168

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

flang/lib/Optimizer/Dialect/Support/FIRContext.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ void fir::setTuneCPU(mlir::ModuleOp mod, llvm::StringRef cpu) {
9090

9191
static constexpr const char *atomicIgnoreDenormalModeName =
9292
"fir.atomic_ignore_denormal_mode";
93+
9394
void fir::setAtomicIgnoreDenormalMode(mlir::ModuleOp mod, bool value) {
9495
if (value) {
9596
auto *ctx = mod.getContext();
@@ -101,11 +102,12 @@ void fir::setAtomicIgnoreDenormalMode(mlir::ModuleOp mod, bool value) {
101102
}
102103

103104
bool fir::getAtomicIgnoreDenormalMode(mlir::ModuleOp mod) {
104-
return mod->hasAttrOfType<mlir::UnitAttr>(atomicIgnoreDenormalModeName);
105+
return mod->hasAttr(atomicIgnoreDenormalModeName);
105106
}
106107

107108
static constexpr const char *atomicFineGrainedMemoryName =
108109
"fir.atomic_fine_grained_memory";
110+
109111
void fir::setAtomicFineGrainedMemory(mlir::ModuleOp mod, bool value) {
110112
if (value) {
111113
auto *ctx = mod.getContext();
@@ -117,10 +119,12 @@ void fir::setAtomicFineGrainedMemory(mlir::ModuleOp mod, bool value) {
117119
}
118120

119121
bool fir::getAtomicFineGrainedMemory(mlir::ModuleOp mod) {
120-
return mod->hasAttrOfType<mlir::UnitAttr>(atomicFineGrainedMemoryName);
122+
return mod->hasAttr(atomicFineGrainedMemoryName);
121123
}
124+
122125
static constexpr const char *atomicRemoteMemoryName =
123126
"fir.atomic_remote_memory";
127+
124128
void fir::setAtomicRemoteMemory(mlir::ModuleOp mod, bool value) {
125129
if (value) {
126130
auto *ctx = mod.getContext();
@@ -132,7 +136,7 @@ void fir::setAtomicRemoteMemory(mlir::ModuleOp mod, bool value) {
132136
}
133137

134138
bool fir::getAtomicRemoteMemory(mlir::ModuleOp mod) {
135-
return mod->hasAttrOfType<mlir::UnitAttr>(atomicRemoteMemoryName);
139+
return mod->hasAttr(atomicRemoteMemoryName);
136140
}
137141

138142
llvm::StringRef fir::getTuneCPU(mlir::ModuleOp mod) {

0 commit comments

Comments
 (0)