[PATCH] D40808: [RISCV] Implement branch analysis
Alex Bradbury via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 4 14:38:04 PST 2017
asb created this revision.
Herald added subscribers: jordy.potman.lists, simoncook, johnrusso, rbar, kristof.beyls, aemerson.
This is a prerequisite for the branch relaxation pass, and allows a number of optimisation passes (e.g. BranchFolding and MachineBlockPlacement) to work.
Unfortunately it can only be tested somewhat indirectly (by checking machineblockplacement for instance). It would be helpful to have the ability to print the output of branch analysis to allow tests to be written directly against that.
analyzeBranch is adapted directly from the AArch64 implementation. The main difference is I check properties of the MCInstrDesc rather than introducing helper functions like isCondBranchOpcode and isUncondBranchOpcode which ducplicate information already specified in RISCVInstrInfo.td.
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.125421.patch
Type: text/x-patch
Size: 27067 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171204/c639f65f/attachment.bin>
More information about the llvm-commits
mailing list