llvm.org GIT mirror llvm / cc6cfc7
[TargetLowering] Add hook for adding target MMO flags when doing ISel. Summary: Add TargetLowering hook getMMOFlags() to add target specific MMO flags to load/store instructions created by ISel. Reviewers: bogner, hfinkel, qcolombet, MatzeB Subscribers: mcrosier, javed.absar, llvm-commits Differential Revision: https://reviews.llvm.org/D34962 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307879 91177308-0d34-0410-b5e6-96231b3b80d8 Geoff Berry 3 years ago
2 changed file(s) with 9 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
30753075 return Chain;
30763076 }
30773077
3078 /// This callback is used to inspect load/store instructions and add
3079 /// target-specific MachineMemOperand flags to them. The default
3080 /// implementation does nothing.
3081 virtual MachineMemOperand::Flags getMMOFlags(const Instruction &I) const {
3082 return MachineMemOperand::MONone;
3083 }
3084
30783085 /// This callback is invoked by the type legalizer to legalize nodes with an
30793086 /// illegal operand type but legal result types. It replaces the
30803087 /// LowerOperation callback in the type Legalizer. The reason we can not do
35703570 MMOFlags |= MachineMemOperand::MOInvariant;
35713571 if (isDereferenceable)
35723572 MMOFlags |= MachineMemOperand::MODereferenceable;
3573 MMOFlags |= TLI.getMMOFlags(I);
35733574
35743575 SDValue L = DAG.getLoad(ValueVTs[i], dl, Root, A,
35753576 MachinePointerInfo(SV, Offsets[i]), Alignment,
36993700 MMOFlags |= MachineMemOperand::MOVolatile;
37003701 if (I.getMetadata(LLVMContext::MD_nontemporal) != nullptr)
37013702 MMOFlags |= MachineMemOperand::MONonTemporal;
3703 MMOFlags |= TLI.getMMOFlags(I);
37023704
37033705 // An aggregate load cannot wrap around the address space, so offsets to its
37043706 // parts don't wrap either.