[X86][AVX] isHorizontalBinOp - relax no-lane-crossing limit for AVX1-only targets.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 29 Jul 2020 18:52:11 +0000 (19:52 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 29 Jul 2020 19:49:10 +0000 (20:49 +0100)
commita1c9529e602adcc25162f93fd4563fbe3d04ab62
treeb3155580a8420f6e8e06b03719a00de2c1bb5e8f
parente980913831c1dfe5ce443a0b4f7a551c992133b8
[X86][AVX] isHorizontalBinOp - relax no-lane-crossing limit for AVX1-only targets.

Instead of never accepting v8f32/v4f64 FHADD/FHSUB if the input shuffle masks cross lanes, perform the matching and determine if the post shuffle mask simplifies to a 'whole lane shuffle' mask - in which case we are guaranteed to cheaply perform this as a VPERM2F128 shuffle.
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/haddsub-4.ll