[PATCH] D18903: [lanai] Add areMemAccessesTriviallyDisjoint, getMemOpBaseRegImmOfs and getMemOpBaseRegImmOfsWidth.

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 14 00:03:00 PDT 2016


majnemer added inline comments.

================
Comment at: lib/Target/Lanai/LanaiInstrInfo.cpp:110
@@ +109,3 @@
+    if (BaseRegA == BaseRegB) {
+      int LowOffset = OffsetA < OffsetB ? OffsetA : OffsetB;
+      int HighOffset = OffsetA < OffsetB ? OffsetB : OffsetA;
----------------
std::min?

================
Comment at: lib/Target/Lanai/LanaiInstrInfo.cpp:111
@@ +110,3 @@
+      int LowOffset = OffsetA < OffsetB ? OffsetA : OffsetB;
+      int HighOffset = OffsetA < OffsetB ? OffsetB : OffsetA;
+      int LowWidth = (LowOffset == OffsetA) ? WidthA : WidthB;
----------------
std::max?

================
Comment at: lib/Target/Lanai/LanaiInstrInfo.cpp:113
@@ +112,3 @@
+      int LowWidth = (LowOffset == OffsetA) ? WidthA : WidthB;
+      if (LowOffset + LowWidth <= HighOffset) return true;
+    }
----------------
Please clang-format this.

================
Comment at: lib/Target/Lanai/LanaiInstrInfo.cpp:362
@@ +361,3 @@
+  // and with add as ALU op.
+  if (LdSt->getNumOperands() != 4) return false;
+  if (!LdSt->getOperand(1).isReg() || !LdSt->getOperand(2).isImm() ||
----------------
clang-format this

================
Comment at: lib/Target/Lanai/LanaiInstrInfo.cpp:368-387
@@ +367,22 @@
+
+  switch (LdSt->getOpcode()) {
+    default:
+      return false;
+    case Lanai::LDW_RI:
+    case Lanai::LDW_RR:
+    case Lanai::SW_RR:
+    case Lanai::SW_RI:
+      Width = 4;
+      break;
+    case Lanai::LDHs_RI:
+    case Lanai::LDHz_RI:
+    case Lanai::STH_RI:
+      Width = 2;
+      break;
+    case Lanai::LDBs_RI:
+    case Lanai::LDBz_RI:
+    case Lanai::STB_RI:
+      Width = 1;
+      break;
+  }
+
----------------
clang-format this too.

================
Comment at: lib/Target/Lanai/LanaiInstrInfo.cpp:397-411
@@ +396,17 @@
+    const TargetRegisterInfo *TRI) const {
+  switch (LdSt->getOpcode()) {
+    default:
+      return false;
+    case Lanai::LDW_RI:
+    case Lanai::LDW_RR:
+    case Lanai::SW_RR:
+    case Lanai::SW_RI:
+    case Lanai::LDHs_RI:
+    case Lanai::LDHz_RI:
+    case Lanai::STH_RI:
+    case Lanai::LDBs_RI:
+    case Lanai::LDBz_RI:
+      unsigned Width;
+      return getMemOpBaseRegImmOfsWidth(LdSt, BaseReg, Offset, Width, TRI);
+  };
+}
----------------
And this.

================
Comment at: lib/Target/Lanai/LanaiInstrInfo.cpp:411
@@ +410,3 @@
+      return getMemOpBaseRegImmOfsWidth(LdSt, BaseReg, Offset, Width, TRI);
+  };
+}
----------------
Extra semicolon.

================
Comment at: test/CodeGen/Lanai/lanai-misched-trivial-disjoint.ll:1
@@ +1,2 @@
+; RUN: llc %s -mtriple=lanai-unknown-unknown -debug-only=misched -o /dev/null 2>&1 | FileCheck %s
+
----------------
I'd recommend piping the file in via stdin:
  llc < %s -mtriple=lanai-unknown-unknown -debug-only=misched -o /dev/null 2>&1

This prevents the path to the file from showing up in any of LLVM's output.  Occasionally,  this causes problems if content that a CHECK line is searching for can be found inside of a path.

================
Comment at: test/CodeGen/Lanai/lanai-misched-trivial-disjoint.ll:6
@@ +5,3 @@
+
+; Function Attrs: norecurse nounwind uwtable
+define i32 @foo(i8* inreg nocapture %x) {
----------------
I'd remove this comment


http://reviews.llvm.org/D18903





More information about the llvm-commits mailing list