rnk added a comment. Won't the mid-level optimizer turn these register variables into undefs, and we'll end up with this kind of IR?
void f() { int register var asm ("eax") ; asm volatile ("add %%eax, %0\n\tret" : : "r"(var)); } -> define void @"\01?f@@YAXXZ"() local_unnamed_addr #0 { entry: tail call void asm sideeffect "add %eax, $0\0A\09ret", "{eax},~{dirflag},~{fpsr},~{flags}"(i32 undef) #1, !srcloc !2 ret void } I guess it's OK so long as we don't codegen undef to anything, but it could go badly. https://reviews.llvm.org/D24193 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits