The MachineFunction wasn't used in getOptimalMemOpType, and this allows reuse of
findOptimalMemOpLowering that is calling getOptimalMemOpType.
This is the groundwork for the change in D59766
Paths
| Differential D59785
[TargetLowering] Change getOptimalMemOpType to take a function attribute list ClosedPublic Authored by SjoerdMeijer on Mar 25 2019, 11:07 AM.
Details Summary The MachineFunction wasn't used in getOptimalMemOpType, and this allows reuse of This is the groundwork for the change in D59766
Diff Detail
Event TimelineHerald added subscribers: jsji, atanasyan, kbarton and 6 others. · View Herald TranscriptMar 25 2019, 11:07 AM SjoerdMeijer added a child revision: D59787: [ARM] Implement TTI::getMemcpyCost.Mar 26 2019, 1:49 PM Comment Actions I glanced over the implementations and it seems like they only use the function to check its attributes. If that's the case, IMO we should just pass that in as a flag (or just the attributes), rather than unnecessarily passing in the function (requiring access to the function seems a bit odd to me, just to get the memory operation type) Comment Actions Hi Florian, thanks for taking a look!
Yep, that's correct. Most implementations don't actually use it, but if they do, they query the function attributes.
The MachineFunction is definitely a bit odd. I definitely don't mind passing just the function attributes, but thought that passing the Function would not be totally unreasonable, as we keep our options more open just in case someone would like to use it (perhaps downstream users). Comment Actions Hi Florian, just to clarify my previous message. I would be more than happy to change it, but was only curious if just passing function attributes was too restrictive somehow. Let me know what you think. Would you mind having a quick look at D59787 too? :-) Cheers. SjoerdMeijer retitled this revision from [TargetLowering] Change getOptimalMemOpType to take a Function instead of a MachineFunction to [TargetLowering] Change getOptimalMemOpType to take a function attribute list. Comment ActionsPass the Function AttributeList instead of a Function. Comment Actions LGTM, just change to pass by reference before submitting.
This revision is now accepted and ready to land.Apr 29 2019, 1:51 AM Closed by commit rL359537: [TargetLowering] Change getOptimalMemOpType to take a function attribute list (authored by SjoerdMeijer). · Explain WhyApr 30 2019, 1:37 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 197270 llvm/trunk/include/llvm/CodeGen/TargetLowering.h
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.h
llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/trunk/lib/Target/AMDGPU/SIISelLowering.h
llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp
llvm/trunk/lib/Target/ARM/ARMISelLowering.h
llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
llvm/trunk/lib/Target/BPF/BPFISelLowering.h
llvm/trunk/lib/Target/Hexagon/HexagonISelLowering.h
llvm/trunk/lib/Target/Hexagon/HexagonISelLowering.cpp
llvm/trunk/lib/Target/Mips/MipsISelLowering.h
llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
llvm/trunk/lib/Target/PowerPC/PPCISelLowering.h
llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/trunk/lib/Target/X86/X86ISelLowering.h
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
|