Don't use a random type for the select condition,
[oota-llvm.git] / utils / llvm.grm
index 8a2ce0dfb5364e66add9158d7b5a0ba6f8341306..9f7588ae2821bbdb7a536a5e9de0082d1c65ceb2 100644 (file)
@@ -123,6 +123,7 @@ OptCallingConv ::= + _ |
                  coldcc |
                  "x86_stdcallcc" |
                  "x86_fastcallcc" |
+                 "x86_ssecallcc" |
                  cc EUINT64VAL ;
 
 ParamAttr ::= zeroext
@@ -149,6 +150,19 @@ FuncAttr      ::= noreturn
 
 OptFuncAttrs  ::= + _ | OptFuncAttrs FuncAttr ;
 
+FuncNoteList  ::= FuncNote
+              | FuncNoteList ^ "," FuncNote
+              ;
+
+FuncNote      ::= inline ^ "=" ^ never
+              | inline ^ "=" ^ always
+              | "opt_size"
+              ;
+
+OptFuncNotes  ::= _
+              | notes ^ "(" ^ FuncNoteList ^ ")"
+              ;
+
 OptGC         ::= + _ | gc STRINGCONSTANT ;
 
 OptAlign      ::= + _ | align EUINT64VAL ;
@@ -175,9 +189,9 @@ Types
  | "[" ^ EUINT64VAL "x" Types ^ "]"
  | "<" ^ EUINT64VAL "x" Types ^ ">"
  | "{" TypeListI "}"
- | "{" "}"
+ | "{" "}"
  | "<" ^ "{" TypeListI "}" ^ ">"
- | "<" ^ "{" "}" ^ ">"
+ | "<" ^ "{" "}" ^ ">"
  ;
 
 ArgType ::= Types OptParamAttrs ;
@@ -191,13 +205,13 @@ ArgTypeListI ::= ArgTypeList | ArgTypeList ^ "," "..." | "..." | _ ;
 TypeListI ::= Types | TypeListI ^ "," Types ;
 
 ConstVal::= Types "[" ^ ConstVector ^ "]"
- | Types "[" "]"
+ | Types "[" "]"
  | Types "c" ^ STRINGCONSTANT
  | Types "<" ^ ConstVector ^ ">"
  | Types "{" ConstVector "}"
- | Types "{" "}"
+ | Types "{" "}"
  | Types "<" ^ "{" ConstVector "}" ^ ">"
- | Types "<" ^ "{" "}" ^ ">"
+ | Types "<" ^ "{" "}" ^ ">"
  | Types null
  | Types undef
  | Types SymbolicValueRef
@@ -222,7 +236,9 @@ ConstExpr::= CastOps "(" ^ ConstVal to Types ^ ")"
  | vfcmp FPredicates "(" ^ ConstVal ^ "," ConstVal ^ ")"
  | extractelement "(" ^ ConstVal ^ "," ConstVal ^ ")"
  | insertelement "(" ^ ConstVal ^ "," ConstVal ^ "," ConstVal ^ ")"
- | shufflevector "(" ^ ConstVal ^ "," ConstVal ^ "," ConstVal ^ ")" ;
+ | shufflevector "(" ^ ConstVal ^ "," ConstVal ^ "," ConstVal ^ ")"
+ | extractvalue "(" ^ ConstVal ^ ConstantIndexList ^ ")"
+ | insertvalue "(" ^ ConstVal ^ "," ConstVal ^ ConstantIndexList ^ ")" ;
 
 ConstVector ::= ConstVector ^ "," ConstVal | ConstVal ;
 
@@ -269,7 +285,7 @@ ArgListH ::= ArgListH ^ "," Types OptParamAttrs OptLocalName
 ArgList ::= ArgListH | ArgListH ^ "," "..." | "..." | _ ;
 
 FunctionHeaderH ::= OptCallingConv ResultTypes GlobalName "(" ^ ArgList ^ ")"
-                  OptFuncAttrs OptSection OptAlign OptGC ;
+                  OptFuncAttrs OptSection OptAlign OptGC OptFuncNotes ;
 
 BEGIN ::= ( begin | "{" ) ^ "\n";
 
@@ -293,6 +309,13 @@ ConstValueRef ::= ESINT64VAL
  | undef
  | zeroinitializer
  | "<" ConstVector ">"
+ | "[" ConstVector "]"
+ | "[" ^ "]"
+ | "c" ^ STRINGCONSTANT
+ | "{" ConstVector "}"
+ | "{" ^ "}"
+ | "<" ^ "{" ConstVector "}" ^ ">"
+ | "<" ^ "{" ^ "}" ^ ">"
  | ConstExpr
  | asm OptSideEffect STRINGCONSTANT ^ "," STRINGCONSTANT ;
 
@@ -321,8 +344,9 @@ BBTerminatorInst ::= ^ "  " ^
  | br label ValueRef
  | br INTTYPE ValueRef ^ "," label ValueRef ^ "," label ValueRef
  | switch IntType ValueRef ^ "," label ValueRef "[" JumpTable "]"
- | switch IntType ValueRef ^ "," label ValueRef "[" "]"
- | invoke OptCallingConv ResultTypes ValueRef "(" ^ ParamList ^ ")" OptFuncAttrs
+ | switch IntType ValueRef ^ "," label ValueRef "[" ^ "]"
+ | invoke OptCallingConv ResultTypes ValueRef ^ "(" ^ ParamList ^ ")"
+   OptFuncAttrs
    to label ValueRef unwind label ValueRef
  | unwind
  | unreachable ) ^ "\n";
@@ -343,6 +367,8 @@ ParamList ::= Types OptParamAttrs ValueRef OptParamAttrs
 
 IndexList ::= _ | IndexList ^ "," ResolvedVal ;
 
+ConstantIndexList ::= "," EUINT64VAL | ConstantIndexList ^ "," EUINT64VAL ;
+
 OptTailCall ::= tail call | call ;
 
 InstVal ::=
@@ -354,12 +380,12 @@ InstVal ::=
  | vfcmp FPredicates Types ValueRef ^ "," ValueRef
  | CastOps ResolvedVal to Types
  | select ResolvedVal ^ "," ResolvedVal ^ "," ResolvedVal
- | vaarg ResolvedVal ^ "," Types
+ | "va_arg" ResolvedVal ^ "," Types
  | extractelement ResolvedVal ^ "," ResolvedVal
  | insertelement ResolvedVal ^ "," ResolvedVal ^ "," ResolvedVal
  | shufflevector ResolvedVal ^ "," ResolvedVal ^ "," ResolvedVal
  | phi PHIList
- | OptTailCall OptCallingConv ResultTypes ValueRef "(" ^ ParamList ^ ")"
+ | OptTailCall OptCallingConv ResultTypes ValueRef "(" ^ ParamList ^ ")"
    OptFuncAttrs
  | MemoryInst ;
 
@@ -373,4 +399,6 @@ MemoryInst ::= malloc Types OptCAlign
  | OptVolatile load Types ValueRef OptCAlign
  | OptVolatile store ResolvedVal ^ "," Types ValueRef OptCAlign
  | getresult Types ValueRef ^ "," EUINT64VAL
- | getelementptr Types ValueRef IndexList ;
+ | getelementptr Types ValueRef IndexList
+ | extractvalue Types ValueRef ^ ConstantIndexList 
+ | insertvalue Types ValueRef ^ "," Types ValueRef ^ ConstantIndexList ;