[clang] [KeyInstr][Clang] Ret atom (PR #134652)
Jeremy Morse via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 3 04:57:29 PDT 2025
================
@@ -0,0 +1,101 @@
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -gkey-instructions -gno-column-info -x c++ %s -debug-info-kind=line-tables-only -emit-llvm -o - \
+// RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-CXX
+
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -gkey-instructions -gno-column-info -x c %s -debug-info-kind=line-tables-only -emit-llvm -o - \
+// RUN: | FileCheck %s
+
+// Check the stores to `retval` allocas and branches to `return` block are in
+// the same atom group. They are both rank 1, which could in theory introduce
+// an extra step in some optimized code. This low risk currently feels an
+// acceptable for keeping the code a bit simpler (as opposed to adding
+// scaffolding to make the store rank 2).
+
+// Also check that in the case of a single return (no control flow) the
+// return instruction inherits the atom group of the branch to the return
+// block when the blocks get folded togather.
----------------
jmorse wrote:
Could you remark on which test function this is, as I couldn't spot it. Presumably the folding happens in clang, rather than being something done by LLVM?
https://github.com/llvm/llvm-project/pull/134652
More information about the cfe-commits
mailing list