[llvm-dev] superoptimizer evaluation

Sanjay Patel via llvm-dev llvm-dev at lists.llvm.org
Thu Nov 10 15:51:57 PST 2016


%0:i32 = var
%1:i32 = and 1:i32, %0
%2:i1 = ne 0:i32, %1
infer %2
%3:i1 = trunc %0
result %3

We canonicalize from a trunc to the and/icmp sequence. I'm not sure why.
Does anyone know the history?

  // Canonicalize trunc x to i1 -> (icmp ne (and x, 1), 0), likewise for
vector.
  if (DestTy->getScalarSizeInBits() == 1) {
    Constant *One = ConstantInt::get(SrcTy, 1);
    Src = Builder->CreateAnd(Src, One);
    Value *Zero = Constant::getNullValue(Src->getType());
    return new ICmpInst(ICmpInst::ICMP_NE, Src, Zero);
  }


On Wed, Nov 2, 2016 at 12:01 AM, John Regehr via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hello folks,
>
> Over the last few years I provided a few links (below) to some
> optimizations derived by Souper.
>
> I know that at least a few of these optimizations got implemented in LLVM
> but I don't have any good data on this. If you implemented any of these, or
> know of some that got implemented, could you drop me a line?
>
> Also I'll be at the upcoming dev meeting in San Jose and would love to
> chat with folks about this stuff.
>
> Thanks,
>
> John
>
> http://lists.llvm.org/pipermail/llvm-dev/2014-November/078971.html
> http://lists.llvm.org/pipermail/llvm-dev/2015-July/088481.html
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161110/b67e75ad/attachment.html>


More information about the llvm-dev mailing list