The current reduction tries all or nothing elimination of named metadata. I noticed in one case where one of the module flags was necessary, but it left the rest. Reduce the individual operands of named metadata nodes that are known to behave like lists. Be conservative since some named metadata may have more specific verifier requirements for the operands.
41 lines
1.5 KiB
LLVM
41 lines
1.5 KiB
LLVM
; Test keeping one module flag
|
|
; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=named-metadata --test=FileCheck --test-arg=--check-prefix=CHECK-INTERESTINGNESS0 --test-arg=%s --test-arg=--input-file %s -o %t.0
|
|
; RUN: FileCheck --check-prefix=RESULT0 %s < %t.0
|
|
|
|
; Test keeping two module flags
|
|
; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=named-metadata --test=FileCheck --test-arg=--check-prefix=CHECK-INTERESTINGNESS1 --test-arg=%s --test-arg=--input-file %s -o %t.1
|
|
; RUN: FileCheck --check-prefix=RESULT1 %s < %t.1
|
|
|
|
|
|
; Test removing all module flags
|
|
; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=named-metadata --test=FileCheck --test-arg=--check-prefix=CHECK-INTERESTINGNESS2 --test-arg=%s --test-arg=--input-file %s -o %t.2
|
|
; RUN: FileCheck --check-prefix=RESULT2 %s < %t.2
|
|
|
|
|
|
; CHECK-INTERESTINGNESS0: "openmp-device"
|
|
|
|
; CHECK-INTERESTINGNESS1: "wchar_size"
|
|
; CHECK-INTERESTINGNESS1: "openmp"
|
|
|
|
; CHECK-INTERESTINGNESS2: !llvm.module.flags
|
|
|
|
; RESULT0: !llvm.module.flags = !{!0}
|
|
; RESULT0: !0 = !{i32 7, !"openmp-device", i32 50}
|
|
|
|
|
|
; RESULT1: !llvm.module.flags = !{!0, !1}
|
|
; RESULT1: !0 = !{i32 1, !"wchar_size", i32 4}
|
|
; RESULT1: !1 = !{i32 7, !"openmp", i32 50}
|
|
|
|
|
|
; RESULT2: !llvm.module.flags = !{}
|
|
|
|
!llvm.module.flags = !{!0, !1, !2, !3, !4, !5}
|
|
|
|
!0 = !{i32 1, !"amdgpu_code_object_version", i32 400}
|
|
!1 = !{i32 1, !"wchar_size", i32 4}
|
|
!2 = !{i32 7, !"openmp", i32 50}
|
|
!3 = !{i32 7, !"openmp-device", i32 50}
|
|
!4 = !{i32 8, !"PIC Level", i32 1}
|
|
!5 = !{i32 1, !"LTOPostLink", i32 1}
|