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

Geoff Berry via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 11 12:04:35 PST 2018


gberry added reviewers: MatzeB, t.p.northover.
gberry added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp:714
+
+  // The replacement instr is profitable if it as fast as the other instrs,
+  /// but does not add more complexity.
----------------
I would suggest that unless we know of a case where this makes a difference, make the simpler change of just doing
```
return UopDif <= 0
```
at this point, assuming that has the desired effect for your target.  This assumes that with latency and uops being equal, a reduction in instructions could still be beneficial.


================
Comment at: llvm/test/CodeGen/AArch64/ldst-opt.ll:1034
 ; CHECK: stp w{{[0-9]+}}, w{{[0-9]+}}, [sp], #16
-; CHECK: ret
   %src = alloca { i32, i32 }, align 8
----------------
Are these changes intentional?


================
Comment at: llvm/test/CodeGen/AArch64/ldst-opt.ll:1343
 ; CHECK-LABEL: merge_zr32:
-; CHECK: // %entry
-; NOSTRICTALIGN-NEXT: str xzr, [x{{[0-9]+}}]
----------------
Are all of these changes needed?


================
Comment at: llvm/test/CodeGen/AArch64/machine-outliner-remarks.ll:98
 
-attributes #0 = { noredzone nounwind ssp uwtable "no-frame-pointer-elim"="false" "target-cpu"="cyclone" }
 
----------------
Are these changes needed?


================
Comment at: llvm/test/CodeGen/AArch64/stream-neon.ll:1
+; RUN: llc < %s -mtriple=aarch64-linux-gnu -mcpu=generic    -o - | FileCheck %s --check-prefixes=CHECK,GENERIC
+; RUN: llc < %s -mtriple=aarch64-linux-gnu -mcpu=cortex-a57 -o - | FileCheck %s --check-prefixes=CHECK,CORTEX
----------------
This seems like it is too large to be a lit test.  Is it really testing anything that hasn't been tested already?


Repository:
  rL LLVM

https://reviews.llvm.org/D39976





More information about the llvm-commits mailing list