[PATCH] D120428: [AArch64] Optimize safe integer division

Karl Meakin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 24 02:25:08 PST 2022


Kmeakin added a comment.

In D120428#3342432 <https://reviews.llvm.org/D120428#3342432>, @dmgreen wrote:

> Is this a part of AArch64MIPeepholeOpt because it relies upon DIV being ifcvt'd?

Yes, exactly



================
Comment at: llvm/lib/Target/AArch64/AArch64MIPeepholeOpt.cpp:473
 
+  LLVM_DEBUG(dbgs() << "********** AArch64 Peephole Optimizer **********\n"
+                    << "********** Function: " << MF.getName() << '\n');
----------------
dmgreen wrote:
> I don't tend to find these very useful. Does it need to be added?
Not strictly necessary, I only added it because I noticed other passes also printed the same header. 


================
Comment at: llvm/test/CodeGen/AArch64/checked-int-div.ll:2
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=aarch64-gnu-linux -mcpu=neoversen1 -o - | FileCheck %s
+
----------------
dmgreen wrote:
> neoversen1 isn't a valid cpu. Does this not work in other cases due to the costs of div being too high to ifcvt?
`llc -mcpu=help --mtriple=aarch64--` lists `neoversen1` as an option. Any out of order CPU should do (the cost model defaults to in order, which results in div not being ifcvted)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120428/new/

https://reviews.llvm.org/D120428



More information about the llvm-commits mailing list