OSDN Git Service

[ms-inline-asm] Use the frontend size only for ambiguous instructions
authorReid Kleckner <rnk@google.com>
Thu, 4 May 2017 18:19:52 +0000 (18:19 +0000)
committerReid Kleckner <rnk@google.com>
Thu, 4 May 2017 18:19:52 +0000 (18:19 +0000)
commit984dc047e780a687d63922dadaa8f6a0766e23be
tree342ff8140c5e34fcd3ca1c186c1bc803523780d1
parentb6a618217b942e40b4e63145cf3e72834403dd66
[ms-inline-asm] Use the frontend size only for ambiguous instructions

This avoids problems on code like this:
  char buf[16];
  __asm {
    movups xmm0, [buf]
    mov [buf], eax
  }

The frontend size in this case (1) is wrong, and the register makes the
instruction matching unambiguous. There are also enough bytes available
that we shouldn't complain to the user that they are potentially using
an incorrectly sized instruction to access the variable.

Supersedes D32636 and D26586 and fixes PR28266

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302179 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/AsmParser/X86AsmParser.cpp
lib/Target/X86/AsmParser/X86Operand.h
test/CodeGen/X86/ms-inline-asm-avx512.ll [new file with mode: 0644]