[PATCH] D32277: Replace slow LEA instructions in X86

Lama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 25 01:44:26 PDT 2017


lsaba added a comment.

In https://reviews.llvm.org/D32277#733146, @aqjune wrote:

> @skatkov Well, the assemblies also included `leal` with `r13` register as well. :)
>
>   102     leal    8(%r14), %eax
>
>
> ->
>
>   102     leal    8(%r13), %eax
>
>
>   The performance gap may be due to the instruction, but I'm not sure. (actually, converting `r14` to `r13` increased performance in this case, but I have no idea what's happening inside CPU..)


I double checked these two instruction and performed a test of my own, the r13 version is not slower, looks like the problem is somewhere else in the code



================
Comment at: lib/Target/X86/X86FixupLEAs.cpp:633
+        if (MF.getSubtarget<X86Subtarget>().slowLEA())
+          processInstructionForSNBPlus(I, MFI);
+        else
----------------
RKSimon wrote:
> Is it a good idea to directly associate a general (and very vague....) feature bit with a specific set of targets like this?
I am not sure I understand the comment, are you referring to the usage of the SlowLEA feature specifically? or to limiting the optimization to a set of targets using a feature in general? Do you have other suggestions?


https://reviews.llvm.org/D32277





More information about the llvm-commits mailing list