Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SSA/Projects/InstCombine/LLVM/Opt.lean
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def wellformed (fileName : String ) : IO UInt32 := do
match icom? with
| none => return 1
| some (Sigma.mk _Γ ⟨_eff, ⟨_retTy, c⟩⟩) => do
IO.println s!"{Com.printModule c}"
IO.println s!"{Com.printFunc c}"
return 0

def runMainCmd (args : Cli.Parsed) : IO UInt32 := do
Expand Down
4 changes: 2 additions & 2 deletions SSA/Projects/LLVMRiscV/ParseAndTransform.lean
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def passriscv64 (fileName : String) : IO UInt32 := do
`true` indicates pseudo variable lowering, `fuel` is 150-/
let lowered := selectionPipeFuelWithCSE 150 c true

IO.println <| lowered.printModule
IO.println <| lowered.printFunc
return 0
| _ =>
IO.println s!" debug: WRONG RETURN TYPE : expected Ty.llvm (Ty.bitvec 64) "
Expand All @@ -54,7 +54,7 @@ def passriscv64_optimized (fileName : String) : IO UInt32 := do
/- calls to the optimized instruction selector defined in `InstructionLowering`,
`true` indicates pseudo variable lowering, `fuel` is 150 -/
let lowered := selectionPipeFuelWithCSEWithOpt 150 c true
IO.println <| lowered.printModule
IO.println <| lowered.printFunc
return 0
| _ =>
IO.println s!" debug: WRONG RETURN TYPE : expected Ty.llvm (Ty.bitvec 64) "
Expand Down
8 changes: 8 additions & 0 deletions SSA/Projects/RISCV64/Base.lean
Original file line number Diff line number Diff line change
Expand Up @@ -654,3 +654,11 @@ instance : DialectDenote RV64 where
denote o args _ := [o.denote args]ₕ

end RISCV64


variable {d} [DialectSignature d] [DialectPrint d] in
/--
Print a `Com` in generic MLIR syntax, wrapped in a `func.func`.
-/
def Com.printFunc (com : Com d Γ eff ts) : Std.Format :=
f!"func.func {com.print}"
2 changes: 1 addition & 1 deletion SSA/Projects/RISCV64/ParseAndTransform.lean
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def parseAsRiscv (fileName : String ) : IO UInt32 := do
match icom? with
| none => return 1
| some (Sigma.mk _Γ ⟨_eff, ⟨_retTy, c⟩⟩) => do
IO.println c.printModule
IO.println c.printFunc
return 0

/--
Expand Down
Loading