[llvm-branch-commits] [llvm] [GVN] Assign unique VNs to calls with operand bundles (PR #210335)

Nikita Popov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Jul 17 09:59:28 PDT 2026


================
@@ -0,0 +1,18 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
+; RUN: opt -S  -p gvn < %s | FileCheck %s
+
+; Check GVN does not eliminate the second call bacause of operand bundle presence.
----------------
nikic wrote:

This is not a good test. First, one of the calls is unused, and can simply be DCEd. Second, they have the *same* bundles an call-site `memory(none)`, so I believe CSE is valid as well.

Should have a test where the bundles differ, either by name or by argument. And leave this case as a TODO to improve precision (we could include the bundles in the GVN expression for calls).

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


More information about the llvm-branch-commits mailing list