[llvm] [llvm][gvn-sink] Don't try to sink inline asm (PR #138414)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat May 3 10:08:19 PDT 2025


================
@@ -0,0 +1,51 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
+; REQUIRES: x86-registered-target
+; RUN:  opt -passes="gvn-sink" -S %s | FileCheck %s
+; RUN:  opt -passes="gvn-sink,correlated-propagation" -S %s | FileCheck %s
+
+;; See https://github.com/llvm/llvm-project/issues/138345 for details.
+;; The program below used to crash due to taking the address of the inline asm.
+;; gvn-sink shouldn't do anything in this case, so test that the pass no longer
+;; generates invalid IR and no longer crashes.
+
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
----------------
nikic wrote:

The triple shouldn't be necessary to reproduce this, and then you can also drop the REQUIRES.

https://github.com/llvm/llvm-project/pull/138414


More information about the llvm-commits mailing list