[llvm] 6647f3c - [CombinerHelper] Fix gcc warning [NFC]
Mikael Holmen via llvm-commits
llvm-commits at lists.llvm.org
Wed May 10 00:09:49 PDT 2023
Author: Mikael Holmen
Date: 2023-05-10T09:08:06+02:00
New Revision: 6647f3cd01035ce35cb30a49ef79fed835ef5f6b
URL: https://github.com/llvm/llvm-project/commit/6647f3cd01035ce35cb30a49ef79fed835ef5f6b
DIFF: https://github.com/llvm/llvm-project/commit/6647f3cd01035ce35cb30a49ef79fed835ef5f6b.diff
LOG: [CombinerHelper] Fix gcc warning [NFC]
Without the fix gcc complains with
../lib/CodeGen/GlobalISel/CombinerHelper.cpp:1652:52: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
1652 | SrcDef->getOpcode() == TargetOpcode::G_OR && "Unexpected op");
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
Added:
Modified:
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
index c7636c1a6ea3a..05d473e307127 100644
--- a/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
@@ -1648,8 +1648,8 @@ bool CombinerHelper::matchCommuteShift(MachineInstr &MI, BuildFnTy &MatchInfo) {
return false;
auto *SrcDef = MRI.getVRegDef(SrcReg);
- assert(SrcDef->getOpcode() == TargetOpcode::G_ADD ||
- SrcDef->getOpcode() == TargetOpcode::G_OR && "Unexpected op");
+ assert((SrcDef->getOpcode() == TargetOpcode::G_ADD ||
+ SrcDef->getOpcode() == TargetOpcode::G_OR) && "Unexpected op");
LLT SrcTy = MRI.getType(SrcReg);
MatchInfo = [=](MachineIRBuilder &B) {
auto S1 = B.buildShl(SrcTy, X, ShiftReg);
More information about the llvm-commits
mailing list