Index: test/CodeGen/X86/inline-asm.ll =================================================================== --- test/CodeGen/X86/inline-asm.ll (revision 161369) +++ test/CodeGen/X86/inline-asm.ll (working copy) @@ -1,4 +1,4 @@ -; RUN: llc < %s -march=x86 +; RUN: llc < %s -march=x86 | FileCheck %s define i32 @test1() nounwind { ; Dest is AX, dest type = i32. @@ -52,3 +52,14 @@ %0 = call { i32, i32, i32, i32, i32 } asm sideeffect "", "=&r,=&r,=&r,=&r,=&q,r,~{ecx},~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %h) nounwind ret void } + +; Check to make sure we can parse the attdialect attribute. +define void @t8() nounwind { +entry: + call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"() nounwind attdialect + ret void +; CHECK: _t8 +; CHECK: ## InlineAsm Start +; CHECK-NEXT: nop +; CHECK-NEXT: ## InlineAsm End +} Index: include/llvm/Attributes.h =================================================================== --- include/llvm/Attributes.h (revision 161369) +++ include/llvm/Attributes.h (working copy) @@ -134,6 +134,8 @@ /// often, so lazy binding isn't /// worthwhile. DECLARE_LLVM_ATTRIBUTE(AddressSafety,1ULL<<32) ///< Address safety checking is on. +DECLARE_LLVM_ATTRIBUTE(ATTDialect,1ULL<<33) ///< AT&T inline asm syntax. +DECLARE_LLVM_ATTRIBUTE(IntelDialect,1ULL<<34) ///< Intel inline asm syntax. #undef DECLARE_LLVM_ATTRIBUTE @@ -159,7 +161,8 @@ ReadOnly_i | NoInline_i | AlwaysInline_i | OptimizeForSize_i | StackProtect_i | StackProtectReq_i | NoRedZone_i | NoImplicitFloat_i | Naked_i | InlineHint_i | StackAlignment_i | - UWTable_i | NonLazyBind_i | ReturnsTwice_i | AddressSafety_i}; + UWTable_i | NonLazyBind_i | ReturnsTwice_i | AddressSafety_i | + ATTDialect_i | IntelDialect_i}; /// @brief Parameter attributes that do not apply to vararg call arguments. const AttrConst VarArgsIncompatible = {StructRet_i}; Index: utils/llvm.grm =================================================================== --- utils/llvm.grm (revision 161369) +++ utils/llvm.grm (working copy) @@ -175,6 +175,8 @@ | returns_twice | nonlazybind | address_safety + | attdialect + | inteldialect ; OptFuncAttrs ::= + _ | OptFuncAttrs FuncAttr ; Index: lib/VMCore/Attributes.cpp =================================================================== --- lib/VMCore/Attributes.cpp (revision 161369) +++ lib/VMCore/Attributes.cpp (working copy) @@ -88,6 +88,11 @@ Result += utostr(Attribute::getAlignmentFromAttrs(Attrs)); Result += " "; } + if (Attrs & Attribute::ATTDialect) + Result += "attdialect "; + if (Attrs & Attribute::IntelDialect) + Result += "inteldialect "; + // Trim the trailing space. assert(!Result.empty() && "Unknown attribute!"); Result.erase(Result.end()-1); Index: lib/AsmParser/LLParser.cpp =================================================================== --- lib/AsmParser/LLParser.cpp (revision 161369) +++ lib/AsmParser/LLParser.cpp (working copy) @@ -962,6 +962,8 @@ case lltok::kw_naked: Attrs |= Attribute::Naked; break; case lltok::kw_nonlazybind: Attrs |= Attribute::NonLazyBind; break; case lltok::kw_address_safety: Attrs |= Attribute::AddressSafety; break; + case lltok::kw_attdialect: Attrs |= Attribute::ATTDialect; break; + case lltok::kw_inteldialect: Attrs |= Attribute::IntelDialect; break; case lltok::kw_alignstack: { unsigned Alignment; Index: lib/AsmParser/LLLexer.cpp =================================================================== --- lib/AsmParser/LLLexer.cpp (revision 161369) +++ lib/AsmParser/LLLexer.cpp (working copy) @@ -553,6 +553,8 @@ KEYWORD(naked); KEYWORD(nonlazybind); KEYWORD(address_safety); + KEYWORD(attdialect); + KEYWORD(inteldialect); KEYWORD(type); KEYWORD(opaque); Index: lib/AsmParser/LLToken.h =================================================================== --- lib/AsmParser/LLToken.h (revision 161369) +++ lib/AsmParser/LLToken.h (working copy) @@ -105,6 +105,8 @@ kw_naked, kw_nonlazybind, kw_address_safety, + kw_attdialect, + kw_inteldialect, kw_type, kw_opaque,