<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Thanks!<div class="">Q.<br class=""><div><blockquote type="cite" class=""><div class="">On Feb 25, 2015, at 10:07 AM, Matthias Braun <<a href="mailto:matze@braunis.de" class="">matze@braunis.de</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">I added the debug messages. The discussion of the "proper" fix is stuck here: <a href="http://reviews.llvm.org/D6946" class="">http://reviews.llvm.org/D6946</a></div><div class=""><br class=""></div><div class="">- Matthias</div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Feb 25, 2015, at 9:28 AM, Quentin Colombet <<a href="mailto:qcolombet@apple.com" class="">qcolombet@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">Hi Matthias,<br class=""><br class="">I’m still not convinced that this is the right fix but I can live with it.<br class="">However, could you pleas add some debug line when we hit the locations that were formerly the assertions (i.e., the returns false)?<br class=""><br class="">That way, we know while debugging that there is undefined behavior that made its way in the backend.<br class=""><br class="">Thanks,<br class="">-Quentin<br class=""><br class=""><blockquote type="cite" class="">On Feb 24, 2015, at 10:52 AM, Matthias Braun <<a href="mailto:matze@braunis.de" class="">matze@braunis.de</a>> wrote:<br class=""><br class="">Author: matze<br class="">Date: Tue Feb 24 12:52:04 2015<br class="">New Revision: 230355<br class=""><br class="">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=230355&view=rev" class="">http://llvm.org/viewvc/llvm-project?rev=230355&view=rev</a><br class="">Log:<br class="">AArch64: Relax assert about large shift sizes.<br class=""><br class="">The reason why these large shift sizes happen is because OpaqueConstants<br class="">currently inhibit alot of DAG combining, but that has to be addressed in<br class="">another commit (like the proposal in D6946).<br class=""><br class="">Differential Revision: <a href="http://reviews.llvm.org/D6940" class="">http://reviews.llvm.org/D6940</a><br class=""><br class="">Added:<br class="">   llvm/trunk/test/CodeGen/AArch64/large_shift.ll<br class="">Modified:<br class="">   llvm/trunk/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp<br class=""><br class="">Modified: llvm/trunk/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp?rev=230355&r1=230354&r2=230355&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp?rev=230355&r1=230354&r2=230355&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp (original)<br class="">+++ llvm/trunk/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp Tue Feb 24 12:52:04 2015<br class="">@@ -1397,8 +1397,10 @@ static bool isBitfieldExtractOpFromAnd(S<br class="">  } else<br class="">    return false;<br class=""><br class="">-  assert((BiggerPattern || (Srl_imm > 0 && Srl_imm < VT.getSizeInBits())) &&<br class="">-         "bad amount in shift node!");<br class="">+  // Bail out on large immediates. This happens when no proper<br class="">+  // combining/constant folding was performed.<br class="">+  if (!BiggerPattern && (Srl_imm <= 0 || Srl_imm >= VT.getSizeInBits()))<br class="">+    return false;<br class=""><br class="">  LSB = Srl_imm;<br class="">  MSB = Srl_imm + (VT == MVT::i32 ? countTrailingOnes<uint32_t>(And_imm)<br class="">@@ -1502,7 +1504,11 @@ static bool isBitfieldExtractOpFromShr(S<br class="">  } else<br class="">    return false;<br class=""><br class="">-  assert(Shl_imm < VT.getSizeInBits() && "bad amount in shift node!");<br class="">+  // Missing combines/constant folding may have left us with strange<br class="">+  // constants.<br class="">+  if (Shl_imm >= VT.getSizeInBits())<br class="">+    return false;<br class="">+<br class="">  uint64_t Srl_imm = 0;<br class="">  if (!isIntImmediate(N->getOperand(1), Srl_imm))<br class="">    return false;<br class=""><br class="">Added: llvm/trunk/test/CodeGen/AArch64/large_shift.ll<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/large_shift.ll?rev=230355&view=auto" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/large_shift.ll?rev=230355&view=auto</a><br class="">==============================================================================<br class="">--- llvm/trunk/test/CodeGen/AArch64/large_shift.ll (added)<br class="">+++ llvm/trunk/test/CodeGen/AArch64/large_shift.ll Tue Feb 24 12:52:04 2015<br class="">@@ -0,0 +1,21 @@<br class="">+; RUN: llc -march=aarch64 -o - %s<br class="">+target triple = "arm64-unknown-unknown"<br class="">+<br class="">+; Make sure we don't run into an assert in the aarch64 code selection when<br class="">+; DAGCombining fails.<br class="">+<br class="">+declare void @t()<br class="">+<br class="">+define void @foo() {<br class="">+  %c = bitcast i64 270458 to i64<br class="">+  %t0 = lshr i64 %c, 422383<br class="">+  %t1 = trunc i64 %t0 to i1<br class="">+  br i1 %t1, label %BB1, label %BB0<br class="">+<br class="">+BB0:<br class="">+  call void @t()<br class="">+  br label %BB1<br class="">+<br class="">+BB1:<br class="">+  ret void<br class="">+}<br class=""><br class=""><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@cs.uiuc.edu" class="">llvm-commits@cs.uiuc.edu</a><br class=""><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br class=""></blockquote><br class=""><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@cs.uiuc.edu" class="">llvm-commits@cs.uiuc.edu</a><br class=""><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br class=""></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></div></body></html>