[all-commits] [llvm/llvm-project] 170ab2: [llvm][gvn-sink] Don't try to sink inline asm

Paul Kirth via All-commits all-commits at lists.llvm.org
Mon May 5 11:04:35 PDT 2025


  Branch: refs/heads/users/ilovepi/gvn-sink-bug
  Home:   https://github.com/llvm/llvm-project
  Commit: 170ab2924b1f11357a1f92179aa55cee9286d290
      https://github.com/llvm/llvm-project/commit/170ab2924b1f11357a1f92179aa55cee9286d290
  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

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