[llvm] r224899 - [CodeGenPrepare] Teach when it is profitable to speculate calls to @llvm.cttz/ctlz.

Andrea Di Biagio andrea.dibiagio at gmail.com
Fri Jan 2 02:41:00 PST 2015


Thanks for the feedback Paul.
I will fix the comments.

Cheers,
Andrea

On Thu, Jan 1, 2015 at 10:04 PM, Robinson, Paul
<Paul_Robinson at playstation.sony.com> wrote:
> Hi Andrea, one comment comment...
>
>> +bool X86TargetLowering::isCheapToSpeculateCttz() const {
>> +  // Don't try to speculate cttz if we can't directly use TZCNT.
>> +  return Subtarget->hasBMI();
>> +}
>> +
>> +bool X86TargetLowering::isCheapToSpeculateCtlz() const {
>> +  // Don't try to speculate ctlz if we can't directly use LZCNT.
>> +  return Subtarget->hasLZCNT();
>
> These predicates default to "don't speculate" so the point here is
> what conditions should override the default; and phrasing those as
> positive statements would be easier to read than double-negatives.
> Maybe something like:
> // Speculate cttz only if we can directly use TZCNT.
> and similar for ctlz.
>
> Thanks,
> --paulr
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list