[llvm] 1ef1175 - [SPIRV] Fix code quality issues. (#160752)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 29 08:57:56 PDT 2025
Author: Marcos Maronas
Date: 2025-09-29T15:57:52Z
New Revision: 1ef1175b309804b3ce8ee91ee72a3498f9a9a115
URL: https://github.com/llvm/llvm-project/commit/1ef1175b309804b3ce8ee91ee72a3498f9a9a115
DIFF: https://github.com/llvm/llvm-project/commit/1ef1175b309804b3ce8ee91ee72a3498f9a9a115.diff
LOG: [SPIRV] Fix code quality issues. (#160752)
Address issues reported by a static analysis tool.
Added:
Modified:
llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.cpp b/llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.cpp
index b4fc8dabbd4df..db85e33a3c6c7 100644
--- a/llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.cpp
@@ -587,7 +587,8 @@ bool SPIRVLegalizerInfo::legalizeIsFPClass(
}
if (FPClassTest PartialCheck = Mask & fcNan) {
- auto InfWithQnanBitC = buildSPIRVConstant(IntTy, Inf | QNaNBitMask);
+ auto InfWithQnanBitC =
+ buildSPIRVConstant(IntTy, std::move(Inf) | QNaNBitMask);
if (PartialCheck == fcNan) {
// isnan(V) ==> abs(V) u> int(inf)
appendToRes(
@@ -613,7 +614,7 @@ bool SPIRVLegalizerInfo::legalizeIsFPClass(
APInt ExpLSB = ExpMask & ~(ExpMask.shl(1));
auto ExpMinusOne = assignSPIRVTy(
MIRBuilder.buildSub(IntTy, Abs, buildSPIRVConstant(IntTy, ExpLSB)));
- APInt MaxExpMinusOne = ExpMask - ExpLSB;
+ APInt MaxExpMinusOne = std::move(ExpMask) - ExpLSB;
auto NormalRes = assignSPIRVTy(
MIRBuilder.buildICmp(CmpInst::Predicate::ICMP_ULT, DstTy, ExpMinusOne,
buildSPIRVConstant(IntTy, MaxExpMinusOne)));
More information about the llvm-commits
mailing list