[DAGCombine] Fix bug in load scalarization
authorFraser Cormack <fraser@codeplay.com>
Tue, 21 Apr 2020 15:23:11 +0000 (16:23 +0100)
committerFraser Cormack <fraser@codeplay.com>
Wed, 4 Nov 2020 19:02:40 +0000 (19:02 +0000)
commitf99580c1e57885c8337a7deb08459095f4c16422
tree7ae953352cf8d8bf5310a817cc5445957a173d3b
parent0df0d0fe2d1fd1436d36f736e3ed47a0c69673da
[DAGCombine] Fix bug in load scalarization

Summary:
For vector element types which are not byte-sized, we would generate
incorrect scalar offsets and produce incorrect codegen.

This optimization could potentially be supported in the future, e.g. by
loading in bytes, then shifting and masking out the remaining bits of
the vector element. However, without an upstream target to test against
it's best to avoid the bad codegen in the simplest possible way.

Related to this bug:

  https://bugs.llvm.org/show_bug.cgi?id=27600

Reviewed by: foad

Differential Revision: https://reviews.llvm.org/D78568
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AMDGPU/extract-load-i1.ll