[PATCH] D110691: [MSP430] Recognize Bi as an indirect branch in analyzeBranch. NFC.

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 29 02:56:06 PDT 2021


foad created this revision.
Herald added a subscriber: hiraditya.
foad requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Recognize Bi as an indirect branch, just like Br and Bm. This allows
machine verification to run after MSP430BranchSelector without failing
this assertion:

virtual bool llvm::MSP430InstrInfo::analyzeBranch(llvm::MachineBasicBlock &, llvm::MachineBasicBlock *&, llvm::MachineBasicBlock *&, SmallVectorImpl<llvm::MachineOperand> &, bool) const: Assertion `I->getOpcode() == MSP430::JCC && "Invalid conditional branch"' failed.

Note that machine verification is currently disabled after
addPreEmitPass passes because of problems on other targets, so this is
currently NFC.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110691

Files:
  llvm/lib/Target/MSP430/MSP430InstrInfo.cpp


Index: llvm/lib/Target/MSP430/MSP430InstrInfo.cpp
===================================================================
--- llvm/lib/Target/MSP430/MSP430InstrInfo.cpp
+++ llvm/lib/Target/MSP430/MSP430InstrInfo.cpp
@@ -184,7 +184,8 @@
       return true;
 
     // Cannot handle indirect branches.
-    if (I->getOpcode() == MSP430::Br ||
+    if (I->getOpcode() == MSP430::Bi ||
+        I->getOpcode() == MSP430::Br ||
         I->getOpcode() == MSP430::Bm)
       return true;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110691.375820.patch
Type: text/x-patch
Size: 479 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210929/3eff1dec/attachment.bin>


More information about the llvm-commits mailing list