[PATCH] D23067: TargetInstrInfo: add two new target hooks to analyse branch offsets

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 2 14:02:50 PDT 2016


arsenm added inline comments.

================
Comment at: include/llvm/Target/TargetInstrInfo.h:491
@@ +490,3 @@
+  /// encoding, or ~0U otherwise.
+  virtual unsigned shrunkBranchOpcode(unsigned Opcode) const {
+    return ~0U;
----------------
This should return int because of the failure -1 value. 

I think the name needs work too. It's unclear to me what shrunkBranchOpcode means, especially with no context of size. Maybe something like optimizeShortBranch(MachineInstr &MI, int64_t Offset)?


https://reviews.llvm.org/D23067





More information about the llvm-commits mailing list