[PATCH] D40649: [InstCombine] Don't crash on out of bounds shifts

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 10:22:45 PST 2017


spatel added a comment.

In https://reviews.llvm.org/D40649#942349, @igor-laevsky wrote:

> No, unfortunately your patch doesn't fix the problem. I believe those are two different paths in the code.


Ah - I see what happened. I was only trying my reduced case. In the example here, we're getting into computeKnownBitsFromAssume() from the 'and'.

But I think my draft wasn't a waste. Try this test too:

define i128 @test1(i128 %a) {

  %and1 = and i128 %a, 3
  %B = lshr i128 %and1, -1
  %cmp = icmp eq i128 %B, 1
  tail call void @llvm.assume(i1 %cmp)
  ret i128 %and1

}


https://reviews.llvm.org/D40649





More information about the llvm-commits mailing list