[llvm] [GlobalISel] Add known bits calculation for atomic G_LOAD (PR #222870)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 11 03:20:14 PDT 2026
================
@@ -708,7 +708,23 @@ void GISelValueTracking::computeKnownBitsImpl(Register R, KnownBits &Known,
KnownBits KnownRange(MMO->getMemoryType().getScalarSizeInBits());
if (const MDNode *Ranges = MMO->getRanges())
computeKnownBitsFromRangeMetadata(*Ranges, KnownRange);
- Known = KnownRange.anyext(Known.getBitWidth());
+
+ if (MMO->isAtomic()) {
+ switch (TL.getExtendForAtomicOps()) {
----------------
arsenm wrote:
This is a broken DAG-ism we shouldn't port over. The extension type should be known from the opcode, not assumed based on the target. Unlike selection dag, where there unfortunately are separate atomic load and store opcodes, here we have opcodes with the extension in the name and atomicity in the MMO.
https://github.com/llvm/llvm-project/pull/222870
More information about the llvm-commits
mailing list