1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

[LegalizeVectorOps] After custom legalizing an extending load or a truncating store, make sure the custom code is also legal.

For example, on X86 we emit a sign_extend_vector_inreg from LowerLoad and without sse4.1 this node will need further legalization. Previously this sign_extend_vector_inreg was being custom lowered during DAG legalization instead of vector op legalization.

Unfortunately, this doesn't seem to matter for the output of any existing lit tests.

llvm-svn: 347094
This commit is contained in:
Craig Topper 2018-11-16 21:04:58 +00:00
parent 6e1871b7a0
commit 5e9b1cae8f

View File

@ -244,7 +244,11 @@ SDValue VectorLegalizer::LegalizeOp(SDValue Op) {
if (SDValue Lowered = TLI.LowerOperation(Result, DAG)) {
assert(Lowered->getNumValues() == Op->getNumValues() &&
"Unexpected number of results");
Changed = Lowered != Result;
if (Lowered != Result) {
// Make sure the new code is also legal.
Lowered = LegalizeOp(Lowered);
Changed = true;
}
return TranslateLegalizeResults(Op, Lowered);
}
LLVM_FALLTHROUGH;
@ -266,7 +270,11 @@ SDValue VectorLegalizer::LegalizeOp(SDValue Op) {
return TranslateLegalizeResults(Op, Result);
case TargetLowering::Custom: {
SDValue Lowered = TLI.LowerOperation(Result, DAG);
Changed = Lowered != Result;
if (Lowered != Result) {
// Make sure the new code is also legal.
Lowered = LegalizeOp(Lowered);
Changed = true;
}
return TranslateLegalizeResults(Op, Lowered);
}
case TargetLowering::Expand: