[llvm] [Xtensa] Implement branch analysis. (PR #110959)

Andrei Safronov via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 21 10:45:15 PDT 2024


================
@@ -185,3 +185,301 @@ void XtensaInstrInfo::loadImmediate(MachineBasicBlock &MBB,
     report_fatal_error("Unsupported load immediate value");
   }
 }
+
+bool XtensaInstrInfo::reverseBranchCondition(
+    SmallVectorImpl<MachineOperand> &Cond) const {
+  assert(Cond.size() <= 4 && "Invalid branch condition!");
+
+  switch (Cond[0].getImm()) {
----------------
andreisfr wrote:

I tested most of cases for reverseBranchCondition and it seems it works correctly.

https://github.com/llvm/llvm-project/pull/110959


More information about the llvm-commits mailing list