[PATCH] D28875: AArch64LoadStoreOptimizer: Update kill flags when merging stores

Jun Bum Lim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 19 08:49:22 PST 2017


junbuml added inline comments.


================
Comment at: lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp:695
+    if (!MergeForward) {
+      // Clear kill flags on store if moving upwards. Example:
+      //   STRWui %w0, ...
----------------
As far as I see, only store pair seem to be the issue, but just want to confirm if there is any case for load pair  ? 


================
Comment at: lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp:697
+      //   STRWui %w0, ...
+      //   USE %w1
+      //   STRWui kill %w1  ; need to clear kill flag when moving STRWui upwards
----------------
Don't we need to set kill on it ? 


================
Comment at: lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp:699-700
+      //   STRWui kill %w1  ; need to clear kill flag when moving STRWui upwards
+      RegOp0.setIsKill(false);
+      RegOp1.setIsKill(false);
+    } else {
----------------
If there is no instruction using RegOp0 and RegOp1 between stores, no need to clear kill.


================
Comment at: test/CodeGen/AArch64/ldst-opt.mir:132
+# CHECK: %w2 = COPY %w1
+# CHECK: STPWi %w1, killed %w2, killed %x0, 0
----------------
Don't we need to set kill on w1 here ? 


Repository:
  rL LLVM

https://reviews.llvm.org/D28875





More information about the llvm-commits mailing list