Reordering two functions can slow down lld by 1.06 times

Ansari, Zia via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 7 16:11:32 PST 2016


Hi Rafael,

I took a super quick look last week, but haven't spent too much time on it due to prepping for the conferences.
Also, I couldn't build the test-case because of older libs, but I'll try and hunt down a system that can build it.

The quick look (sep and disassemblies) suggests mispredicts on an indirect branch that look like they may be caused due to some aliasing going on at the caller side. If this is the case, I'm not sure whether there will be a reasonable software fix for it (at the compiler level).

If the mispredicts go away on newer HW (same binaries), it's likely that the aliasing went away due to HW changes.

I'll spend a little more time on it and see what I can find.

Thanks,
Zia.

|-----Original Message-----
|From: Rafael EspĂ­ndola [mailto:rafael.espindola at gmail.com]
|Sent: Monday, November 07, 2016 6:03 AM
|To: Ansari, Zia <zia.ansari at intel.com>
|Cc: Mehdi Amini <mehdi.amini at apple.com>; llvm-commits <llvm-
|commits at lists.llvm.org>; Rui Ueyama <ruiu at google.com>; Davide Italiano
|<dccitaliano at gmail.com>
|Subject: Re: Reordering two functions can slow down lld by 1.06 times
|
|On 21 October 2016 at 12:24, Ansari, Zia <zia.ansari at intel.com> wrote:
|> OK.. I'm grabbing your reproducers and I'll take a look.
|
|In case it helps, I just tested this on a i7-7500U and got 2.53% branch misses for
|both binaries. Maybe the issue was fixed on kaby lake?
|
|Cheers,
|Rafael


More information about the llvm-commits mailing list