The llvm-general-quote package

[ Tags: bsd3, code-generation, compilers-interpreters, library ] [ Propose Tags ]

This package provides a QuasiQuotation for llvm-general.

[Skip to Readme]


Dependencies array (==0.5.*), base (==4.7.*), bytestring, containers (==0.5.*), haskell-src-meta, llvm-general-pure (>=, mainland-pretty, mtl (>=2.2.1), split, srcloc, syb, symbol, template-haskell (>=2.7), th-lift [details]
License BSD3
Copyright Timo von Holtz 2014
Author Timo von Holtz <>
Maintainer Timo von Holtz <>
Category Compilers/Interpreters, Code Generation
Home page
Source repository head: git clone git://
Uploaded Tue Oct 14 22:41:42 UTC 2014 by TvH
Distributions NixOS:
Downloads 493 total (2 in the last 30 days)
Rating 0.0 (0 ratings) [clear rating]
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI




Maintainer's Corner

For package maintainers and hackage trustees

Readme for llvm-general-quote-

[back to package description]


llvm-general-quote is a quasiquoting-library for llvm-general. It aims to support all language constructs of llvm.

In addtion to this, it supports using mutable variables and control structures instead of pure SSA form. This is translated automatically into SSA through appropriate renaming.


  define i64 @foo(i64 %start, i64 %end) {
      %x = i64 0

      for i64 %i in %start to %end {
          %x = add i64 %i, %x

      ret i64 %x

this would be transformed into:

define i64 @foo(i64 %start, i64 %end) {
  br label %for.head

for.head:                      ; preds = %n0, %entry
  %x.12 = phi i64 [ 0, %entry ], [ %x.6, %n0 ]
  %i.4 = phi i64 [ %start, %entry ], [ %i.9, %n0 ]
  %for.cond.3 = icmp slt i64 %i.4, %end
  br i1 %for.cond.3, label %n0, label %for.end

n0:                            ; preds = %for.head
  %x.6 = add i64 %i.4, %x.12
  %i.9 = add nuw nsw i64 %i.4, 1
  br label %for.head

for.end:                       ; preds = %for.head
  ret i64 %x.12