[PATCH] D40808: [RISCV] Implement branch analysis

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 13 09:44:34 PST 2017


asb updated this revision to Diff 126774.
asb added a comment.

Remove unnecessary null-check as pointed out by @glasnak. Also add a comment which documents how the invariant that the iterator always points to a non-NULL MachineInstr is maintained. Being defensive and checking for non-null is of course generally a good thing, but the rest of the function works on the knowledge that SecondLastInst is non-null so the single check was confusing.


https://reviews.llvm.org/D40808

Files:
  lib/Target/RISCV/RISCVInstrInfo.cpp
  lib/Target/RISCV/RISCVInstrInfo.h
  test/CodeGen/RISCV/analyze-branch.ll
  test/CodeGen/RISCV/branch.ll
  test/CodeGen/RISCV/bswap-ctlz-cttz-ctpop.ll
  test/CodeGen/RISCV/jumptable.ll
  test/CodeGen/RISCV/select-cc.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40808.126774.patch
Type: text/x-patch
Size: 27296 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171213/8d991948/attachment.bin>


More information about the llvm-commits mailing list