Index: llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp =================================================================== --- llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp +++ llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp @@ -372,6 +372,12 @@ unsigned Reg = MO.getReg(); bool EmitPercent = true; + if (!X86::GR8RegClass.contains(Reg) && + !X86::GR16RegClass.contains(Reg) && + !X86::GR32RegClass.contains(Reg) && + !X86::GR64RegClass.contains(Reg)) + return true; + switch (Mode) { default: return true; // Unknown mode. case 'b': // Print QImode register Index: llvm/trunk/test/CodeGen/X86/inline-asm-bad-modifier.ll =================================================================== --- llvm/trunk/test/CodeGen/X86/inline-asm-bad-modifier.ll +++ llvm/trunk/test/CodeGen/X86/inline-asm-bad-modifier.ll @@ -0,0 +1,8 @@ +; RUN: not llc -mtriple=x86_64-- < %s 2>&1 | FileCheck %s + +;CHECK: error: invalid operand in inline asm: 'vmovd ${1:x}, $0' +define i32 @foo() { +entry: + %0 = tail call i32 asm sideeffect "vmovd ${1:x}, $0", "=r,x,~{dirflag},~{fpsr},~{flags}"(<2 x i64> ) + ret i32 %0 +}