aboutsummaryrefslogtreecommitdiff
path: root/backend/lib/CodeGen/LiveVariables.cpp
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-28 23:59:37 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-28 23:59:37 +0800
commit2623df180b9e86512fe69b8f90563fbd8add89c3 (patch)
treec4afb7c9500d5c4789dcc0eaa81e2c11c9341aa9 /backend/lib/CodeGen/LiveVariables.cpp
parent7ee5d1913c7cfd0261f86b0ff7be6968b8c07d84 (diff)
downloadrcc-project-2623df180b9e86512fe69b8f90563fbd8add89c3.tar.gz
rcc-project-2623df180b9e86512fe69b8f90563fbd8add89c3.tar.xz
[CodeGen] Complete LaneMask bitwise operations
Diffstat (limited to 'backend/lib/CodeGen/LiveVariables.cpp')
-rw-r--r--backend/lib/CodeGen/LiveVariables.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/backend/lib/CodeGen/LiveVariables.cpp b/backend/lib/CodeGen/LiveVariables.cpp
index 5efdbd4..4f65f72 100644
--- a/backend/lib/CodeGen/LiveVariables.cpp
+++ b/backend/lib/CodeGen/LiveVariables.cpp
@@ -33,10 +33,6 @@
namespace rcc {
namespace {
-[[nodiscard]] LaneMask subtractLanes(LaneMask Left, LaneMask Right) noexcept {
- return LaneMask::fromRaw(Left.rawValue() & ~Right.rawValue());
-}
-
template <typename KeyT>
void addLanes(std::unordered_map<KeyT, LaneMask> &Values, KeyT Key, LaneMask Lanes) {
if (Lanes.empty())
@@ -46,7 +42,7 @@ void addLanes(std::unordered_map<KeyT, LaneMask> &Values, KeyT Key, LaneMask Lan
Values.emplace(Key, Lanes);
return;
}
- Position->second = Position->second | Lanes;
+ Position->second |= Lanes;
}
template <typename KeyT>
@@ -54,7 +50,7 @@ void removeLanes(std::unordered_map<KeyT, LaneMask> &Values, KeyT Key, LaneMask
const auto Position = Values.find(Key);
if (Position == Values.end() || Lanes.empty())
return;
- Position->second = subtractLanes(Position->second, Lanes);
+ Position->second &= ~Lanes;
if (Position->second.empty())
Values.erase(Position);
}