mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 21:18:19 +00:00
Don't prevent a vselect of constants from becoming a single load (PR20648).
Fix for PR20648 - http://llvm.org/bugs/show_bug.cgi?id=20648 This patch checks the operands of a vselect to see if all values are constants. If yes, bail out of any further attempts to create a blend or shuffle because SelectionDAGLegalize knows how to turn this kind of vselect into a single load. This already happens for machines without SSE4.1, so the added checks just send more targets down that path. Differential Revision: http://reviews.llvm.org/D4934 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216121 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -138,3 +138,13 @@ define <8 x i16> @blend_shufflevector_8xi16(<8 x i16> %a, <8 x i16> %b) {
|
||||
%1 = shufflevector <8 x i16> %a, <8 x i16> %b, <8 x i32> <i32 0, i32 9, i32 10, i32 3, i32 4, i32 5, i32 6, i32 15>
|
||||
ret <8 x i16> %1
|
||||
}
|
||||
|
||||
; PR20648 - a blend of constants isn't really a blend; it's just a constant pool load.
|
||||
; CHECK-LABEL: @does_not_blend
|
||||
; CHECK: movaps
|
||||
; CHECK-NEXT: ret
|
||||
define <4 x i32> @does_not_blend() {
|
||||
%select = select <4 x i1> <i1 1, i1 0, i1 0, i1 1>, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> <i32 2, i32 2, i32 2, i32 2>
|
||||
ret <4 x i32> %select
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user