@@ -2466,7 +2466,7 @@ FoldingRule RedundantFDiv() {
24662466}
24672467
24682468FoldingRule RedundantFMod () {
2469- return [](IRContext* context , Instruction* inst,
2469+ return [](IRContext*, Instruction* inst,
24702470 const std::vector<const analysis::Constant*>& constants) {
24712471 assert (inst->opcode () == spv::Op::OpFMod &&
24722472 " Wrong opcode. Should be OpFMod." );
@@ -2477,7 +2477,6 @@ FoldingRule RedundantFMod() {
24772477 }
24782478
24792479 FloatConstantKind kind0 = getFloatConstantKind (constants[0 ]);
2480- FloatConstantKind kind1 = getFloatConstantKind (constants[1 ]);
24812480
24822481 if (kind0 == FloatConstantKind::Zero) {
24832482 inst->SetOpcode (spv::Op::OpCopyObject);
@@ -2486,19 +2485,6 @@ FoldingRule RedundantFMod() {
24862485 return true ;
24872486 }
24882487
2489- if (kind1 == FloatConstantKind::One) {
2490- auto type = context->get_type_mgr ()->GetType (inst->type_id ());
2491- std::vector<uint32_t > zero_words;
2492- zero_words.resize (ElementWidth (type) / 32 );
2493- auto const_mgr = context->get_constant_mgr ();
2494- auto zero = const_mgr->GetConstant (type, std::move (zero_words));
2495- auto zero_id = const_mgr->GetDefiningInstruction (zero)->result_id ();
2496-
2497- inst->SetOpcode (spv::Op::OpCopyObject);
2498- inst->SetInOperands ({{SPV_OPERAND_TYPE_ID, {zero_id}}});
2499- return true ;
2500- }
2501-
25022488 return false ;
25032489 };
25042490}
0 commit comments