Files
clang-p2996/llvm/lib/Transforms/Utils/Local.cpp
Paul Kirth 43eafc0c4a [llvm][gvn-sink] Don't try to sink inline asm (#138414)
Fixes #138345. Before this patch, gvn-sink would try to sink inline
assembly statements. Other GVN passes avoid them (see
b4fac94181/llvm/lib/Transforms/Scalar/GVN.cpp (L2932)
Similarly, gvn-sink should skip these instructions, since they are not
safe to move. To do this, we update the early exit in
canReplaceOperandWithVariable, since it should have caught this case.
It's more efficient to also skip numbering in GVNSink if the instruction
is InlineAsm, but that should be infrequent.

The test added is reduced from a failure when compiling Fuchsia with
gvn-sink.
2025-05-05 18:16:33 -07:00

164 KiB