aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorEli Friedman <efriedma@quicinc.com>2025-02-25 15:29:12 -0800
committerGitHub <noreply@github.com>2025-02-25 15:29:12 -0800
commit1b39328d7440aa7a94af4083257ef1c2f9394887 (patch)
tree12c96248d8b7b1714952ae40bbfe3fc217e9b365 /clang/lib/CodeGen/CodeGenModule.cpp
parentfc655b1ae78305ad0839c0311f72607775af0c73 (diff)
downloadllvm-1b39328d7440aa7a94af4083257ef1c2f9394887.zip
llvm-1b39328d7440aa7a94af4083257ef1c2f9394887.tar.gz
llvm-1b39328d7440aa7a94af4083257ef1c2f9394887.tar.bz2
[CodeGen] Fix MachineInstr::isSafeToMove handling of inline asm. (#126807)
Even if an inline asm doesn't have memory effects, we can't assume it's safe to speculate: it could trap, or cause undefined behavior. At the LLVM IR level, this is handled correctly: we don't speculate inline asm (unless it's marked "speculatable", but I don't think anyone does that). Codegen also needs to respect this restriction. This change stops Early If Conversion and similar passes from speculating an INLINEASM MachineInstr. Some uses of isSafeToMove probably could be switched to a different API: isSafeToMove assumes you're hoisting, but we could handle some forms of sinking more aggressively. But I'll leave that for a followup, if it turns out to be relevant. See also discussion on gcc bugtracker https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102150 .
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions