[all-commits] [llvm/llvm-project] 931ec7: [X86][AVX] Don't fold PEXTR(VBROADCAST_LOAD(X)) ->...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Tue Jul 7 11:14:46 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 931ec74f7a29f53e18b574dc9500012ecbeba23a
      https://github.com/llvm/llvm-project/commit/931ec74f7a29f53e18b574dc9500012ecbeba23a
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2020-07-07 (Tue, 07 Jul 2020)

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

  Log Message:
  -----------
  [X86][AVX] Don't fold PEXTR(VBROADCAST_LOAD(X)) -> LOAD(X).

We were checking the VBROADCAST_LOAD element size against the extraction destination size instead of the extracted vector element size - PEXTRW/PEXTB have implicit zext'ing so have i32 destination sizes for v8i16/v16i8 vectors, resulting in us extracting from the wrong part of a load.

This patch bails from the fold if the vector element sizes don't match, and we now use the target constant extraction code later on like the pre-AVX2 targets, fixing the test case.

Found by internal fuzzing tests.




More information about the All-commits mailing list