Skip to content

Commit

Permalink
Automated Code Change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 623048936
  • Loading branch information
XLS Team authored and copybara-github committed Apr 9, 2024
1 parent 3af76fc commit e1b64b2
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
4 changes: 0 additions & 4 deletions xls/passes/basic_simplification_pass_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ constexpr absl::Duration kProverTimeout = absl::Seconds(10);

using status_testing::IsOkAndHolds;
using ::xls::solvers::z3::ScopedVerifyEquivalence;
using ::xls::solvers::z3::TryProveEquivalence;

using ::testing::_;
using ::testing::AllOf;

class BasicSimplificationPassTest : public IrTestBase {
protected:
Expand Down
3 changes: 1 addition & 2 deletions xls/passes/boolean_simplification_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,8 @@ bool TruthTable::MatchesSymmetrical(
}
if (xyz_negated_.GetFromMsb(i)) {
return IsNotOf(original, operands[i]);
} else {
return original == operands[i];
}
return original == operands[i];
}
LOG(FATAL) << "Unreachable.";
}
Expand Down
3 changes: 2 additions & 1 deletion xls/passes/select_simplification_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ BitSource GetBitSource(Node* node, int64_t bit_index,
return GetBitSource(node->operand(0),
bit_index + node->As<BitSlice>()->start(),
query_engine);
} else if (node->Is<Concat>()) {
}
if (node->Is<Concat>()) {
int64_t offset = 0;
for (int64_t i = node->operand_count() - 1; i >= 0; --i) {
Node* operand = node->operand(i);
Expand Down
2 changes: 1 addition & 1 deletion xls/passes/strength_reduction_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ absl::StatusOr<bool> StrengthReduceNode(
// If we know the MSb of the operand is zero, strength reduce from signext to
// zeroext.
if (node->op() == Op::kSignExt && query_engine.IsMsbKnown(node->operand(0)) &&
query_engine.GetKnownMsb(node->operand(0)) == 0) {
static_cast<int>(query_engine.GetKnownMsb(node->operand(0))) == 0) {
XLS_RETURN_IF_ERROR(
node->ReplaceUsesWithNew<ExtendOp>(node->operand(0),
node->BitCountOrDie(), Op::kZeroExt)
Expand Down
3 changes: 2 additions & 1 deletion xls/passes/table_switch_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ static std::optional<Uint64Comparison> MatchCompareEqAgainstUint64(Node* node) {
node->operand(1),
node->operand(0)->As<Literal>()->value().bits().ToUint64().value(),
node->op()};
} else if (is_uint64_literal(node->operand(1))) {
}
if (is_uint64_literal(node->operand(1))) {
// Literal is the rhs.
return Uint64Comparison{
node->operand(0),
Expand Down

0 comments on commit e1b64b2

Please sign in to comment.