mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Add target hook to prevent folding some bitcasted loads.
This is to avoid this transformation in some cases: fold (conv (load x)) -> (load (conv*)x) On architectures that don't natively support some vector loads efficiently casting the load to a smaller vector of larger types and loading is more efficient. Patch by Micah Villmow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194783 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -5768,7 +5768,8 @@ SDValue DAGCombiner::visitBITCAST(SDNode *N) {
|
||||
if (ISD::isNormalLoad(N0.getNode()) && N0.hasOneUse() &&
|
||||
// Do not change the width of a volatile load.
|
||||
!cast<LoadSDNode>(N0)->isVolatile() &&
|
||||
(!LegalOperations || TLI.isOperationLegal(ISD::LOAD, VT))) {
|
||||
(!LegalOperations || TLI.isOperationLegal(ISD::LOAD, VT)) &&
|
||||
TLI.isLoadBitCastBeneficial(N0.getValueType(), VT)) {
|
||||
LoadSDNode *LN0 = cast<LoadSDNode>(N0);
|
||||
unsigned Align = TLI.getDataLayout()->
|
||||
getABITypeAlignment(VT.getTypeForEVT(*DAG.getContext()));
|
||||
|
Reference in New Issue
Block a user