[PATCH] D39976: [AArch64] Consider the cost model when folding loads and stores

Evandro Menezes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 6 13:23:52 PST 2017


evandro added a subscriber: apinski-cavium.
evandro marked an inline comment as done.
evandro added a comment.

@kristof.beyls, @mcrosier, @apinski-cavium?



================
Comment at: llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp:691
+  long UopN = SCN->NumMicroOps,
+       UopA = TSM.getNumMicroOps(&MIA, SCA),
+       UopB = TSM.getNumMicroOps(&MIB, SCB);
----------------
junbuml wrote:
> Isn't it possible to do just TSM.getNumMicroOps(&MIA)   and remove  above  *SCA = TSM.resolveSchedClass(&MIA) in line 678.
Yes, it is.


================
Comment at: llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp:707
+  else if (UopA <= 1 && UopB <= 1) {
+    if (LatDif < -UopDif) {
+      DEBUG(dbgs() << "Evaluating instructions: replacement is faster "
----------------
junbuml wrote:
> I'm not sure if it's okay to compare values from  computeInstrLatency() and getNumMicroOps() ? 
That's what the heuristic does, as briefly explained in the debug message below.


Repository:
  rL LLVM

https://reviews.llvm.org/D39976





More information about the llvm-commits mailing list