Skip to content

Commit 7e4aeb4

Browse files
committed
address reviews
1 parent 5d2743b commit 7e4aeb4

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

mlir/lib/Dialect/LLVMIR/IR/LLVMAttrs.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,9 @@ TargetFeaturesAttr TargetFeaturesAttr::featuresAt(Operation *op) {
378378

379379
LogicalResult
380380
ModuleFlagAttr::verify(function_ref<InFlightDiagnostic()> emitError,
381-
mlir::LLVM::ModFlagBehavior flagBehavior,
382-
mlir::StringAttr key, mlir::Attribute value) {
383-
if (!isa<mlir::IntegerAttr, mlir::StringAttr>(value))
381+
LLVM::ModFlagBehavior flagBehavior, StringAttr key,
382+
Attribute value) {
383+
if (!isa<IntegerAttr, StringAttr>(value))
384384
return emitError()
385385
<< "only integer and string values are currently supported";
386386
return success();

mlir/lib/Target/LLVMIR/ModuleImport.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,10 +533,8 @@ LogicalResult ModuleImport::convertModuleFlagsMetadata() {
533533
} else {
534534
emitWarning(mlirModule.getLoc())
535535
<< "unsupported module flag value: " << diagMD(val, llvmModule.get());
536-
}
537-
538-
if (!valAttr)
539536
continue;
537+
}
540538

541539
moduleFlags.push_back(builder.getAttr<ModuleFlagAttr>(
542540
convertModFlagBehaviorFromLLVM(behavior),

mlir/test/Dialect/LLVMIR/invalid.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1778,7 +1778,7 @@ llvm.mlir.alias external @y5 : i32 {
17781778
module {
17791779
llvm.func @foo()
17801780

1781-
// expected-error@+1 {{only integer and string values are currently supported}}
1781+
// expected-error@below {{only integer and string values are currently supported}}
17821782
llvm.module_flags [#llvm.mlir.module_flag<error, "yolo", @foo>]
17831783
}
17841784

mlir/test/Target/LLVMIR/Import/module-flags.ll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
; CHECK-SAME: #llvm.mlir.module_flag<override, "probe-stack", "inline-asm">]
2020

2121
; // -----
22-
; expected-warning@-2{{unsupported module flag value: !4 = !{!"foo", i32 1}}}
23-
!0 = !{ i32 1, !"foo", i32 1 }
24-
!1 = !{ i32 4, !"bar", i32 37 }
25-
!2 = !{ i32 2, !"qux", i32 42 }
26-
!3 = !{ i32 3, !"qux", !{ !"foo", i32 1 }}
27-
!llvm.module.flags = !{ !0, !1, !2, !3 }
22+
; expected-warning@-2 {{unsupported module flag value: !4 = !{!"foo", i32 1}}}
23+
!10 = !{ i32 1, !"foo", i32 1 }
24+
!11 = !{ i32 4, !"bar", i32 37 }
25+
!12 = !{ i32 2, !"qux", i32 42 }
26+
!13 = !{ i32 3, !"qux", !{ !"foo", i32 1 }}
27+
!llvm.module.flags = !{ !10, !11, !12, !13 }

0 commit comments

Comments
 (0)