mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
Split SelectionDAGISel::IsLegalAndProfitableToFold to
IsLegalToFold and IsProfitableToFold. The generic version of the later simply checks whether the folding candidate has a single use. This allows the target isel routines more flexibility in deciding whether folding makes sense. The specific case we are interested in is folding constant pool loads with multiple uses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96255 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -594,8 +594,7 @@ bool SystemZDAGToDAGISel::SelectLAAddr(SDNode *Op, SDValue Addr,
|
||||
bool SystemZDAGToDAGISel::TryFoldLoad(SDNode *P, SDValue N,
|
||||
SDValue &Base, SDValue &Disp, SDValue &Index) {
|
||||
if (ISD::isNON_EXTLoad(N.getNode()) &&
|
||||
N.hasOneUse() &&
|
||||
IsLegalAndProfitableToFold(N.getNode(), P, P))
|
||||
IsLegalToFold(N, P, P))
|
||||
return SelectAddrRRI20(P, N.getOperand(1), Base, Disp, Index);
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user