This patch is to fix the issue 63045.
Look at the following code:
int main(int argc, char *argv[]) { int arr[1000]; __asm movdir64b rax, ZMMWORD PTR [arr] return 0; }
Compiling this code using clang -O0 -fasm-blocks bug.c gives the a linker error.
The problem seems to be in the generated assembly. Following is the out put of clang -S -O0 -fasm-blocks bug.c:
movq %rsi, -16(%rbp) #APP movdir64b arr, %rax #NO_APP xorl %eax, %eax
The symbol arr should be replaced with some address like -4(%rbp).
This makes me believe that issue is not in the linker, but with the ASM parser.
This issue originates with patch D145893. And that's why reverting it fixes the issue. More specifically, the function isMem512_GR64() within the llvm/lib/Target/X86/AsmParser/X86Operand.h file.
How does detecting X86::AH fix the issue?