Advertisement
Guest User

Untitled

a guest
Jan 13th, 2019
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 1.10 KB | None | 0 0
  1. (defun make-another-test-thing ()
  2.   (make-instance 'llvm-if
  3.                  :type "i32"
  4.                  :test (make-instance 'llvm-arithmetic
  5.                                       :name "cmp eq"
  6.                                       :children (list
  7.                                                  (make-instance 'llvm-constant
  8.                                                                 :value 42
  9.                                                                 :type "i32")
  10.                                                  (make-instance 'llvm-constant
  11.                                                                 :value 43
  12.                                                                 :type "i32")))
  13.                  :then (make-instance 'llvm-constant :value 0 :type "i32")
  14.                  :else (make-instance 'llvm-constant :value 1337 :type "i32")))
  15.  
  16. CL-USER> (make-another-test-thing)
  17.  
  18. %20 = cmp eq i32 42, 43
  19. br i1 %20, label %thenlabel15, label %elselabel16
  20. thenlabel15:
  21. %then17 = 0
  22. elselabel16:
  23. %else18 = 1337
  24. %return19 = phi i32 [ %then17, %thenlabel15 ], [ %else18, %elselabel16 ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement