[PATCH] [TargetInstrInfo] Add new hook: AnalyzeBranchPredicate.

Ahmed Bougacha ahmed.bougacha at gmail.com
Fri Jun 12 16:23:24 PDT 2015


This seems reasonable to me, but I'll let Andy have the final say.

-Ahmed


================
Comment at: include/llvm/Target/TargetInstrInfo.h:23
@@ -22,2 +22,3 @@
 #include "llvm/Target/TargetRegisterInfo.h"
+#include "llvm/IR/Instructions.h"
 
----------------
This can go away now, right?

================
Comment at: lib/Target/X86/X86InstrInfo.cpp:3625
@@ +3624,3 @@
+
+  assert(Cond.size() == 1 && MBP.TrueDest && "expected!");
+
----------------
Why not return true if Cond.size() == 0? (i.e. the branch isn't conditional?)

================
Comment at: lib/Target/X86/X86InstrInfo.cpp:3648
@@ +3647,3 @@
+  //
+  const unsigned TestOpCode =
+    Subtarget.is64Bit() ? X86::TEST64rr : X86::TEST32rr;
----------------
OpCode -> Opcode

================
Comment at: lib/Target/X86/X86InstrInfo.h:169
@@ -168,1 +168,3 @@
 
+  bool AnalyzeBranchInner(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
+                          MachineBasicBlock *&FBB,
----------------
Inner -> Impl, perhaps?

http://reviews.llvm.org/D10200

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list