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:
parent
b410d6597f
commit
4fa5e95608
@ -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));
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user