Patch to postpone FoldAsLoadDefCandidates array clean to the moment before next loop iteration (when IsLoadFoldBarrier instruction met).
With this change, load may be folded into store instruction (for memory-to-memory copy). Or into call instruction, or into instruction with side effects.
Targets with memory-to-memory copy may override TargetInstrInfo::optimizeLoadInstr to implement such folding.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Hi Andrew,
This will need a test case.
Also, would it be clearer to just test the condition at the end of the loop?
CCing Manman as a reviewer, as I'm out on vacation, and may not have a chance to check in on this for a few days.
- Lang.
Comment Actions
'optimizeLoadInstr' function is used now only by X86-backend and there aren't any memory-to-memory instructions in X86 (to fold load argument into store-barrier instruction).
SystemZ-backend doesn't use this mechanics to produce MVC instruction for now.
So I couldn't create working test case for existing backends.
I think it may be usefull for SystemZ machine-level MVC instructions combining.