[all-commits] [llvm/llvm-project] 43eafc: [llvm][gvn-sink] Don't try to sink inline asm (#13...

Paul Kirth via All-commits all-commits at lists.llvm.org
Mon May 5 18:16:54 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 43eafc0c4aca0b2fd159c09d4b162c1941b4f4ed
      https://github.com/llvm/llvm-project/commit/43eafc0c4aca0b2fd159c09d4b162c1941b4f4ed
  Author: Paul Kirth <paulkirth at google.com>
  Date:   2025-05-05 (Mon, 05 May 2025)

  Changed paths:
    M llvm/lib/Transforms/Utils/Local.cpp
    A llvm/test/Transforms/GVNSink/pr138345.ll

  Log Message:
  -----------
  [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
https://github.com/llvm/llvm-project/blob/b4fac94181c4cf17dbb7ecc2ae975712b0e4a6d1/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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list