-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update grammar to LLVM 9.0 #101
Comments
Introduced in LLVM 9.0. Updates llir/llvm#101.
Introduced in LLVM 9.0. Also, remove byval from ir/enum and regeneate asm/enum. Updates #101.
The test cases have been updated to LLVM 9.0. Any The currently failing test cases are reported below:
|
The following new language concepts were introduced.
@g.partition = global i32 0, partition "part"
%atomicrmw.fadd = atomicrmw fadd float* %word, float 1.0 monotonic
%atomicrmw.fsub = atomicrmw fsub float* %word, float 1.0 monotonic
%f.nnan = select nnan i1 %cond, float %op1, float %op2
%t10 = alloca <vscale x 4 x i32> |
…alDecl Introduced in LLVM 9.0. Updates llir/llvm#101.
Current set of test cases failing are as follows: === [ ../testdata/llvm/test/Bitcode/compatibility.ll ] ===
diff --git a/compatibility.ll.golden b/compatibility.ll.golden
index 757509e..1f1152e 100644
--- a/compatibility.ll.golden
+++ b/compatibility.ll.golden
@@ -67,7 +67,7 @@ $comdat2 = comdat any
@g.addrspace = addrspace(1) global i32 0
@g.externally_initialized = external externally_initialized global i32
@g.section = global i32 0, section "_DATA"
-@g.partition = global i32 0, partition "part"
+@g.partition = global i32 0
@comdat.any = global i32 0, comdat
@comdat.exactmatch = global i32 0, comdat
@comdat.largest = global i32 0, comdat
@@ -103,7 +103,7 @@ $comdat2 = comdat any
@a.localexec = thread_local(localexec) alias i32, i32* @g.localexec
@a.unnamed_addr = unnamed_addr alias i32, i32* @g.unnamed_addr
@a.local_unnamed_addr = local_unnamed_addr alias i32, i32* @g.local_unnamed_addr
-@alias.partition = alias i32, i32* @g.partition, partition "part"
+@alias.partition = alias i32, i32* @g.partition
@ifunc.external = external ifunc void (), i8* ()* @ifunc_resolver
@ifunc.private = private ifunc void (), i8* ()* @ifunc_resolver
@@ -111,7 +111,7 @@ $comdat2 = comdat any
@ifunc.default = default ifunc void (), i8* ()* @ifunc_resolver
@ifunc.hidden = hidden ifunc void (), i8* ()* @ifunc_resolver
@ifunc.protected = protected ifunc void (), i8* ()* @ifunc_resolver
-@ifunc.partition = ifunc void (), i8* ()* @ifunc_resolver, partition "part"
+@ifunc.partition = ifunc void (), i8* ()* @ifunc_resolver
declare void @g.f1()
@@ -436,7 +436,7 @@ declare void @f.strictfp() #35
declare void @f.section() section "80"
-define void @f.partition() partition "part" {
+define void @f.partition() {
; <label>:0
ret void
}
@@ -578,21 +578,21 @@ define void @fastmathflags_binops(float %op1, float %op2) {
define void @fastmathflags_select(i1 %cond, float %op1, float %op2) {
; <label>:0
- %f.nnan = select nnan i1 %cond, float %op1, float %op2
- %f.ninf = select ninf i1 %cond, float %op1, float %op2
- %f.nsz = select nsz i1 %cond, float %op1, float %op2
- %f.arcp = select arcp i1 %cond, float %op1, float %op2
- %f.contract = select contract i1 %cond, float %op1, float %op2
- %f.afn = select afn i1 %cond, float %op1, float %op2
- %f.reassoc = select reassoc i1 %cond, float %op1, float %op2
- %f.fast = select fast i1 %cond, float %op1, float %op2
+ %f.nnan = select i1 %cond, float %op1, float %op2
+ %f.ninf = select i1 %cond, float %op1, float %op2
+ %f.nsz = select i1 %cond, float %op1, float %op2
+ %f.arcp = select i1 %cond, float %op1, float %op2
+ %f.contract = select i1 %cond, float %op1, float %op2
+ %f.afn = select i1 %cond, float %op1, float %op2
+ %f.reassoc = select i1 %cond, float %op1, float %op2
+ %f.fast = select i1 %cond, float %op1, float %op2
ret void
}
define void @fastmathflags_vector_select(<2 x i1> %cond, <2 x double> %op1, <2 x double> %op2) {
; <label>:0
- %f.nnan.nsz = select nnan nsz <2 x i1> %cond, <2 x double> %op1, <2 x double> %op2
- %f.fast = select fast <2 x i1> %cond, <2 x double> %op1, <2 x double> %op2
+ %f.nnan.nsz = select <2 x i1> %cond, <2 x double> %op1, <2 x double> %op2
+ %f.fast = select <2 x i1> %cond, <2 x double> %op1, <2 x double> %op2
ret void
}
@@ -1258,7 +1258,7 @@ define i8** @constexpr() {
ret i8** getelementptr inbounds ({ [4 x i8*], [4 x i8*] }, { [4 x i8*], [4 x i8*] }* null, i32 0, inrange i32 1, i32 2)
}
-declare void @llvm.test.immarg.intrinsic(i32 immarg)
+declare void @llvm.test.immarg.intrinsic(i32)
declare void @byval_type(i32* byval(i32) align 2)
=== [ ../testdata/llvm/test/Transforms/InstCombine/vec_demanded_elts.ll ] ===
diff --git a/vec_demanded_elts.ll.golden b/vec_demanded_elts.ll.golden
index ac66f6a..729daa1 100644
--- a/vec_demanded_elts.ll.golden
+++ b/vec_demanded_elts.ll.golden
@@ -328,7 +328,7 @@ define <3 x float> @shuf_frem_const_op1(<3 x float> %x) {
define i32* @gep_vbase_w_s_idx(<2 x i32*> %base) {
; <label>:0
%gep = getelementptr i32, <2 x i32*> %base, i64 1
- %ee = extractelement <2 x i32*> %gep, i32 1
+ %ee = extractelement i32* %gep, i32 1
ret i32* %ee
}
@@ -337,7 +337,7 @@ define i32* @gep_splat_base_w_s_idx(i32* %base) {
%basevec1 = insertelement <2 x i32*> undef, i32* %base, i32 0
%basevec2 = shufflevector <2 x i32*> %basevec1, <2 x i32*> undef, <2 x i32> zeroinitializer
%gep = getelementptr i32, <2 x i32*> %basevec2, i64 1
- %ee = extractelement <2 x i32*> %gep, i32 1
+ %ee = extractelement i32* %gep, i32 1
ret i32* %ee
}
@@ -362,7 +362,7 @@ define i32* @gep_splat_base_w_vidx(i32* %base, <2 x i64> %idxvec) {
define i32* @gep_cvbase_w_s_idx(<2 x i32*> %base, i64 %raw_addr) {
; <label>:0
%gep = getelementptr i32, <2 x i32*> <i32* @GLOBAL, i32* @GLOBAL>, i64 %raw_addr
- %ee = extractelement <2 x i32*> %gep, i32 1
+ %ee = extractelement i32* %gep, i32 1
ret i32* %ee
}
=== [ ../testdata/llvm/test/Feature/fp-intrinsics.ll ] ===
diff --git a/fp-intrinsics.ll.golden b/fp-intrinsics.ll.golden
index 64bfe1d..417e8d7 100644
--- a/fp-intrinsics.ll.golden
+++ b/fp-intrinsics.ll.golden
@@ -114,7 +114,7 @@ entry:
define float @f20() {
entry:
- %result = call float @llvm.experimental.constrained.fptrunc.f32.f64(double 42.1, metadata !"round.dynamic", metadata !"fpexcept.strict")
+ %result = call float @llvm.experimental.constrained.fptrunc.f32.f64(double 0x40450CCCCCCCCCCD, metadata !"round.dynamic", metadata !"fpexcept.strict")
ret float %result
}
=== [ ../testdata/llvm/test/Assembler/call-nonzero-program-addrspace-2.ll ] ===
diff --git a/call-nonzero-program-addrspace-2.ll.golden b/call-nonzero-program-addrspace-2.ll.golden
index 84905da..6b0cb13 100644
--- a/call-nonzero-program-addrspace-2.ll.golden
+++ b/call-nonzero-program-addrspace-2.ll.golden
@@ -1,7 +1,7 @@
define i8 @test_unnamed(i8 (i32)*, i8 (i32) addrspace(42)*) {
define i8 @test_unnamed(i8 (i32)*, i8 (i32) addrspace(42)*) {
; <label>:2
%3 = call i8 %0(i32 0)
- %4 = call addrspace(42) i8 %1(i32 0)
+ %4 = call i8 %1(i32 0)
%5 = call i8 %1(i32 0)
ret i8 0
}
=== [ ../testdata/llvm/test/Assembler/call-nonzero-program-addrspace.ll ] ===
diff --git a/call-nonzero-program-addrspace.ll.golden b/call-nonzero-program-addrspace.ll.golden
index e34b8e1..da74225 100644
--- a/call-nonzero-program-addrspace.ll.golden
+++ b/call-nonzero-program-addrspace.ll.golden
@@ -1,7 +1,7 @@
define i8 @test(i8 (i32)* %fnptr0, i8 (i32) addrspace(42)* %fnptr42) {
define i8 @test(i8 (i32)* %fnptr0, i8 (i32) addrspace(42)* %fnptr42) {
; <label>:0
%explicit_as_0 = call i8 %fnptr0(i32 0)
- %explicit_as_42 = call addrspace(42) i8 %fnptr42(i32 0)
+ %explicit_as_42 = call i8 %fnptr42(i32 0)
%call_no_as = call i8 %fnptr42(i32 0)
ret i8 0
}
=== [ ../testdata/llvm/test/Assembler/invoke-nonzero-program-addrspace.ll ] ===
diff --git a/invoke-nonzero-program-addrspace.ll.golden b/invoke-nonzero-program-addrspace.ll.golden
index d183ac6..b835a23 100644
--- a/invoke-nonzero-program-addrspace.ll.golden
+++ b/invoke-nonzero-program-addrspace.ll.golden
@@ -1,20 +1,21 @@
-define i8 @test_invoke(i8 (i32)* %fnptr0, i8 (i32) addrspace(200)* %fnptr200) personality i32 (...) addrspace(200)* @__gxx_personality_v0 {
+define i8 @test_invoke(i8 (i32)* %fnptr0, i8 (i32) addrspace(200)* %fnptr200) personality i32 (...)* @__gxx_personality_v0 {
; <label>:0
%explicit_as_0 = invoke i8 %fnptr0(i32 0)
to label %ok unwind label %lpad
; <label>:1
- %explicit_as_42 = invoke addrspace(200) i8 %fnptr200(i32 0)
+ %explicit_as_42 = invoke i8 %fnptr200(i32 0)
to label %ok unwind label %lpad
; <label>:2
%no_as = invoke i8 %fnptr200(i32 0)
to label %ok unwind label %lpad
ok:
ret i8 0
lpad:
%exn = landingpad {i8*, i32}
%exn = landingpad { i8*, i32 }
cleanup
unreachable
} |
Anyone adventurous enough may consider themselves invited to take upon the challenge of updating the grammar to LLVM 9.0. @dannypsnl? :) I've tried to reference commits to this issue that update the grammar for LLVM 9.0, so they may help out as a reference for what kind of changes that need to be done.
See other referenced commits of this issue for further examples. And, if you need guidance when taking on this challenge, just reach out :) Cheers, Edit: related to this issue are also #105 and #106, which track the update of test cases and new language constructs for LLVM 9.0. |
Introduced in LLVM 9.0. Updates llir/llvm#101. ref: llir/llvm#105 (comment)
For future reference, from #110 (comment) As For reference, prior to this commit, we got the following panic:
|
With LLVM 9.0 released, we should sync the grammar and the IR with the latest version.
Some of the changes will be very simple, e.g.
nofree
function attribute enumOther changes are also quite easy, e.g.
DICommonBlock
specialized metadata.byval
parameter attributeOther changes are slightly more involved, e.g.
callbr
instruction.And some changes have dependencies, e.g.
vTableFuncs
which depends on global summaries as added in LLVM 8.0 (see grammar: add module summary (introduced in LLVM 7.0) #43)To get a feel for what changes to the LLVM IR assembly that were introduced between LLVM 8.0 and 9.0, we run
diff
between the source releases of these respective versions.New keywords:
partition
nofree
nosync
sanitize_memtag
willreturn
immarg
vscale
Part of issue #43.
canAutoHide
vTableFuncs
virtFunc
typeidCompatibleVTable
The text was updated successfully, but these errors were encountered: