summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/shader_recompiler/frontend/ir/microinstruction.cpp4
-rw-r--r--src/shader_recompiler/frontend/ir/value.h7
2 files changed, 7 insertions, 4 deletions
diff --git a/src/shader_recompiler/frontend/ir/microinstruction.cpp b/src/shader_recompiler/frontend/ir/microinstruction.cpp
index 701746a0c..e3350931b 100644
--- a/src/shader_recompiler/frontend/ir/microinstruction.cpp
+++ b/src/shader_recompiler/frontend/ir/microinstruction.cpp
@@ -279,8 +279,10 @@ void Inst::ClearArgs() {
279 if (!value.IsImmediate()) { 279 if (!value.IsImmediate()) {
280 UndoUse(value); 280 UndoUse(value);
281 } 281 }
282 value = {};
283 } 282 }
283 // Reset arguments to null
284 // std::memset was measured to be faster on MSVC than std::ranges:fill
285 std::memset(&args, 0, sizeof(args));
284 } 286 }
285} 287}
286 288
diff --git a/src/shader_recompiler/frontend/ir/value.h b/src/shader_recompiler/frontend/ir/value.h
index 5425e42a1..7b20824ed 100644
--- a/src/shader_recompiler/frontend/ir/value.h
+++ b/src/shader_recompiler/frontend/ir/value.h
@@ -34,7 +34,7 @@ struct AssociatedInsts;
34 34
35class Value { 35class Value {
36public: 36public:
37 Value() noexcept : type{IR::Type::Void}, inst{nullptr} {} 37 Value() noexcept = default;
38 explicit Value(IR::Inst* value) noexcept; 38 explicit Value(IR::Inst* value) noexcept;
39 explicit Value(IR::Block* value) noexcept; 39 explicit Value(IR::Block* value) noexcept;
40 explicit Value(IR::Reg value) noexcept; 40 explicit Value(IR::Reg value) noexcept;
@@ -78,9 +78,9 @@ public:
78private: 78private:
79 void ValidateAccess(IR::Type expected) const; 79 void ValidateAccess(IR::Type expected) const;
80 80
81 IR::Type type; 81 IR::Type type{};
82 union { 82 union {
83 IR::Inst* inst; 83 IR::Inst* inst{};
84 IR::Block* label; 84 IR::Block* label;
85 IR::Reg reg; 85 IR::Reg reg;
86 IR::Pred pred; 86 IR::Pred pred;
@@ -95,6 +95,7 @@ private:
95 f64 imm_f64; 95 f64 imm_f64;
96 }; 96 };
97}; 97};
98static_assert(static_cast<u32>(IR::Type::Void) == 0, "memset relies on IR::Type being zero");
98static_assert(std::is_trivially_copyable_v<Value>); 99static_assert(std::is_trivially_copyable_v<Value>);
99 100
100template <IR::Type type_> 101template <IR::Type type_>