[PATCH] D40808: [RISCV] Implement branch analysis

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 10 12:50:00 PST 2018


asb added inline comments.


================
Comment at: lib/Target/RISCV/RISCVInstrInfo.cpp:177
+  // Handle a single unconditional branch.
+  if (NumTerminators == 1 && I->getDesc().isUnconditionalBranch()) {
+    TBB = I->getOperand(0).getMBB();
----------------
reames wrote:
> Minor:
> if (NumTerminators == 1) {
>   if (isUnconditional()) {}
>   assert isConditional()
>   ...
> }
That's not quite equivalent, as branches can be 'conditional', 'unconditional', or 'indirect'.

Isn't the current code structure most aligned with the LLVM coding style aim of reducing indentation where possible?


Repository:
  rL LLVM

https://reviews.llvm.org/D40808





More information about the llvm-commits mailing list