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

Sanjoy Das sanjoy at playingwithpointers.com
Fri Jun 12 18:14:06 PDT 2015


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

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

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

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

http://reviews.llvm.org/D10200

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






More information about the llvm-commits mailing list