1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 13:11:39 +01:00

GlobalISel: Drop original type pointeriness in minScalarSameAs

It is not useful to report WidenScalar for a pointer value, so always
report a scalar value with the target size. This allows using this to
clamp the scalar operand to the pointer size in operations like
G_PTR_ADD or G_PTRMASK.
This commit is contained in:
Matt Arsenault 2020-07-22 09:52:49 -04:00
parent b410d6597f
commit 4fa5e95608

View File

@ -894,9 +894,10 @@ public:
Query.Types[TypeIdx].getSizeInBits();
},
[=](const LegalityQuery &Query) {
LLT T = Query.Types[LargeTypeIdx];
return std::make_pair(TypeIdx,
T.isVector() ? T.getElementType() : T);
const LLT Ty = Query.Types[TypeIdx];
const LLT LargeTy = Query.Types[LargeTypeIdx];
LLT NewEltTy = LLT::scalar(LargeTy.getScalarSizeInBits());
return std::make_pair(TypeIdx, Ty.changeElementType(NewEltTy));
});
}