[PATCH] Added llvm.is.constant intrinsic

Sobczak, Janusz janusz.sobczak at mobica.com
Mon Jun 30 06:04:21 PDT 2014


On 30 June 2014 13:13, Joerg Sonnenberger <joerg at britannica.bec.de> wrote:

> On Mon, Jun 30, 2014 at 10:45:24AM +0200, Sobczak, Janusz wrote:
> > I'm thinking about modyfing __builtin_constant_p() implementation in
> clang
> > to do this (for integer arguments):
> > if (argument is known to be constant)
> >     replace  __builtin_constant_p() with 1 (True)
> > else
> >    replace __builtin_constant_p() with @llvm.is_constant() IR
>
> What is the intended use case here? All cases that *I* consider to be
> sane applications of __builtin_constant_p are workaround for target
> specific features that are better exposed as intrinsics themselve, e.g.
> IO asm instructions on x86. It is one of the most abused features of
> GCC, especially since it can introduce magic variance due to optimizer
> changes.
>

Please read the discussion here: http://llvm.org/bugs/show_bug.cgi?id=4898


-- 
Janusz Sobczak
Mobica Ltd
www.mobica.com <http://www.mobica.com>


*Mobica is a provider of software engineering, testing and consultancy
services based in the UK, Poland and the USA, with a worldwide customer
base. We have a proven track record in delivering innovative solutions to
some of the world’s best-known companies in a range of sectors including
Automotive, Mobile, Semiconductor, Finance, TV, Marine and Aviation.*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140630/31fc5d68/attachment.html>


More information about the llvm-commits mailing list