Skip to content
Commit a5b662a8 authored by Nemanja Ivanovic's avatar Nemanja Ivanovic
Browse files

[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
parent 7783bba2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment