[PATCH] D149586: [Coverity] Fix unchecked return value, NFC

Phoebe Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 1 22:43:56 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGc2dd36cd398a: [Coverity] Fix unchecked return value, NFC (authored by pengfei).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149586

Files:
  llvm/lib/CodeGen/EarlyIfConversion.cpp


Index: llvm/lib/CodeGen/EarlyIfConversion.cpp
===================================================================
--- llvm/lib/CodeGen/EarlyIfConversion.cpp
+++ llvm/lib/CodeGen/EarlyIfConversion.cpp
@@ -343,8 +343,11 @@
 // Apply predicate to all instructions in the machine block.
 void SSAIfConv::PredicateBlock(MachineBasicBlock *MBB, bool ReversePredicate) {
   auto Condition = Cond;
-  if (ReversePredicate)
-    TII->reverseBranchCondition(Condition);
+  if (ReversePredicate) {
+    bool CanRevCond = !TII->reverseBranchCondition(Condition);
+    assert(CanRevCond && "Reversed predicate is not supported");
+    (void)CanRevCond;
+  }
   // Terminators don't need to be predicated as they will be removed.
   for (MachineBasicBlock::iterator I = MBB->begin(),
                                    E = MBB->getFirstTerminator();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149586.518636.patch
Type: text/x-patch
Size: 837 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230502/1e52a9e7/attachment.bin>


More information about the llvm-commits mailing list