Skip to content

Commit

Permalink
stage
Browse files Browse the repository at this point in the history
  • Loading branch information
Yihao Sun committed Mar 22, 2023
1 parent 8c6be74 commit d271938
Showing 1 changed file with 111 additions and 2 deletions.
113 changes: 111 additions & 2 deletions evaluation/points-to-llvm /aa.slog
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,77 @@

;; (support-instruction )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; lift flat facts to slog facts


;; ret
; ret <type> <value> ; Return a value from a non-void function
; ret void ; Return from void function

;; br
; br i1 <cond>, label <iftrue>, label <iffalse>
; br label <dest> ; Unconditional branch

;; switch
; switch <intty> <value>, label <defaultdest> [ <intty> <val>, label <dest> ... ]

;; alloca
; <result> = alloca [inalloca] <type> [, <ty> <NumElements>] [, align <alignment>] [, addrspace(<num>)] ; yields type addrspace(num)*:result


;; load
; <result> = load [volatile] <ty>, ptr <pointer>[, align <alignment>][, !nontemporal !<nontemp_node>][, !invariant.load !<empty_node>][, !invariant.group !<empty_node>][, !nonnull !<empty_node>][, !dereferenceable !<deref_bytes_node>][, !dereferenceable_or_null !<deref_bytes_node>][, !align !<align_node>][, !noundef !<empty_node>]
; <result> = load atomic [volatile] <ty>, ptr <pointer> [syncscope("<target-scope>")] <ordering>, align <alignment> [, !invariant.group !<empty_node>]
; !<nontemp_node> = !{ i32 1 }
; !<empty_node> = !{}
; !<deref_bytes_node> = !{ i64 <dereferenceable_bytes> }
; !<align_node> = !{ i64 <value_alignment> }

;; store
; store [volatile] <ty> <value>, ptr <pointer>[, align <alignment>][, !nontemporal !<nontemp_node>][, !invariant.group !<empty_node>] ; yields void
; store atomic [volatile] <ty> <value>, ptr <pointer> [syncscope("<target-scope>")] <ordering>, align <alignment> [, !invariant.group !<empty_node>] ; yields void
; !<nontemp_node> = !{ i32 1 }
; !<empty_node> = !{}

;; getelementptr
; <result> = getelementptr <ty>, ptr <ptrval>{, [inrange] <ty> <idx>}*
; <result> = getelementptr inbounds <ty>, ptr <ptrval>{, [inrange] <ty> <idx>}*
; <result> = getelementptr <ty>, <N x ptr> <ptrval>, [inrange] <vector index type> <idx>

;; Type Conversion

; <result> = trunc <ty> <value> to <ty2> ; yields ty2

; <result> = zext <ty> <value> to <ty2> ; yields ty2

; <result> = sext <ty> <value> to <ty2> ; yields ty2

; <result> = fptrunc <ty> <value> to <ty2> ; yields ty2

; <result> = fpext <ty> <value> to <ty2> ; yields ty2

; <result> = fptoui <ty> <value> to <ty2> ; yields ty2

; <result> = fptosi <ty> <value> to <ty2> ; yields ty2

; <result> = uitofp <ty> <value> to <ty2> ; yields ty2

; <result> = sitofp <ty> <value> to <ty2> ; yields ty2

; <result> = ptrtoint <ty> <value> to <ty2> ; yields ty2

; <result> = inttoptr <ty> <value> to <ty2>[, !dereferenceable !<deref_bytes_node>][, !dereferenceable_or_null !<deref_bytes_node>]

; <result> = bitcast <ty> <value> to <ty2> ; yields ty2

;;

;; icmp/fcmp
; <result> = icmp <cond> <ty> <op1>, <op2> ; yields i1 or <N x i1>:result

;; phi
;; <result> = phi [fast-math-flags] <ty> [ <val0>, <label0>], ...
[(lift-phi-helper instr 0 [(phi-value-pair label v)])
<--
(phi_instr_pair_label instr 0 label)
Expand All @@ -59,7 +128,47 @@
(lift-phi-helper instr-id p-len pairs)
(instr_assigns_to instr-id lhs)]

;;
;; select
; <result> = select [fast-math flags] selty <cond>, <ty> <val1>, <ty> <val2> ; yields ty

;; call
; <result> = [tail | musttail | notail ] call [fast-math flags] [cconv] [ret attrs] [addrspace(<num>)]
; <ty>|<fnty> <fnptrval>(<function args>) [fn attrs] [ operand bundles ]

;;;;;;;;;;;;;;;;;

;; Intrinstic
; memcpy
; declare void @llvm.memcpy.p0.p0.i32(ptr <dest>, ptr <src>,
; i32 <len>, i1 <isvolatile>)
; declare void @llvm.memcpy.p0.p0.i64(ptr <dest>, ptr <src>,
; i64 <len>, i1 <isvolatile>)


;;;;;;;;;;;;;;;;;

;; Possible targets (not impl now)

;; indirectbr (c++ ?, we maybe don't need this)
;; indirectbr ptr <address>, [ label <dest1>, label <dest2>, ... ]

;; invoke
; <result> = invoke [cconv] [ret attrs] [addrspace(<num>)] <ty>|<fnty> <fnptrval>(<function args>) [fn attrs]
; [operand bundles] to label <normal label> unwind label <exception label>

;; callbr
; <result> = callbr [cconv] [ret attrs] [addrspace(<num>)] <ty>|<fnty> <fnptrval>(<function args>) [fn attrs]
; [operand bundles] to label <fallthrough label> [indirect labels]




;; arith




;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[(bb_instrs_help bb_id a [])
<--
Expand Down

0 comments on commit d271938

Please sign in to comment.