[all-commits] [llvm/llvm-project] a5b662: [SelectionDAG] Correctly widen bitcast of scalar t...
Nemanja Ivanovic via All-commits
all-commits at lists.llvm.org
Thu Feb 2 10:01:31 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: a5b662a834fde4188a26fd83ed26745fc4c1bc06
https://github.com/llvm/llvm-project/commit/a5b662a834fde4188a26fd83ed26745fc4c1bc06
Author: Nemanja Ivanovic <nemanja.i.ibm at gmail.com>
Date: 2023-02-02 (Thu, 02 Feb 2023)
Changed paths:
M llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
M llvm/test/CodeGen/PowerPC/vec_conv_i8_to_fp32_elts.ll
M llvm/test/CodeGen/PowerPC/vec_conv_i8_to_fp64_elts.ll
A llvm/test/CodeGen/PowerPC/widen-vec-correctly-be.ll
Log Message:
-----------
[SelectionDAG] Correctly widen bitcast of scalar to vector for big endian
For big endian targets that need a node such as this:
v2i8 = bitcast i16:tN
legalized by:
1. Promoting the i16 input type
2. Widening the v2i32 result type
The result will be incorrect because the legalizer will promote
the input type and then produce a scalar_to_vector from that
wider type to a vector of N elements of that type. That puts
the desired bits into the low order bytes of element zero and
they need to be in the high order bytes on big endian systems.
This patch changes the legalization to widen to a vector with
elements of the original scalar size.
Differential revision: https://reviews.llvm.org/D140365
More information about the All-commits
mailing list