[PATCH] Fix generic shift expansion when shift amount is 0
Sanjoy Das
sanjoy at playingwithpointers.com
Fri Mar 13 13:52:33 PDT 2015
In http://reviews.llvm.org/D4978#140508, @chfast wrote:
> In http://reviews.llvm.org/D4978#136194, @sanjoy wrote:
>
> > Shallow, drop-by comment: does it make sense to generate a DAG that can be combined into a `BEXTR` when possible?
>
>
> Can you explain more?
For a left shift, I think `HiResult` can be `HiInput << ShiftAmt | BEXTR LoInput, Start = (WordSize - ShiftAmt), Len = ShiftAmt`. This will do the right thing for `ShiftAmt = 0`.
I think many x86 CPUs do not support `BEXTR` so either this will have be a target dependent thing, or have to be a pattern that the DAG combiner will fold into a `BEXTR`.
In any case, this is very minor.
http://reviews.llvm.org/D4978
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list