<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.apple-tab-span
        {mso-style-name:apple-tab-span;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi Andy,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thanks for clarifying.  I’ll add a check to do this only when dealing with virtual registers.  The reason is that some chain edges are not being discarded by the BasicAA query inside MIsNeedChainEdge is because the check for isIdentifiedObject (called by isUnsafeMemoryObject) is done before the AA part has a chance to determine that there is no aliasing.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thanks,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Sanjin<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Andrew Trick [mailto:atrick@apple.com] <br><b>Sent:</b> Tuesday, September 30, 2014 7:44 PM<br><b>To:</b> Hal Finkel<br><b>Cc:</b> llvm commits; Matt Arsenault; mcrosier@codeaurora.org; Sanjin Sijaric<br><b>Subject:</b> Re: [llvm] r217371 - [AArch64] Improve AA to remove unneeded edges in the AA MI scheduling graph.<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal>On Sep 30, 2014, at 3:36 PM, Hal Finkel <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>> wrote:<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'>Andy,<br><br>Can you take a quick look at this? I think that what Sanjin says makes sense; do you agree? Is there a way to add an assert in case something goes wrong?<br><br>Sanjin, if nothing else, please add a comment in the code to this effect.</span><o:p></o:p></p></div></blockquote><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Thanks Hal, sometimes I need to be copied on commits to notice them.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Is BasicAA unable to pick up on this because it can't answer queries about aliasing within a single loop iteration? It seems like long term that may be something to revisit. There's no fundamental reason we need to decode machine instructions to figure this case out.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>But given that's a pretty major design issue, I'm OK with checking disjoint access at the MI level.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>As you said, areMemAccessesTriviallyDisjoint is lying if it reports true for physical registers. I don't see the harm in explicitly checking the register type. Otherwise, there does need to be a very bold comment in the function header.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>-Andy<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'><br>Thanks again,<br>Hal<br><br>----- Original Message -----<br style='orphans: auto;text-align:start;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px'><br></span><o:p></o:p></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'>From: "Sanjin Sijaric" <<a href="mailto:ssijaric@codeaurora.org">ssijaric@codeaurora.org</a>><br>To: <a href="mailto:mcrosier@codeaurora.org">mcrosier@codeaurora.org</a><br>Cc: "Hal Finkel" <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>>, <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a>, "Matt Arsenault" <<a href="mailto:arsenm2@gmail.com">arsenm2@gmail.com</a>><br>Sent: Monday, September 29, 2014 5:22:47 PM<br>Subject: RE: [llvm] r217371 - [AArch64] Improve AA to remove unneeded edges in the<span class=apple-tab-span>     </span>AA MI scheduling graph.<br><br>Hi Hal,<br><br>The original purpose of the function was for discarding trivial chain<br>edges<br>when constructing the dependence graph for scheduling.  If BaseReg is<br>a<br>physical register that gets modified, then we may have something<br>like:<br><br>LD R1 = A(BaseReg, Offset1)               (1)<br><br>BaseReg = ....                                          (2)<br><br>ST R2, B(BaseReg, Offset2)                  (3)<br><br>Given the inputs (1) and (3) to areMemAccessesTriviallyDisjoint, it<br>may be<br>determined that there is no need for an edge between them.  There<br>will be no<br>dependence between (1) and (3), but there will be dependences between<br>"(1)<br>and (2)" and "(2) and (3)".  I think this should be enough to prevent<br>any<br>bad scheduling from happening.<br><br>Thanks,<br>Sanjin<br><br>-----Original Message-----<br>From: Chad Rosier [<a href="mailto:mcrosier@codeaurora.org">mailto:mcrosier@codeaurora.org</a>]<br>Sent: Monday, September 29, 2014 6:47 AM<br>To: <a href="mailto:ssijaric@codeaurora.org">ssijaric@codeaurora.org</a><br>Cc: Hal Finkel; Chad Rosier; <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a>; Matt Arsenault<br>Subject: Re: [llvm] r217371 - [AArch64] Improve AA to remove unneeded<br>edges<br>in the AA MI scheduling graph.<br><br>+Sanjin<br><br>Adding Sanjin since this is his work.<br><br>Chad<br><br><br><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'>----- Original Message -----<br><br><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'>From: "Chad Rosier" <<a href="mailto:mcrosier@codeaurora.org">mcrosier@codeaurora.org</a>><br>To: <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>Sent: Monday, September 8, 2014 9:43:48 AM<br>Subject: [llvm] r217371 - [AArch64] Improve AA to remove unneeded<br>edges<br>in the<span class=apple-tab-span>      </span>AA MI scheduling graph.<br><br>Author: mcrosier<br>Date: Mon Sep  8 09:43:48 2014<br>New Revision: 217371<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=217371&view=rev">http://llvm.org/viewvc/llvm-project?rev=217371&view=rev</a><br>Log:<br>[AArch64] Improve AA to remove unneeded edges in the AA MI<br>scheduling<br>graph.<br><br>Patch by Sanjin Sijaric <<a href="mailto:ssijaric@codeaurora.org">ssijaric@codeaurora.org</a>>!<br>Phabricator Review: <a href="http://reviews.llvm.org/D5103">http://reviews.llvm.org/D5103</a><br><br>Added:<br>   llvm/trunk/test/CodeGen/AArch64/arm64-triv-disjoint-mem-access.ll<br>Modified:<br>   llvm/trunk/include/llvm/Target/TargetInstrInfo.h<br>   llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp<br>   llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp<br>   llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.h<br><br>Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h<br>URL:<br><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/Ta">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/Ta</a><br>rgetInstrInfo.h?rev=217371&r1=217370&r2=217371&view=diff<br>=====================================================================<br>=========<br>--- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original)<br>+++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Mon Sep  8<br>09:43:48 2014<br>@@ -1192,6 +1192,20 @@ public:<br>    return nullptr;<br>  }<br><br>+  // areMemAccessesTriviallyDisjoint - Sometimes, it is possible<br>for<br>the target<br>+  // to tell, even without aliasing information, that two MIs<br>access<br>different<br>+  // memory addresses. This function returns true if two MIs<br>access<br>different<br>+  // memory addresses, and false otherwise.<br>+  virtual bool<br>+  areMemAccessesTriviallyDisjoint(MachineInstr *MIa, MachineInstr<br>*MIb,<br>+                                  AliasAnalysis *AA = nullptr)<br>const<br>{<br>+    assert(MIa && (MIa->mayLoad() || MIa->mayStore()) &&<br>+           "MIa must load from or modify a memory location");<br>+    assert(MIb && (MIb->mayLoad() || MIb->mayStore()) &&<br>+           "MIb must load from or modify a memory location");<br>+    return false;<br>+  }<br>+<br>private:<br>  int CallFrameSetupOpcode, CallFrameDestroyOpcode;  };<br><br>Modified: llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp<br>URL:<br><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ScheduleDA">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ScheduleDA</a><br>GInstrs.cpp?rev=217371&r1=217370&r2=217371&view=diff<br>=====================================================================<br>=========<br>--- llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp (original)<br>+++ llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp Mon Sep  8<br>09:43:48<br>2014<br>@@ -511,9 +511,18 @@ static inline bool isUnsafeMemoryObject(<br>static<br>bool MIsNeedChainEdge(AliasAnalysis *AA, const  MachineFrameInfo<br>*MFI,<br>                             MachineInstr *MIa,<br>                             MachineInstr *MIb) {<br>+  const MachineFunction *MF = MIa->getParent()->getParent();<br>const<br>+ TargetInstrInfo *TII = MF->getSubtarget().getInstrInfo();<br>+<br>  // Cover a trivial case - no edge is need to itself.<br>  if (MIa == MIb)<br>    return false;<br>+<br>+  // Let the target decide if memory accesses cannot possibly<br>overlap.<br>+  if ((MIa->mayLoad() || MIa->mayStore()) &&<br>+      (MIb->mayLoad() || MIb->mayStore()))<br>+    if (TII->areMemAccessesTriviallyDisjoint(MIa, MIb, AA))<br>+      return false;<br><br>  // FIXME: Need to handle multiple memory operands to support<br>  all<br>  targets.<br>  if (!MIa->hasOneMemOperand() || !MIb->hasOneMemOperand())<br><br>Modified: llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp<br>URL:<br><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AAr">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AAr</a><br>ch64InstrInfo.cpp?rev=217371&r1=217370&r2=217371&view=diff<br>=====================================================================<br>=========<br>--- llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp (original)<br>+++ llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp Mon Sep  8<br>09:43:48 2014<br>@@ -607,6 +607,42 @@ bool AArch64InstrInfo::isCoalescableExtI<br>  }<br>}<br><br>+bool<br>+AArch64InstrInfo::areMemAccessesTriviallyDisjoint(MachineInstr<br>*MIa,<br>+                                                  MachineInstr<br>*MIb,<br>+                                                  AliasAnalysis<br>*AA)<br>const {<br>+  const TargetRegisterInfo *TRI = &getRegisterInfo();  unsigned<br>+ BaseRegA = 0, BaseRegB = 0;  int OffsetA = 0, OffsetB = 0;  int<br>+ WidthA = 0, WidthB = 0;<br>+<br>+  assert(MIa && (MIa->mayLoad() || MIa->mayStore()) &&<br>+         "MIa must be a store or a load");  assert(MIb &&<br>+ (MIb->mayLoad() || MIb->mayStore()) &&<br>+         "MIb must be a store or a load");<br>+<br>+  if (MIa->hasUnmodeledSideEffects() ||<br>MIb->hasUnmodeledSideEffects() ||<br>+      MIa->hasOrderedMemoryRef() || MIb->hasOrderedMemoryRef())<br>+    return false;<br>+<br>+  // Retrieve the base register, offset from the base register<br>and<br>width. Width<br>+  // is the size of memory that is being loaded/stored (e.g. 1,<br>2,<br>4, 8).  If<br>+  // base registers are identical, and the offset of a lower<br>memory<br>access +<br>+  // the width doesn't overlap the offset of a higher memory<br>access,<br>+ // then the memory accesses are different.<br>+  if (getLdStBaseRegImmOfsWidth(MIa, BaseRegA, OffsetA, WidthA,<br>TRI)<br>&&<br>+      getLdStBaseRegImmOfsWidth(MIb, BaseRegB, OffsetB, WidthB,<br>TRI)) {<br>+    if (BaseRegA == BaseRegB) {<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'><br>I think that this makes sense only for SSA virtual registers, but<br>not<br>for physical ones (because the value in a physical register might<br>have<br>changed in between the two instructions). If I'm right, then you'll<br>want to exclude physical registers here (at least any that might be<br>modified during the function's execution).<br><br>-Hal<br><br><br><o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'>+      int LowOffset = OffsetA < OffsetB ? OffsetA : OffsetB;<br>+      int HighOffset = OffsetA < OffsetB ? OffsetB : OffsetA;<br>+      int LowWidth = (LowOffset == OffsetA) ? WidthA : WidthB;<br>+      if (LowOffset + LowWidth <= HighOffset)<br>+        return true;<br>+    }<br>+  }<br>+  return false;<br>+}<br>+<br>/// analyzeCompare - For a comparison instruction, return the<br>source<br>registers  /// in SrcReg and SrcReg2, and the value it compares<br>against in  CmpValue.<br>/// Return true if the comparison instruction can be analyzed.<br>@@ -1270,6 +1306,102 @@ AArch64InstrInfo::getLdStBaseRegImmOfs(M<br>  };<br>}<br><br>+bool AArch64InstrInfo::getLdStBaseRegImmOfsWidth(<br>+    MachineInstr *LdSt, unsigned &BaseReg, int &Offset, int<br>&Width,<br>+    const TargetRegisterInfo *TRI) const {<br>+  // Handle only loads/stores with base register followed by<br>immediate offset.<br>+  if (LdSt->getNumOperands() != 3)<br>+    return false;<br>+  if (!LdSt->getOperand(1).isReg() ||<br>!LdSt->getOperand(2).isImm())<br>+    return false;<br>+<br>+  // Offset is calculated as the immediate operand multiplied by<br>the<br>scaling factor.<br>+  // Unscaled instructions have scaling factor set to 1.<br>+  int Scale = 0;<br>+  switch (LdSt->getOpcode()) {<br>+  default:<br>+    return false;<br>+  case AArch64::LDURQi:<br>+  case AArch64::STURQi:<br>+    Width = 16;<br>+    Scale = 1;<br>+    break;<br>+  case AArch64::LDURXi:<br>+  case AArch64::LDURDi:<br>+  case AArch64::STURXi:<br>+  case AArch64::STURDi:<br>+    Width = 8;<br>+    Scale = 1;<br>+    break;<br>+  case AArch64::LDURWi:<br>+  case AArch64::LDURSi:<br>+  case AArch64::LDURSWi:<br>+  case AArch64::STURWi:<br>+  case AArch64::STURSi:<br>+    Width = 4;<br>+    Scale = 1;<br>+    break;<br>+  case AArch64::LDURHi:<br>+  case AArch64::LDURHHi:<br>+  case AArch64::LDURSHXi:<br>+  case AArch64::LDURSHWi:<br>+  case AArch64::STURHi:<br>+  case AArch64::STURHHi:<br>+    Width = 2;<br>+    Scale = 1;<br>+    break;<br>+  case AArch64::LDURBi:<br>+  case AArch64::LDURBBi:<br>+  case AArch64::LDURSBXi:<br>+  case AArch64::LDURSBWi:<br>+  case AArch64::STURBi:<br>+  case AArch64::STURBBi:<br>+    Width = 1;<br>+    Scale = 1;<br>+    break;<br>+  case AArch64::LDRXui:<br>+  case AArch64::STRXui:<br>+    Scale = Width = 8;<br>+    break;<br>+  case AArch64::LDRWui:<br>+  case AArch64::STRWui:<br>+    Scale = Width = 4;<br>+    break;<br>+  case AArch64::LDRBui:<br>+  case AArch64::STRBui:<br>+    Scale = Width = 1;<br>+    break;<br>+  case AArch64::LDRHui:<br>+  case AArch64::STRHui:<br>+    Scale = Width = 2;<br>+    break;<br>+  case AArch64::LDRSui:<br>+  case AArch64::STRSui:<br>+    Scale = Width = 4;<br>+    break;<br>+  case AArch64::LDRDui:<br>+  case AArch64::STRDui:<br>+    Scale = Width = 8;<br>+    break;<br>+  case AArch64::LDRQui:<br>+  case AArch64::STRQui:<br>+    Scale = Width = 16;<br>+    break;<br>+  case AArch64::LDRBBui:<br>+  case AArch64::STRBBui:<br>+    Scale = Width = 1;<br>+    break;<br>+  case AArch64::LDRHHui:<br>+  case AArch64::STRHHui:<br>+    Scale = Width = 2;<br>+    break;<br>+  };<br>+<br>+  BaseReg = LdSt->getOperand(1).getReg();<br>+  Offset = LdSt->getOperand(2).getImm() * Scale;<br>+  return true;<br>+}<br>+<br>/// Detect opportunities for ldp/stp formation.<br>///<br>/// Only called for LdSt for which getLdStBaseRegImmOfs returns<br>true.<br><br>Modified: llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.h<br>URL:<br><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AAr">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AAr</a><br>ch64InstrInfo.h?rev=217371&r1=217370&r2=217371&view=diff<br>=====================================================================<br>=========<br>--- llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.h (original)<br>+++ llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.h Mon Sep  8<br>09:43:48 2014<br>@@ -52,6 +52,10 @@ public:<br>  bool isCoalescableExtInstr(const MachineInstr &MI, unsigned<br>  &SrcReg,<br>                             unsigned &DstReg, unsigned &SubIdx)<br>                             const override;<br><br>+  bool<br>+  areMemAccessesTriviallyDisjoint(MachineInstr *MIa, MachineInstr<br>*MIb,<br>+                                  AliasAnalysis *AA = nullptr)<br>const<br>override;<br>+<br>  unsigned isLoadFromStackSlot(const MachineInstr *MI,<br>                               int &FrameIndex) const override;<br>  unsigned isStoreToStackSlot(const MachineInstr *MI, @@ -90,6<br>+94,10 @@ public:<br>                            unsigned &Offset,<br>                            const TargetRegisterInfo *TRI) const<br>                            override;<br><br>+  bool getLdStBaseRegImmOfsWidth(MachineInstr *LdSt, unsigned<br>&BaseReg,<br>+                                 int &Offset, int &Width,<br>+                                 const TargetRegisterInfo *TRI)<br>const;<br>+<br>  bool enableClusterLoads() const override { return true; }<br><br>  bool shouldClusterLoads(MachineInstr *FirstLdSt, MachineInstr<br>  *SecondLdSt,<br><br>Added:<br>llvm/trunk/test/CodeGen/AArch64/arm64-triv-disjoint-mem-access.ll<br>URL:<br><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/a">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/a</a><br>rm64-triv-disjoint-mem-access.ll?rev=217371&view=auto<br>=====================================================================<br>=========<br>---<br>llvm/trunk/test/CodeGen/AArch64/arm64-triv-disjoint-mem-access.ll<br>(added)<br>+++<br>llvm/trunk/test/CodeGen/AArch64/arm64-triv-disjoint-mem-access.ll<br>Mon Sep  8 09:43:48 2014<br>@@ -0,0 +1,31 @@<br>+; RUN: llc < %s -mtriple=arm64-linux-gnu -mcpu=cortex-a53<br>-enable-aa-sched-mi | FileCheck %s<br>+; Check that the scheduler moves the load from a[1] past the<br>store<br>into a[2].<br>+@a = common global i32* null, align 8 @m = common global i32 0,<br>+align 4<br>+<br>+; Function Attrs: nounwind<br>+define i32 @func(i32 %i, i32 %j, i32 %k) #0 {<br>+entry:<br>+; CHECK: ldr {{w[0-9]+}}, [x[[REG:[0-9]+]], #4] ; CHECK: str<br>+{{w[0-9]+}}, [x[[REG]], #8]<br>+  %0 = load i32** @a, align 8, !tbaa !1<br>+  %arrayidx = getelementptr inbounds i32* %0, i64 2<br>+  store i32 %i, i32* %arrayidx, align 4, !tbaa !5<br>+  %arrayidx1 = getelementptr inbounds i32* %0, i64 1<br>+  %1 = load i32* %arrayidx1, align 4, !tbaa !5<br>+  %add = add nsw i32 %k, %i<br>+  store i32 %add, i32* @m, align 4, !tbaa !5<br>+  ret i32 %1<br>+}<br>+<br>+attributes #0 = { nounwind "less-precise-fpmad"="false"<br>"no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"<br>"no-infs-fp-math"="true" "no-nans-fp-math"="true"<br>"stack-protector-buffer-size"="8" "unsafe-fp-math"="true"<br>"use-soft-float"="false" }<br>+<br>+!llvm.ident = !{!0}<br>+<br>+!0 = metadata !{metadata !"clang version 3.6.0 "}<br>+!1 = metadata !{metadata !2, metadata !2, i64 0}<br>+!2 = metadata !{metadata !"any pointer", metadata !3, i64 0}<br>+!3 = metadata !{metadata !"omnipotent char", metadata !4, i64 0}<br>+!4 = metadata !{metadata !"Simple C/C++ TBAA"}<br>+!5 = metadata !{metadata !6, metadata !6, i64 0}<br>+!6 = metadata !{metadata !"int", metadata !3, i64 0}<br><br><br>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'><br>--<br>Hal Finkel<br>Assistant Computational Scientist<br>Leadership Computing Facility<br>Argonne National Laboratory<o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'><br><br><br><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'><br>--<span class=apple-converted-space> </span><br>Hal Finkel<br>Assistant Computational Scientist<br>Leadership Computing Facility<br>Argonne National Laboratory</span><o:p></o:p></p></div></blockquote></div><p class=MsoNormal><o:p> </o:p></p></div></body></html>