<dt><tt>sret</tt></dt>
<dd>This indicates that the parameter specifies the address of a structure
that is the return value of the function in the source program.</dd>
+ <dt><tt>noalias</tt></dt>
+ <dd>This indicates that the parameter not alias any other object or any
+ other "noalias" objects during the function call.
<dt><tt>noreturn</tt></dt>
<dd>This function attribute indicates that the function never returns. This
indicates to LLVM that every call to this function should be treated as if
NoReturn = 1 << 2, ///< mark the function as not returning
InReg = 1 << 3, ///< force argument to be passed in register
StructRet = 1 << 4, ///< hidden pointer to structure to return
- NoUnwind = 1 << 5 ///< Function doesn't unwind stack
+ NoUnwind = 1 << 5, ///< Function doesn't unwind stack
+ NoAlias = 1 << 6 ///< Considered to not alias after call.
};
}
sret { return SRET; }
nounwind { return NOUNWIND; }
noreturn { return NORETURN; }
+noalias { return NOALIAS; }
void { RET_TY(Type::VoidTy, VOID); }
float { RET_TY(Type::FloatTy, FLOAT); }
%token <OtherOpVal> EXTRACTELEMENT INSERTELEMENT SHUFFLEVECTOR
// Function Attributes
-%token NORETURN INREG SRET NOUNWIND
+%token NORETURN INREG SRET NOUNWIND NOALIAS
// Visibility Styles
%token DEFAULT HIDDEN PROTECTED
CHECK_FOR_ERROR
};
-ParamAttr : ZEXT { $$ = ParamAttr::ZExt; }
- | SEXT { $$ = ParamAttr::SExt; }
- | INREG { $$ = ParamAttr::InReg; }
- | SRET { $$ = ParamAttr::StructRet; }
+ParamAttr : ZEXT { $$ = ParamAttr::ZExt; }
+ | SEXT { $$ = ParamAttr::SExt; }
+ | INREG { $$ = ParamAttr::InReg; }
+ | SRET { $$ = ParamAttr::StructRet; }
+ | NOALIAS { $$ = ParamAttr::NoAlias; }
;
OptParamAttrs : /* empty */ { $$ = ParamAttr::None; }
Result += "nounwind ";
if (Attrs & ParamAttr::InReg)
Result += "inreg ";
+ if (Attrs & ParamAttr::NoAlias)
+ Result += "noalias ";
if (Attrs & ParamAttr::StructRet)
Result += "sret ";
return Result;
declare i16 @"test"(i16 sext %arg) sext
declare i8 @"test2" (i16 zext %a2) zext
+declare i32 @"test3"(i32* noalias %p)
+
declare void @exit(i32) noreturn nounwind
define i32 @main(i32 %argc, i8 **%argv) nounwind inreg {
Out << " | ParamAttr::SExt";
if (attrs & ParamAttr::ZExt)
Out << " | ParamAttr::ZExt";
+ if (attrs & ParamAttr::NoAlias)
+ Out << " | ParamAttr::NoAlias";
if (attrs & ParamAttr::StructRet)
Out << " | ParamAttr::StructRet";
if (attrs & ParamAttr::InReg)