[PATCH] D80943: [X86] Add a flag to guard the wide load

Guozhi Wei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 1 16:16:51 PDT 2020


Carrot marked 4 inline comments as done.
Carrot added a comment.

In D80943#2067284 <https://reviews.llvm.org/D80943#2067284>, @efriedma wrote:

> See https://reviews.llvm.org/rL51019 for the original commit.
>
> The benefits of matching loadi32 like this are:
>
> 1. mov is one byte shorter than movzx
> 2. We can fold the load into a subsequent 32-bit instruction in some cases.
>
>   And the downside, of course, is that if we're unlucky and create a hazard, there's a performance hit.


Thanks for the background information. The new flag is on by default, so it doesn't change anything if it is not explicitly disabled.

And if the wide load hit a narrow store, the penalty is much larger than a separate alu instruction, because it must wait until all instructions before (and including) the narrow store retired.



================
Comment at: llvm/lib/Target/X86/X86InstrInfo.td:1135
     return true;
-  if (ExtType == ISD::EXTLOAD)
+  if (ExtType == ISD::EXTLOAD && Subtarget->enableWideLoad())
     return LD->getAlignment() >= 4 && LD->isSimple();
----------------
craig.topper wrote:
> Why not do this in loadi16 as well?
LLVM IR doesn't have anyext, I failed to write a test case to trigger it. :(


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80943/new/

https://reviews.llvm.org/D80943





More information about the llvm-commits mailing list