JuliaHubOSS / llvm-cbe

resurrected LLVM "C Backend", with improvements
Other
838 stars 144 forks source link

Clobbers in assembly inline #184

Open r00t0s opened 11 months ago

r00t0s commented 11 months ago
define void @disasm() {
entry:
  %0 = tail call i64 asm "", "={rsp},~{dirflag},~{fpsr},~{flags}"() #0
  %1 = add i64 %0, 56
  tail call void asm "", "{rsp},~{dirflag},~{fpsr},~{flags}"(i64 %1) #0
  ret void
}

Is translated to:

void disasm(void) {
  uint64_t _1;
  uint64_t _2;

  __asm__ volatile (""
        :
        :);
  _2 = llvm_add_u64(_1, 56);
  __asm__ volatile (""
        :
        :);
}

Looks like it not add that clobbers ={rsp},~{dirflag},~{fpsr},~{flags} and dont use assembly variables