[PATCH] D17032: [X86] Add a pass to change byte and word instructions to zero-extending versions.

Kevin B. Smith via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 10 15:32:52 PST 2016


kbsmith1 added a comment.

In http://reviews.llvm.org/D17032#349204, @spatel wrote:

> In http://reviews.llvm.org/D17032#349091, @kbsmith1 wrote:
>
> > Eric - My expectation is this could be used both to get rid or partial stall code in other places, but I really don't know where those other places are at this time.  If you have suggestions for places to look at for that, I'd like to look into fixing them using this.
>
>
> There are a few spots that I know of:
>
> 1. X86TargetLowering::EmitCmp() has the change introduced with http://reviews.llvm.org/rL195496 .
> 2. The ExecutionDepsFix pass uses getPartialRegUpdateClearance() and getUndefRegClearance() to insert xor insts ( https://llvm.org/bugs/show_bug.cgi?id=22024 ).
> 3. PerformTargetShuffleCombine() has a comment about movsd vs. blendpd.
>
>   There are probably other cases in X86ISelLowering. It would be good to consolidate those kinds of transforms in a machine pass. So it may be worth renaming this to something more general (FixupPartialRegStalls?) before checking it in just to save on some naming churn.


I named it X86FixupBWInsts because the analysis needed to prove safety was going to be specific to the byte and word insts; that is to prove that only the specific byte/word reg that was the destination of the instruction was going to be "live" out of the instruction, so that these could be changed in any way that was useful.  One example would be to change addw reg16,small_immediate into add reg32,small_immediate, as this could provide a code size saving.  And I hadn't intended for it to be able to resolve partial updates of XMM or other SIMD types instructions, as the analysis needed for that is different.  Given those considerations, I thought X86FixupBWInsts was a more appropriate name.  But if after hearing this explanation, you (or others) feel strongly about using a different file name, I will change it.


http://reviews.llvm.org/D17032





More information about the llvm-commits mailing list