diff --git a/lib/Dialect/FIRRTL/Import/FIRParser.cpp b/lib/Dialect/FIRRTL/Import/FIRParser.cpp index 4450b503c9a4..1825d261b0d2 100644 --- a/lib/Dialect/FIRRTL/Import/FIRParser.cpp +++ b/lib/Dialect/FIRRTL/Import/FIRParser.cpp @@ -2290,13 +2290,8 @@ ParseResult FIRStmtParser::parsePrimExp(Value &result) { case FIRToken::lp_shr: // For FIRRTL versions earlier than 4.0.0, insert pad(_, 1) around any // unsigned shr This ensures the minimum width is 1 (but can be greater) - if (version < FIRVersion(4, 0, 0)) { - auto resultType = result.getType(); - if (type_isa(resultType)) { - auto pad = builder.create(result, 1); - result = pad; - } - } + if (version < FIRVersion(4, 0, 0) && type_isa(result.getType())) + result = builder.create(result, 1); break; } return success();