[llvm] r243361 - fix invalid load folding with SSE/AVX FP logical instructions (PR22371)

Hans Wennborg hans at chromium.org
Tue Jul 28 09:20:49 PDT 2015


Merged to 3.7 in r243435 as per discussion on the code review.

On Mon, Jul 27, 2015 at 5:48 PM, Sanjay Patel <spatel at rotateright.com> wrote:
> Author: spatel
> Date: Mon Jul 27 19:48:32 2015
> New Revision: 243361
>
> URL: http://llvm.org/viewvc/llvm-project?rev=243361&view=rev
> Log:
> fix invalid load folding with SSE/AVX FP logical instructions (PR22371)
>
> This is a follow-up to the FIXME that was added with D7474 ( http://reviews.llvm.org/rL229531 ).
> I thought this load folding bug had been made hard-to-hit, but it turns out to be very easy
> when targeting 32-bit x86 and causes a miscompile/crash in Wine:
> https://bugs.winehq.org/show_bug.cgi?id=38826
> https://llvm.org/bugs/show_bug.cgi?id=22371#c25
>
> The quick fix is to simply remove the scalar FP logical instructions from the load folding table
> in X86InstrInfo, but that causes us to miss load folds that should be possible when lowering fabs,
> fneg, fcopysign. So the majority of this patch is altering those lowerings to use *vector* FP
> logical instructions (because that's all x86 gives us anyway). That lets us do the load folding
> legally.
>
> Differential Revision: http://reviews.llvm.org/D11477



More information about the llvm-commits mailing list