[PATCH] D88074: Add parentheses to eliminate warning

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


YangZhihui updated this revision to Diff 293619.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88074/new/

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,9 @@
 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.293619.patch
Type: text/x-patch
Size: 893 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200923/2dadcbd4/attachment.bin>


More information about the llvm-commits mailing list