summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/ir_opt
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_recompiler/ir_opt')
-rw-r--r--src/shader_recompiler/ir_opt/constant_propagation_pass.cpp22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp b/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp
index 12159e738..052f1609b 100644
--- a/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp
+++ b/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp
@@ -355,17 +355,6 @@ void FoldBranchConditional(IR::Inst& inst) {
}
}
-void FoldConstantComposite(IR::Inst& inst, size_t amount = 2) {
- for (size_t i = 0; i < amount; i++) {
- if (!inst.Arg(i).IsConstantContainer()) {
- return;
- }
- }
- auto info{inst.Flags<IR::CompositeDecoration>()};
- info.is_constant = true;
- inst.SetFlags(info);
-}
-
void ConstantPropagation(IR::Block& block, IR::Inst& inst) {
switch (inst.Opcode()) {
case IR::Opcode::GetRegister:
@@ -391,13 +380,6 @@ void ConstantPropagation(IR::Block& block, IR::Inst& inst) {
case IR::Opcode::SelectF32:
case IR::Opcode::SelectF64:
return FoldSelect(inst);
- case IR::Opcode::CompositeConstructU32x2:
- case IR::Opcode::CompositeConstructF16x2:
- case IR::Opcode::CompositeConstructF32x2:
- case IR::Opcode::CompositeConstructF64x2:
- return FoldConstantComposite(inst, 2);
- case IR::Opcode::CompositeConstructArrayU32x2:
- return FoldConstantComposite(inst, 4);
case IR::Opcode::FPMul32:
return FoldFPMul32(inst);
case IR::Opcode::LogicalAnd:
@@ -423,12 +405,12 @@ void ConstantPropagation(IR::Block& block, IR::Inst& inst) {
return;
case IR::Opcode::BitFieldSExtract:
FoldWhenAllImmediates(inst, [](s32 base, u32 shift, u32 count) {
- const size_t back_shift = static_cast<size_t>(shift) + static_cast<size_t>(count);
+ const size_t back_shift{static_cast<size_t>(shift) + static_cast<size_t>(count)};
if (back_shift > Common::BitSize<s32>()) {
throw LogicError("Undefined result in {}({}, {}, {})", IR::Opcode::BitFieldSExtract,
base, shift, count);
}
- const size_t left_shift = Common::BitSize<s32>() - back_shift;
+ const size_t left_shift{Common::BitSize<s32>() - back_shift};
return static_cast<u32>(static_cast<s32>(base << left_shift) >>
static_cast<size_t>(Common::BitSize<s32>() - count));
});