[PATCH] D88074: Add parentheses to eliminate warning

YangZhihui via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 01:01:25 PDT 2020


YangZhihui created this revision.
YangZhihui added a reviewer: spatel.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
YangZhihui requested review of this revision.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88074

Files:
  llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp


Index: llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
===================================================================
--- llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
+++ llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
@@ -1205,8 +1205,8 @@
 static Instruction *factorizeMathWithShlOps(BinaryOperator &I,
                                             InstCombiner::BuilderTy &Builder) {
   // TODO: Also handle mul by doubling the shift amount?
-  assert(I.getOpcode() == Instruction::Add ||
-         I.getOpcode() == Instruction::Sub && "Expected add/sub");
+  assert((I.getOpcode() == Instruction::Add ||
+         I.getOpcode() == Instruction::Sub) && "Expected add/sub");
   auto *Op0 = dyn_cast<BinaryOperator>(I.getOperand(0));
   auto *Op1 = dyn_cast<BinaryOperator>(I.getOperand(1));
   if (!Op0 || !Op1 || !(Op0->hasOneUse() || Op1->hasOneUse()))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88074.293367.patch
Type: text/x-patch
Size: 882 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200922/6fd113f8/attachment.bin>


More information about the llvm-commits mailing list