[PATCH] D149586: [Coverity] Fix unchecked return value, NFC
Phoebe Wang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 1 19:23:52 PDT 2023
pengfei updated this revision to Diff 518622.
pengfei marked an inline comment as done.
pengfei added a comment.
Address review comment.
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.518622.patch
Type: text/x-patch
Size: 837 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230502/cbf62fa3/attachment.bin>
More information about the llvm-commits
mailing list