I think perhaps we want to make this LLVM IR asm string:
call void asm sideeffect inteldialect "mov eax, $0", "i,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* @"?Bar@@3HA") #1, !srcloc !3
The key thing is the 'i' constraint. That ends up producing the wrong assembly right now, but maybe with your rebased patch, now it will do the right thing.
If you change up the dialect and switch to an ELF triple, this inline asm will produce the expected instruction sequence:
call void asm sideeffect "movl $0, %eax", "i,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* @"?Bar@@3HA") #1, !srcloc !3
Which is what makes me think this is the way to go.
It's consistent with the AOK_Skip rewrite we do today to skip the "offset" text.