[X86][AVX] lowerShuffleAsBroadcast - improve load folding by avoiding bitcasts
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 13 Mar 2019 12:20:39 +0000 (12:20 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 13 Mar 2019 12:20:39 +0000 (12:20 +0000)
commit7abbd7030017beb60d27f1608e2a6b058dac7e4f
treea3af00dc243e189e0f64d68808f69d48ac863a70
parent8eacea80ad609ec45d4ee6326ca439b8dfd6769f
[X86][AVX] lowerShuffleAsBroadcast - improve load folding by avoiding bitcasts

AVX1 broadcasts were failing as we were adding bitcasts that caused MayFoldLoad's hasOneUse to return false.

This patch stops introducing bitcasts so early and also replaces the broadcast index scaling through bitcasts (which can't succeed in some cases) to instead just keep track of the bitoffset which can be converted back to the broadcast index later on.

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

llvm-svn: 356043
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/widened-broadcast.ll