[llvm] [CodeGen] Fixed vector halving bug for masked load
authoraartbik <ajcbik@google.com>
Thu, 23 Apr 2020 18:28:34 +0000 (11:28 -0700)
committeraartbik <ajcbik@google.com>
Thu, 23 Apr 2020 22:12:44 +0000 (15:12 -0700)
commit907871d9ad2dfc5bc96fb49e897aa68c45f32e80
treecdb8b4573b8d8523d0592c4c6d139f2c26b14349
parente4e187d203e3a2ab1375630da35701a4536c2ec6
[llvm] [CodeGen] Fixed vector halving bug for masked load

Summary:
Given a VL=14 that is enveloped by a proper VL=16, splitting the
masked load using the enveloping halving VL=8/8 should yields
should eventually yield V=8/5. This fixes various assert failures
in getHalfNumVectorElementsVT() and IncrementMemoryAddress().

Note, I suspect similar fixes will be needed for other masked
operations, but for now I send out a fix for masked load only.

Bugzilla issue 45563
https://bugs.llvm.org/show_bug.cgi?id=45563

Reviewers: craig.topper, mehdi_amini, nicolasvasilache

Reviewed By: craig.topper

Subscribers: hiraditya, dmgreen, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78608
llvm/include/llvm/CodeGen/SelectionDAG.h
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/test/CodeGen/X86/pr45563-2.ll [new file with mode: 0644]