Skip to content

Commit

Permalink
[GlobalISel] Fix Wint-in-bool-context warning (NFC)
Browse files Browse the repository at this point in the history
GCC warning:
```
/llvm-project/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp: In member function ‘bool llvm::CombinerHelper::matchFunnelShiftToRotate(llvm::MachineInstr&)’:
/llvm-project/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:3882:35: warning: ?: using integer constants in boolean context, the expression will always evaluate to ‘true’ [-Wint-in-bool-context]
 3882 |       Opc == TargetOpcode::G_FSHL ? TargetOpcode::G_ROTL : TargetOpcode::G_ROTR;
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
  • Loading branch information
nullptr-cpp committed Mar 31, 2021
1 parent 0599870 commit 0d7fd9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
Expand Up @@ -3878,7 +3878,7 @@ bool CombinerHelper::matchFunnelShiftToRotate(MachineInstr &MI) {
Register Y = MI.getOperand(2).getReg();
if (X != Y)
return false;
bool RotateOpc =
unsigned RotateOpc =
Opc == TargetOpcode::G_FSHL ? TargetOpcode::G_ROTL : TargetOpcode::G_ROTR;
return isLegalOrBeforeLegalizer({RotateOpc, {MRI.getType(X), MRI.getType(Y)}});
}
Expand Down

0 comments on commit 0d7fd9f

Please sign in to comment.