Closed Quuxplusone closed 4 years ago
1590559842.jpg
1590559842.png
Created attachment 23784 tool-report-screenshot The use of if (Condition) {...} else if (Condition) {...} pattern should be avoided. (commit:23d6525cbdc9de7cbfe7640d1e9e4f25a0c5dd85) llvm/lib/CodeGen/GlobalISel.cpp: 1574 LegalizerHelper::LegalizeResult 1575 LegalizerHelper::widenScalarExtract(MachineInstr &MI, unsigned TypeIdx, 1576 LLT WideTy) { ... 1612 // Do a shift in the source type. 1613 LLT ShiftTy = SrcTy; 1614 if (WideTy.getSizeInBits() > SrcTy.getSizeInBits()) { 1615 Src = MIRBuilder.buildAnyExt(WideTy, Src); 1616 ShiftTy = WideTy; 1617 } else if (WideTy.getSizeInBits() > SrcTy.getSizeInBits()) 1618 return UnableToLegalize; 1619 1620 auto LShr = MIRBuilder.buildLShr( 1621 ShiftTy, Src, MIRBuilder.buildConstant(ShiftTy, Offset)); 1622 MIRBuilder.buildTrunc(DstReg, LShr); 1623 MI.eraseFromParent(); 1624 return Legalized; 1625 } ... 1651 } Reported by: Ustchcs Toolsets Bugfinder (bugfinder-2.2: The use of if (Condition) {...} else if (Condition) {...} pattern should be avoided.)
Attached 1590559842.jpg (150612 bytes, image/jpeg): tool-report-screenshot
Attached 1590559842.png (150612 bytes, image/png): tool report screenshot
Fixed in 90b76dac57861e438880a260834afb193e603c5a
1590559842.jpg
(150612 bytes, image/jpeg)1590559842.png
(150612 bytes, image/png)