[llvm-commits] PATCH: new Value::getThruSplat API

Dan Gohman gohman at apple.com
Mon Nov 1 12:59:45 PDT 2010


On Oct 30, 2010, at 9:54 AM, Chris Lattner wrote:

> 
> On Oct 30, 2010, at 9:27 AM, Dan Gohman wrote:
> 
>> seems pretty readable.  And it would avoid the double-dyncast issue.  But I'm not attatched.
>> 
>> Or if you like:
>> 
>>  if (ConstantInt *CI = C->getAs<ConstantInt>())
>> 
>> clang uses some idioms like this, for example. *shrug*
> 
> How is this different than 
> 
> if (ConstantInt *CI = dyn_cast<ConstantInt>(C)) ?

For splat vectors, it would get the splat value.

Unless you're suggesting making dyn_cast<ConstantInt> do that.  Which
you could, I suppose.  That'd be dancing on the edge of just letting
ConstantInt and ConstantFP have vector types.

Dan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20101101/cc879864/attachment.html>


More information about the llvm-commits mailing list