diff options
author | Peter Rong <PeterRong96@gmail.com> | 2023-03-30 01:44:24 -0700 |
---|---|---|
committer | Peter Rong <PeterRong96@gmail.com> | 2023-03-30 19:20:04 -0700 |
commit | 51a93828d782dae09f2dc69aae53f4e6dd1ca98a (patch) | |
tree | eb5fc084957efa0b5403d06ae66607e5fb379c35 /llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp | |
parent | 962484aeca0cc6779899c95d59597f7240ea94ea (diff) | |
download | llvm-51a93828d782dae09f2dc69aae53f4e6dd1ca98a.zip llvm-51a93828d782dae09f2dc69aae53f4e6dd1ca98a.tar.gz llvm-51a93828d782dae09f2dc69aae53f4e6dd1ca98a.tar.bz2 |
[WASM] Fix legalizer for LowerBUILD_VECTOR.
Constants in BUILD_VECTOR may be down cast into a smaller value that fits LaneBits, i.e., the bit width of elements in the vector.
This cast didn't consider 2^N where it would be cast into -2^N, which still doesn't fit into LaneBits after casting.
This will cause an assertion in later legalization.
2^N should be cast into 0, and this patch reflects such behavior.
This patch also includes a test to reflect the fix.
This patch fixes [issue 61780](https://github.com/llvm/llvm-project/issues/61780)
Related patch: https://reviews.llvm.org/D108669
Reviewed By: tlively
Differential Revision: https://reviews.llvm.org/D147208
Diffstat (limited to 'llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp')
0 files changed, 0 insertions, 0 deletions