Skip to content

meta nodes lost when converting back to legacy IR #27104

Closed
@maleadt

Description

@maleadt

The new-style IR -> CodeInfo converter forgets about meta nodes, some of which are handled by codegen (@noinline for noinline LLVM IR attr as used by CUDAnative, @polly).
The fix seemed easy, but causes breakage, and I don't have time to look into this right now...

diff --git a/base/compiler/ssair/legacy.jl b/base/compiler/ssair/legacy.jl
index 6e0c9c1444..7593e9a6fa 100644
--- a/base/compiler/ssair/legacy.jl
+++ b/base/compiler/ssair/legacy.jl
@@ -260,6 +260,7 @@ function replace_code_newstyle!(ci::CodeInfo, ir::IRCode, nargs, linetable)
     resize!(ci.slotnames, nargs+1)
     resize!(ci.slotflags, nargs+1)
     ci.code = ir.stmts
+    prepend!(ci.code, ir.meta)
     ci.codelocs = ir.lines
     ci.linetable = linetable
     ci.ssavaluetypes = ir.types

The other replace_code! converter looks like it handled this, but that code seems dead?

Metadata

Metadata

Assignees

Labels

compiler:optimizerOptimization passes (mostly in base/compiler/ssair/)gpuAffects running Julia on a GPUregressionRegression in behavior compared to a previous version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions