llvm.org GIT mirror llvm / be186ac
Add custom type for PseudoSourceValue Summary: PseudoSourceValue can be used to attach a target specific value for "well behaved" side-effects lowered from target specific intrinsics. This is useful whenever there is not an LLVM IR Value around when representing such "well behaved" side-effected operations in backends by attaching a MachineMemOperand with a custom PseudoSourceValue as this makes the scheduler not treating them as "GlobalMemoryObjects" which triggers a logic that makes the operation act like a barrier in the Schedule DAG. This patch adds another Kind to the PseudoSourceValue object which is "TargetCustom". It indicates a type of PseudoSourceValue that has a target specific meaning (aka. LLVM shouldn't assume any specific usage for such a PSV). It supports the possibility of having many different kinds of "TargetCustom" PseudoSourceValues. We had a discussion about if this was valuable or not (in particular because there was a believe that PSV were going away sooner or later) but seems like they are not going anywhere and I think they are useful backend side. It is not clear the interaction of this with MIRParser (do we need a target hook to parse these?) and I would like a comment from Alex about that :) Reviewers: arphaman, hfinkel, arsenm Subscribers: Eugene.Zelenko, llvm-commits Patch By: Marcello Maggioni Differential Revision: https://reviews.llvm.org/D13575 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290037 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 3 years ago
2 changed file(s) with 8 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
4141 ConstantPool,
4242 FixedStack,
4343 GlobalValueCallEntry,
44 ExternalSymbolCallEntry
44 ExternalSymbolCallEntry,
45 TargetCustom
4546 };
4647
4748 private:
6667 bool isGOT() const { return Kind == GOT; }
6768 bool isConstantPool() const { return Kind == ConstantPool; }
6869 bool isJumpTable() const { return Kind == JumpTable; }
70 unsigned getTargetCustom() const {
71 return (Kind >= TargetCustom) ? ((Kind+1) - TargetCustom) : 0;
72 }
6973
7074 /// Test whether the memory pointed to by this PseudoSourceValue has a
7175 /// constant value.
959959 printLLVMNameWithoutPrefix(
960960 OS, cast(PVal)->getSymbol());
961961 break;
962 case PseudoSourceValue::TargetCustom:
963 llvm_unreachable("TargetCustom pseudo source values are not supported");
964 break;
962965 }
963966 }
964967 printOffset(Op.getOffset());