ARM & AArch64: teach LowerVSETCC that output type size may differ from input.
authorTim Northover <tnorthover@apple.com>
Sun, 8 Feb 2015 00:50:47 +0000 (00:50 +0000)
committerTim Northover <tnorthover@apple.com>
Sun, 8 Feb 2015 00:50:47 +0000 (00:50 +0000)
commit848d8129318fb3df25ff49b4bbfd52b341202d78
treeb95f9920577ea726675093d094f49d84fe59a833
parent2c797c6dc425e68b4e06ae74a5cf3671295578ab
ARM & AArch64: teach LowerVSETCC that output type size may differ from input.

While various DAG combines try to guarantee that a vector SETCC
operation will have the same output size as input, there's nothing
intrinsic to either creation or LegalizeTypes that actually guarantees
it, so the function needs to be ready to handle a mismatch.

Fortunately this is easy enough, just extend or truncate the naturally
compared result.

I couldn't reproduce the failure in other backends that I know have
SIMD, so it's probably only an issue for these two due to shared
heritage.

Should fix PR21645.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228518 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64ISelLowering.cpp
lib/Target/ARM/ARMISelLowering.cpp
test/CodeGen/AArch64/setcc-type-mismatch.ll [new file with mode: 0644]
test/CodeGen/ARM/setcc-type-mismatch.ll [new file with mode: 0644]