[all-commits] [llvm/llvm-project] 642eed: [x86] fix miscompile in buildvector v16i8 lowering

RotateRight via All-commits all-commits at lists.llvm.org
Tue Jul 7 10:02:53 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 642eed37134db4aca953704d1e4ae856af675f51
      https://github.com/llvm/llvm-project/commit/642eed37134db4aca953704d1e4ae856af675f51
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2020-07-07 (Tue, 07 Jul 2020)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/buildvec-insertvec.ll

  Log Message:
  -----------
  [x86] fix miscompile in buildvector v16i8 lowering

In the test based on PR46586:
https://bugs.llvm.org/show_bug.cgi?id=46586
...we are inserting 16-bits into the high element of the vector, shuffling it
to element 0, and extracting 32-bits. But xmm1 was never initialized, so the
top 16-bits of the extract are undef without this patch.

(It seems like we could do better than this by recognizing that we only demand
a subsection of the build vector, but I want to make sure we fix the
miscompile 1st.)

This path is only used for pre-SSE4.1, and simpler patterns get squashed
somewhere along the way, so the test still includes a 'urem' as it did in the
original test from the bug report.

Differential Revision: https://reviews.llvm.org/D83319




More information about the All-commits mailing list