Skip to content

Commit 1ef1175

Browse files
authored
[SPIRV] Fix code quality issues. (#160752)
Address issues reported by a static analysis tool.
1 parent 617854f commit 1ef1175

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,8 @@ bool SPIRVLegalizerInfo::legalizeIsFPClass(
587587
}
588588

589589
if (FPClassTest PartialCheck = Mask & fcNan) {
590-
auto InfWithQnanBitC = buildSPIRVConstant(IntTy, Inf | QNaNBitMask);
590+
auto InfWithQnanBitC =
591+
buildSPIRVConstant(IntTy, std::move(Inf) | QNaNBitMask);
591592
if (PartialCheck == fcNan) {
592593
// isnan(V) ==> abs(V) u> int(inf)
593594
appendToRes(
@@ -613,7 +614,7 @@ bool SPIRVLegalizerInfo::legalizeIsFPClass(
613614
APInt ExpLSB = ExpMask & ~(ExpMask.shl(1));
614615
auto ExpMinusOne = assignSPIRVTy(
615616
MIRBuilder.buildSub(IntTy, Abs, buildSPIRVConstant(IntTy, ExpLSB)));
616-
APInt MaxExpMinusOne = ExpMask - ExpLSB;
617+
APInt MaxExpMinusOne = std::move(ExpMask) - ExpLSB;
617618
auto NormalRes = assignSPIRVTy(
618619
MIRBuilder.buildICmp(CmpInst::Predicate::ICMP_ULT, DstTy, ExpMinusOne,
619620
buildSPIRVConstant(IntTy, MaxExpMinusOne)));

0 commit comments

Comments
 (0)