Skip to content

Commit

Permalink
Fix asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
s-perron committed Feb 12, 2024
1 parent 4760d1f commit bbea310
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 4 additions & 2 deletions source/opt/const_folding_rules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1715,8 +1715,10 @@ BinaryScalarFoldingRule FoldBinaryIntegerOperation(uint64_t (*op)(uint64_t,
assert(result_type != nullptr && a != nullptr && b != nullptr);
const analysis::Integer* integer_type = result_type->AsInteger();
assert(integer_type != nullptr);
assert(integer_type == a->type()->AsInteger());
assert(integer_type == b->type()->AsInteger());
assert(a->type()->kind() == analysis::Type::kInteger);
assert(b->type()->kind() == analysis::Type::kInteger);
assert(integer_type->width() == a->type()->AsInteger()->width());
assert(integer_type->width() == b->type()->AsInteger()->width());

// In SPIR-V, all operations support unsigned types, but the way they
// are interpreted depends on the opcode. This is why we use the
Expand Down
2 changes: 0 additions & 2 deletions source/opt/fold_spec_constant_op_and_composite_pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ bool FoldSpecConstantOpAndCompositePass::ProcessOpSpecConstantOp(
folded_inst = FoldWithInstructionFolder(pos);
if (!folded_inst) {
folded_inst = DoComponentWiseOperation(pos);
} else {
std::cerr << inst->PrettyPrint() << "\n";
}
if (!folded_inst) return false;

Expand Down

0 comments on commit bbea310

Please sign in to comment.