<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Luckily AArch64 does not use any bundles so no issue here either way.</div><div class=""><br class=""></div><div class="">As for bundles: We appear to have 2 bundle modelings in llvm:</div><div class="">- One variant is having a BUNDLE instruction in front of the bundle which repeats the relevant operands so the normal code will get the relevant information just by looking at the first instruction without the need to look what's actually inside the bundle.</div><div class="">- The other variant has no BUNDLE instruction and forces code to use stuff like the MIBundleOperands from MachineInstrBundle,h</div><div class="">I still don't know which variant is supposed to be used when. </div><div class=""><br class=""></div><div class="">- Matthias</div><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">On Aug 18, 2016, at 7:29 PM, Duncan P. N. Exon Smith via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline">On 2016-Aug-18, at 10:58, Duncan P. N. Exon Smith via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>> wrote:<br class=""><br class="">Author: dexonsmith<br class="">Date: Thu Aug 18 12:58:09 2016<br class="">New Revision: 279104<br class=""><br class="">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=279104&view=rev" class="">http://llvm.org/viewvc/llvm-project?rev=279104&view=rev</a><br class="">Log:<br class="">AArch64: Don't call getIterator() on iterators<br class=""><br class="">Remove an unnecessary round-trip:<br class=""><br class=""> iterator => operator->() => getIterator()<br class=""><br class="">In some cases, the iterator is end(), so the dereference of operator-><br class="">is invalid (UB).<br class=""><br class="">The testcase only crashes with r278974 (currently reverted to<br class="">investigate this), which adds an assertion for invalid dereferences of<br class="">ilist nodes.<br class=""><br class="">Fixes PR29035.<br class=""><br class="">Added:<br class=""> llvm/trunk/test/CodeGen/AArch64/redundant-copy-elim-empty-mbb.ll<br class="">Modified:<br class=""> llvm/trunk/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp<br class=""><br class="">Modified: llvm/trunk/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp?rev=279104&r1=279103&r2=279104&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp?rev=279104&r1=279103&r2=279104&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp (original)<br class="">+++ llvm/trunk/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp Thu Aug 18 12:58:09 2016<br class="">@@ -156,8 +156,7 @@ bool AArch64RedundantCopyElimination::op<br class=""> MBB->addLiveIn(TargetReg);<br class=""><br class=""> // Clear any kills of TargetReg between CompBr and the last removed COPY.<br class="">- for (MachineInstr &MMI :<br class="">- make_range(MBB->begin()->getIterator(), LastChange->getIterator()))<br class="">+ for (MachineInstr &MMI : make_range(MBB->begin(), LastChange))<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">After-thought: does this do the right thing for bundled instructions?</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I.e., should this code be, instead:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""> for (MachineInstr &MMI : make_range(MBB->begin().getInstrIterator(),</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""> LastChange.getInstrIterator()))</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">This matches the old semantics (in the case where there wasn't UB).</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""> MMI.clearRegisterKills(SmallestDef, TRI);<br class=""><br class=""> return true;<br class=""><br class="">Added: llvm/trunk/test/CodeGen/AArch64/redundant-copy-elim-empty-mbb.ll<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/redundant-copy-elim-empty-mbb.ll?rev=279104&view=auto" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/redundant-copy-elim-empty-mbb.ll?rev=279104&view=auto</a><br class="">==============================================================================<br class="">--- llvm/trunk/test/CodeGen/AArch64/redundant-copy-elim-empty-mbb.ll (added)<br class="">+++ llvm/trunk/test/CodeGen/AArch64/redundant-copy-elim-empty-mbb.ll Thu Aug 18 12:58:09 2016<br class="">@@ -0,0 +1,29 @@<br class="">+; RUN: llc < %s | FileCheck %s<br class="">+; Make sure we don't crash in AArch64RedundantCopyElimination when a<br class="">+; MachineBasicBlock is empty. PR29035.<br class="">+<br class="">+target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"<br class="">+target triple = "aarch64-unknown-linux-gnu"<br class="">+<br class="">+declare i8* @bar()<br class="">+<br class="">+; CHECK-LABEL: foo:<br class="">+; CHECK: tbz<br class="">+; CHECK: orr<br class="">+; CHECK: ret<br class="">+; CHECK: bl bar<br class="">+; CHECK: cbnz<br class="">+; CHECK: ret<br class="">+define i1 @foo(i1 %start) {<br class="">+entry:<br class="">+ br i1 %start, label %cleanup, label %if.end<br class="">+<br class="">+if.end: ; preds = %if.end, %entry<br class="">+ %call = tail call i8* @bar()<br class="">+ %cmp = icmp eq i8* %call, null<br class="">+ br i1 %cmp, label %cleanup, label %if.end<br class="">+<br class="">+cleanup: ; preds = %if.end, %entry<br class="">+ %retval.0 = phi i1 [ true, %entry ], [ false, %if.end ]<br class="">+ ret i1 %retval.0<br class="">+}<br class=""><br class=""><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">llvm-commits mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:llvm-commits@lists.llvm.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">llvm-commits@lists.llvm.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a></div></blockquote></div><br class=""></body></html>