forked from OSchip/llvm-project
[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:
parent
7fff9a9aef
commit
9e97054211
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue