<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="">Hi Balaram<div class=""><br class=""></div><div class="">Looks like this broke the bots.  Mind taking a look?</div><div class=""><br class=""></div><div class="">The log is <a href="http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/22643/consoleFull" class="">http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/22643/consoleFull</a></div><div class=""><br class=""></div><div class="">And the failure is:</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><span style="color: rgb(51, 51, 51); font-family: monospace; font-size: 13px; white-space: pre-wrap;" class="">******************** TEST 'LLVM :: Transforms/InstCombine/select-implied.ll' FAILED ********************</span></div><div class=""><span style="color: rgb(51, 51, 51); font-family: monospace; font-size: 13px; white-space: pre-wrap;" class="">Script:</span></div><div class=""><span style="color: rgb(51, 51, 51); font-family: monospace; font-size: 13px; white-space: pre-wrap;" class="">--</span></div><div class=""><span style="color: rgb(51, 51, 51); font-family: monospace; font-size: 13px; white-space: pre-wrap;" class="">/Users/buildslave/jenkins/sharedspace/incremental@2/clang-build/./bin/opt < /Users/buildslave/jenkins/sharedspace/incremental@2/llvm/test/Transforms/InstCombine/select-implied.ll -instcombine -S | /Users/buildslave/jenkins/sharedspace/incremental@2/clang-build/./bin/FileCheck /Users/buildslave/jenkins/sharedspace/incremental@2/llvm/test/Transforms/InstCombine/select-implied.ll</span></div><div class=""><span style="color: rgb(51, 51, 51); font-family: monospace; font-size: 13px; white-space: pre-wrap;" class="">--</span></div><div class=""><span style="color: rgb(51, 51, 51); font-family: monospace; font-size: 13px; white-space: pre-wrap;" class="">Exit Code: 1</span></div><div class=""><span style="color: rgb(51, 51, 51); font-family: monospace; font-size: 13px; white-space: pre-wrap;" class="">
</span></div><div class=""><span style="color: rgb(51, 51, 51); font-family: monospace; font-size: 13px; white-space: pre-wrap;" class="">Command Output (stderr):</span></div><div class=""><span style="color: rgb(51, 51, 51); font-family: monospace; font-size: 13px; white-space: pre-wrap;" class="">--</span></div><div class=""><span style="color: rgb(51, 51, 51); font-family: monospace; font-size: 13px; white-space: pre-wrap;" class="">/Users/buildslave/jenkins/sharedspace/incremental@2/llvm/test/Transforms/InstCombine/select-implied.ll:84:10: error: expected string not found in input</span></div><div class=""><span style="color: rgb(51, 51, 51); font-family: monospace; font-size: 13px; white-space: pre-wrap;" class="">; CHECK: %cmp11 = icmp eq i32 %len, 8</span></div><div class=""><span style="color: rgb(51, 51, 51); font-family: monospace; font-size: 13px; white-space: pre-wrap;" class="">         ^</span></div><div class=""><span style="color: rgb(51, 51, 51); font-family: monospace; font-size: 13px; white-space: pre-wrap;" class=""><stdin>:51:19: note: scanning from here</span></div><div class=""><span style="color: rgb(51, 51, 51); font-family: monospace; font-size: 13px; white-space: pre-wrap;" class="">define void @test4(i32 %len) {</span></div><div class=""><span style="color: rgb(51, 51, 51); font-family: monospace; font-size: 13px; white-space: pre-wrap;" class="">                  ^</span></div><div class=""><span style="color: rgb(51, 51, 51); font-family: monospace; font-size: 13px; white-space: pre-wrap;" class=""><stdin>:54:2: note: possible intended match here</span></div><div class=""><span style="color: rgb(51, 51, 51); font-family: monospace; font-size: 13px; white-space: pre-wrap;" class=""> %cmp = icmp ult i32 %len, 4</span></div></blockquote><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Pete</div><div class=""><div><blockquote type="cite" class=""><div class="">On May 4, 2016, at 10:34 AM, Balaram Makam 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=""><div class="">Author: bmakam<br class="">Date: Wed May  4 12:34:20 2016<br class="">New Revision: 268521<br class=""><br class="">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=268521&view=rev" class="">http://llvm.org/viewvc/llvm-project?rev=268521&view=rev</a><br class="">Log:<br class="">[InstCombine] Canonicalize icmp instructions based on dominating conditions.<br class=""><br class="">Summary:<br class="">    This patch canonicalizes conditions based on the constant range information<br class="">    of the dominating branch condition.<br class="">    For example:<br class=""><br class="">      %cmp = icmp slt i64 %a, 0<br class="">      br i1 %cmp, label %land.lhs.true, label %lor.rhs<br class="">      lor.rhs:<br class="">        %cmp2 = icmp sgt i64 %a, 0<br class=""><br class="">    Would now be canonicalized into:<br class=""><br class="">      %cmp = icmp slt i64 %a, 0<br class="">      br i1 %cmp, label %land.lhs.true, label %lor.rhs<br class="">      lor.rhs:<br class="">        %cmp2 = icmp ne i64 %a, 0<br class=""><br class="">Reviewers: mcrosier, gberry, t.p.northover, llvm-commits, reames, hfinkel, sanjoy, majnemer<br class=""><br class="">Subscribers: MatzeB, majnemer, mcrosier<br class=""><br class="">Differential Revision: <a href="http://reviews.llvm.org/D18841" class="">http://reviews.llvm.org/D18841</a><br class=""><br class="">Modified:<br class="">    llvm/trunk/include/llvm/IR/ConstantRange.h<br class="">    llvm/trunk/lib/IR/ConstantRange.cpp<br class="">    llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp<br class="">    llvm/trunk/test/Transforms/InstCombine/icmp.ll<br class=""><br class="">Modified: llvm/trunk/include/llvm/IR/ConstantRange.h<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/ConstantRange.h?rev=268521&r1=268520&r2=268521&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/ConstantRange.h?rev=268521&r1=268520&r2=268521&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/include/llvm/IR/ConstantRange.h (original)<br class="">+++ llvm/trunk/include/llvm/IR/ConstantRange.h Wed May  4 12:34:20 2016<br class="">@@ -82,6 +82,16 @@ public:<br class="">   static ConstantRange makeSatisfyingICmpRegion(CmpInst::Predicate Pred,<br class="">                                                 const ConstantRange &Other);<br class=""><br class="">+  /// Produce the exact range such that all values in the returned range satisfy<br class="">+  /// the given predicate with any value contained within Other. Formally, this<br class="">+  /// returns the exact answer when the superset of 'union over all y in Other<br class="">+  /// is exactly same as the subset of intersection over all y in Other.<br class="">+  /// { x : icmp op x y is true}'.<br class="">+  ///<br class="">+  /// Example: Pred = ult and Other = i8 3 returns [0, 3)<br class="">+  static ConstantRange makeExactICmpRegion(CmpInst::Predicate Pred,<br class="">+                                           const APInt &Other);<br class="">+<br class="">   /// Return the largest range containing all X such that "X BinOpC Y" is<br class="">   /// guaranteed not to wrap (overflow) for all Y in Other.<br class="">   ///<br class=""><br class="">Modified: llvm/trunk/lib/IR/ConstantRange.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/ConstantRange.cpp?rev=268521&r1=268520&r2=268521&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/ConstantRange.cpp?rev=268521&r1=268520&r2=268521&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/IR/ConstantRange.cpp (original)<br class="">+++ llvm/trunk/lib/IR/ConstantRange.cpp Wed May  4 12:34:20 2016<br class="">@@ -127,6 +127,18 @@ ConstantRange ConstantRange::makeSatisfy<br class="">       .inverse();<br class=""> }<br class=""><br class="">+ConstantRange ConstantRange::makeExactICmpRegion(CmpInst::Predicate Pred,<br class="">+                                                 const APInt &C) {<br class="">+  // Computes the exact range that is equal to both the constant ranges returned<br class="">+  // by makeAllowedICmpRegion and makeSatisfyingICmpRegion. This is always true<br class="">+  // when RHS is a singleton such as an APInt and so the assert is valid.<br class="">+  // However for non-singleton RHS, for example ult [2,5) makeAllowedICmpRegion<br class="">+  // returns [0,4) but makeSatisfyICmpRegion returns [0,2).<br class="">+  //<br class="">+  assert(makeAllowedICmpRegion(Pred, C) == makeSatisfyingICmpRegion(Pred, C));<br class="">+  return makeAllowedICmpRegion(Pred, C);<br class="">+}<br class="">+<br class=""> ConstantRange<br class=""> ConstantRange::makeGuaranteedNoWrapRegion(Instruction::BinaryOps BinOp,<br class="">                                           const ConstantRange &Other,<br class=""><br class="">Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp?rev=268521&r1=268520&r2=268521&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp?rev=268521&r1=268520&r2=268521&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp (original)<br class="">+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp Wed May  4 12:34:20 2016<br class="">@@ -114,6 +114,15 @@ static bool SubWithOverflow(Constant *&R<br class="">                         IsSigned);<br class=""> }<br class=""><br class="">+/// Given an icmp instruction, return true if any use of this comparison is a<br class="">+/// branch on sign bit comparison.<br class="">+static bool isBranchOnSignBitCheck(ICmpInst &I, bool isSignBit) {<br class="">+  for (auto *U : I.users())<br class="">+    if (isa<BranchInst>(U))<br class="">+      return isSignBit;<br class="">+  return false;<br class="">+}<br class="">+<br class=""> /// isSignBitCheck - Given an exploded icmp instruction, return true if the<br class=""> /// comparison only checks the sign bit.  If it only checks the sign bit, set<br class=""> /// TrueIfSigned if the result of the comparison is true when the input value is<br class="">@@ -3284,6 +3293,42 @@ Instruction *InstCombiner::visitICmpInst<br class="">     // bits, if it is a sign bit comparison, it only demands the sign bit.<br class="">     bool UnusedBit;<br class="">     isSignBit = isSignBitCheck(I.getPredicate(), CI, UnusedBit);<br class="">+<br class="">+    // Canonicalize icmp instructions based on dominating conditions.<br class="">+    BasicBlock *Parent = I.getParent();<br class="">+    BasicBlock *Dom = Parent->getSinglePredecessor();<br class="">+    auto *BI = Dom ? dyn_cast<BranchInst>(Dom->getTerminator()) : nullptr;<br class="">+    ICmpInst::Predicate Pred;<br class="">+    BasicBlock *TrueBB, *FalseBB;<br class="">+    ConstantInt *CI2;<br class="">+    if (BI && match(BI, m_Br(m_ICmp(Pred, m_Specific(Op0), m_ConstantInt(CI2)),<br class="">+                             TrueBB, FalseBB)) &&<br class="">+        TrueBB != FalseBB) {<br class="">+      ConstantRange CR = ConstantRange::makeAllowedICmpRegion(I.getPredicate(),<br class="">+                                                              CI->getValue());<br class="">+      ConstantRange DominatingCR =<br class="">+          (Parent == TrueBB)<br class="">+              ? ConstantRange::makeExactICmpRegion(Pred, CI2->getValue())<br class="">+              : ConstantRange::makeExactICmpRegion(<br class="">+                    CmpInst::getInversePredicate(Pred), CI2->getValue());<br class="">+      ConstantRange Intersection = DominatingCR.intersectWith(CR);<br class="">+      ConstantRange Difference = DominatingCR.difference(CR);<br class="">+      if (Intersection.isEmptySet())<br class="">+        return replaceInstUsesWith(I, Builder->getFalse());<br class="">+      if (Difference.isEmptySet())<br class="">+        return replaceInstUsesWith(I, Builder->getTrue());<br class="">+      // Canonicalizing a sign bit comparison that gets used in a branch,<br class="">+      // pessimizes codegen by generating branch on zero instruction instead<br class="">+      // of a test and branch. So we avoid canonicalizing in such situations<br class="">+      // because test and branch instruction has better branch displacement<br class="">+      // than compare and branch instruction.<br class="">+      if (!isBranchOnSignBitCheck(I, isSignBit) && !I.isEquality()) {<br class="">+        if (auto *AI = Intersection.getSingleElement())<br class="">+          return new ICmpInst(ICmpInst::ICMP_EQ, Op0, Builder->getInt(*AI));<br class="">+        if (auto *AD = Difference.getSingleElement())<br class="">+          return new ICmpInst(ICmpInst::ICMP_NE, Op0, Builder->getInt(*AD));<br class="">+      }<br class="">+    }<br class="">   }<br class=""><br class="">   // See if we can fold the comparison based on range information we can get<br class=""><br class="">Modified: llvm/trunk/test/Transforms/InstCombine/icmp.ll<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/icmp.ll?rev=268521&r1=268520&r2=268521&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/icmp.ll?rev=268521&r1=268520&r2=268521&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/test/Transforms/InstCombine/icmp.ll (original)<br class="">+++ llvm/trunk/test/Transforms/InstCombine/icmp.ll Wed May  4 12:34:20 2016<br class="">@@ -1979,3 +1979,121 @@ define i1 @cmp_inverse_mask_bits_set_ne(<br class="">   ret i1 %cmp<br class=""> }<br class=""><br class="">+; CHECK-LABEL: @idom_sign_bit_check_edge_dominates<br class="">+define void @idom_sign_bit_check_edge_dominates(i64 %a) {<br class="">+entry:<br class="">+  %cmp = icmp slt i64 %a, 0<br class="">+  br i1 %cmp, label %land.lhs.true, label %lor.rhs<br class="">+<br class="">+land.lhs.true:                                    ; preds = %entry<br class="">+  br label %lor.end<br class="">+<br class="">+; CHECK-LABEL: lor.rhs:<br class="">+; CHECK-NOT: icmp sgt i64 %a, 0<br class="">+; CHECK: icmp eq i64 %a, 0<br class="">+lor.rhs:                                          ; preds = %entry<br class="">+  %cmp2 = icmp sgt i64 %a, 0<br class="">+  br i1 %cmp2, label %land.rhs, label %lor.end<br class="">+<br class="">+land.rhs:                                         ; preds = %lor.rhs<br class="">+  br label %lor.end<br class="">+<br class="">+lor.end:                                          ; preds = %land.rhs, %lor.rhs, %land.lhs.true<br class="">+  ret void<br class="">+}<br class="">+<br class="">+; CHECK-LABEL: @idom_sign_bit_check_edge_not_dominates<br class="">+define void @idom_sign_bit_check_edge_not_dominates(i64 %a) {<br class="">+entry:<br class="">+  %cmp = icmp slt i64 %a, 0<br class="">+  br i1 %cmp, label %land.lhs.true, label %lor.rhs<br class="">+<br class="">+land.lhs.true:                                    ; preds = %entry<br class="">+  br i1 undef, label %lor.end, label %lor.rhs<br class="">+<br class="">+; CHECK-LABEL: lor.rhs:<br class="">+; CHECK: icmp sgt i64 %a, 0<br class="">+; CHECK-NOT: icmp eq i64 %a, 0<br class="">+lor.rhs:                                          ; preds = %land.lhs.true, %entry<br class="">+  %cmp2 = icmp sgt i64 %a, 0<br class="">+  br i1 %cmp2, label %land.rhs, label %lor.end<br class="">+<br class="">+land.rhs:                                         ; preds = %lor.rhs<br class="">+  br label %lor.end<br class="">+<br class="">+lor.end:                                          ; preds = %land.rhs, %lor.rhs, %land.lhs.true<br class="">+  ret void<br class="">+}<br class="">+<br class="">+; CHECK-LABEL: @idom_sign_bit_check_edge_dominates_select<br class="">+define void @idom_sign_bit_check_edge_dominates_select(i64 %a, i64 %b) {<br class="">+entry:<br class="">+  %cmp = icmp slt i64 %a, 5<br class="">+  br i1 %cmp, label %land.lhs.true, label %lor.rhs<br class="">+<br class="">+land.lhs.true:                                    ; preds = %entry<br class="">+  br label %lor.end<br class="">+<br class="">+; CHECK-LABEL: lor.rhs:<br class="">+; CHECK-NOT: [[B:%.*]] = icmp sgt i64 %a, 5<br class="">+; CHECK: [[C:%.*]] = icmp eq i64 %a, %b<br class="">+; CHECK-NOT: [[D:%.*]] = select i1 [[B]], i64 %a, i64 5<br class="">+; CHECK-NOT: icmp ne i64 [[D]], %b<br class="">+; CHECK-NEXT: br i1 [[C]], label %lor.end, label %land.rhs<br class="">+lor.rhs:                                          ; preds = %entry<br class="">+  %cmp2 = icmp sgt i64 %a, 5<br class="">+  %select = select i1 %cmp2, i64 %a, i64 5<br class="">+  %cmp3 = icmp ne i64 %select, %b<br class="">+  br i1 %cmp3, label %land.rhs, label %lor.end<br class="">+<br class="">+land.rhs:                                         ; preds = %lor.rhs<br class="">+  br label %lor.end<br class="">+<br class="">+lor.end:                                          ; preds = %land.rhs, %lor.rhs, %land.lhs.true<br class="">+  ret void<br class="">+}<br class="">+<br class="">+; CHECK-LABEL: @idom_zbranch<br class="">+define void @idom_zbranch(i64 %a) {<br class="">+entry:<br class="">+  %cmp = icmp sgt i64 %a, 0<br class="">+  br i1 %cmp, label %lor.end, label %lor.rhs<br class="">+<br class="">+; CHECK-LABEL: lor.rhs:<br class="">+; CHECK: icmp slt i64 %a, 0<br class="">+; CHECK-NOT: icmp eq i64 %a, 0<br class="">+lor.rhs:                                          ; preds = %entry<br class="">+  %cmp2 = icmp slt i64 %a, 0<br class="">+  br i1 %cmp2, label %land.rhs, label %lor.end<br class="">+<br class="">+land.rhs:                                         ; preds = %lor.rhs<br class="">+  br label %lor.end<br class="">+<br class="">+lor.end:                                          ; preds = %land.rhs, %lor.rhs<br class="">+  ret void<br class="">+}<br class="">+<br class="">+; CHECK-LABEL: @idom_not_zbranch<br class="">+define void @idom_not_zbranch(i32 %a, i32 %b) {<br class="">+entry:<br class="">+  %cmp = icmp sgt i32 %a, 0<br class="">+  br i1 %cmp, label %return, label %if.end<br class="">+<br class="">+; CHECK-LABEL: if.end:<br class="">+; CHECK-NOT: [[B:%.*]] = icmp slt i32 %a, 0<br class="">+; CHECK: [[C:%.*]] = icmp eq i32 %a, %b<br class="">+; CHECK-NOT: [[D:%.*]] = select i1 [[B]], i32 %a, i32 0<br class="">+; CHECK-NOT: icmp ne i32 [[D]], %b<br class="">+; CHECK-NEXT: br i1 [[C]], label %return, label %if.then3<br class="">+if.end:                                           ; preds = %entry<br class="">+  %cmp1 = icmp slt i32 %a, 0<br class="">+  %a. = select i1 %cmp1, i32 %a, i32 0<br class="">+  %cmp2 = icmp ne i32 %a., %b<br class="">+  br i1 %cmp2, label %if.then3, label %return<br class="">+<br class="">+if.then3:                                         ; preds = %if.end<br class="">+  br label %return<br class="">+<br class="">+return:                                           ; preds = %if.end, %entry, %if.then3<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@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits<br class=""></div></div></blockquote></div><br class=""></div></body></html>