IR that is semantically valid. Most of the IR produced doesn't
pass the Verifier.
+TODO: Metadata, in all its forms
+
*)
I ::= "title: LLVM assembly language\n"
The rest of this file is derived directly from llvmAsmParser.y.
*)
-ArithmeticOps ::= add | fadd | sub | fsub | mul | fmul |
- udiv | sdiv | fdiv | urem | srem | frem ;
+ArithmeticOps ::= + OptNW add | fadd | OptNW sub | fsub | OptNW mul | fmul |
+ udiv | OptExact sdiv | fdiv | urem | srem | frem ;
LogicalOps ::= shl | lshr | ashr | and | or | xor;
CastOps ::= trunc | zext | sext | fptrunc | fpext | bitcast |
uitofp | sitofp | fptoui | fptosi | inttoptr | ptrtoint ;
| dllexport
| common
| private
+ | "linker_private"
+ | "linker_private_weak"
;
GVExternalLinkage
| signext
| readnone
| readonly
+ | inlinehint
+ | alignstack
| noinline
| alwaysinline
| optsize
| ssp
| sspreq
+ | returns_twice
+ | nonlazybind
+ | sanitize_address
+ | sanitize_thread
+ | sanitize_memory
;
OptFuncAttrs ::= + _ | OptFuncAttrs FuncAttr ;
| Types FPVAL ;
ConstExpr::= CastOps "(" ^ ConstVal to Types ^ ")"
- | getelementptr "(" ^ ConstVal IndexList ^ ")"
+ | getelementptr OptInBounds "(" ^ ConstVal IndexList ^ ")"
| select "(" ^ ConstVal ^ "," ConstVal ^ "," ConstVal ^ ")"
| ArithmeticOps "(" ^ ConstVal ^ "," ConstVal ^ ")"
| LogicalOps "(" ^ ConstVal ^ "," ConstVal ^ ")"
| MemoryInst ;
OptVolatile ::= - volatile | _ ;
+OptExact ::= - exact | _ ;
+OptNSW ::= - nsw | _ ;
+OptNUW ::= - nuw | _ ;
+OptNW ::= OptNUW OptNSW | OptNSW OptNUW ;
+OptInBounds ::= - inbounds | _ ;
MemoryInst ::= malloc Types OptCAlign
| malloc Types ^ "," INTTYPE ValueRef OptCAlign
| OptVolatile load Types ValueRef OptCAlign
| OptVolatile store ResolvedVal ^ "," Types ValueRef OptCAlign
| getresult Types ValueRef ^ "," EUINT64VAL
- | getelementptr Types ValueRef IndexList
+ | getelementptr OptInBounds Types ValueRef IndexList
| extractvalue Types ValueRef ^ ConstantIndexList
| insertvalue Types ValueRef ^ "," Types ValueRef ^ ConstantIndexList ;