[llvm-commits] [PATCH] miscompile due to incorrect MOVSS pattern

Bruno Cardoso Lopes bruno.cardoso at gmail.com
Wed Aug 10 10:48:06 PDT 2011


Hi Tanya,

On Tue, Aug 9, 2011 at 10:52 PM, Tanya Lattner <lattner at apple.com> wrote:
> I believe the following X86 pattern is incorrect:
> def : Pat<(X86Movss VR128:$src1,
>                    (bc_v4i32 (v2i64 (load addr:$src2)))),
>          (MOVLPSrm VR128:$src1, addr:$src2)>;
>
> This matches a MOVSS dag with a MOVLPS instruction. However, MOVSS will replace only the low 32 bits of the register, while the MOVLPS instruction will replace the low 64 bits.
>
> I've added my test case that illustrates the bug and also modified the one that was already present.
>
> Bruno - You seem to have added this pattern, so let me know if this is supposed to use some other instruction. It's not clear what you're trying to achieve with this pattern, so  my patch just removes it.

This happened to trigger some testcases, but since it doesn't anymore
and you have testcases where this is yielding wrong behavior it's
better just to apply this, if this come back during shuffle rewriting
I'll provide a fix. Thanks. Applied in r137227!

-- 
Bruno Cardoso Lopes
http://www.brunocardoso.cc




More information about the llvm-commits mailing list