-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[CodeGen] Add SSID & Atomic Ordering to IntrinsicInfo #140896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5305,9 +5305,16 @@ void SelectionDAGBuilder::visitTargetIntrinsic(const CallInst &I, | |
MPI = MachinePointerInfo(Info.ptrVal, Info.offset); | ||
else if (Info.fallbackAddressSpace) | ||
MPI = MachinePointerInfo(*Info.fallbackAddressSpace); | ||
Result = DAG.getMemIntrinsicNode( | ||
Info.opc, getCurSDLoc(), VTs, Ops, Info.memVT, MPI, Info.align, | ||
Info.flags, LocationSize::precise(Info.size), I.getAAMetadata()); | ||
EVT MemVT = Info.memVT; | ||
LocationSize Size = LocationSize::precise(Info.size); | ||
if (Size.hasValue() && !Size.getValue()) | ||
Size = LocationSize::precise(MemVT.getStoreSize()); | ||
Align Alignment = Info.align.value_or(DAG.getEVTAlign(MemVT)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MaybeAlign should not exist. Particularly in this case, where the MaybeAlign is initialized to a concrete Align(1) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some targets use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which just shouldn't be done |
||
MachineMemOperand *MMO = DAG.getMachineFunction().getMachineMemOperand( | ||
MPI, Info.flags, Size, Alignment, I.getAAMetadata(), /*Ranges=*/nullptr, | ||
Info.ssid, Info.order, Info.failureOrder); | ||
Result = | ||
DAG.getMemIntrinsicNode(Info.opc, getCurSDLoc(), VTs, Ops, MemVT, MMO); | ||
} else if (!HasChain) { | ||
Result = DAG.getNode(ISD::INTRINSIC_WO_CHAIN, getCurSDLoc(), VTs, Ops); | ||
} else if (!I.getType()->isVoidTy()) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why you need to do anything related to the size here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is borrowed from
SelectionDAG::getMemIntrinsicNode
. Without it, I get size mismatches because there is an expectation that the value is initialized if it's zero.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this whole API needs an overhaul, it's a collection of hacking around making changes to existing implementations. It would be better if LocationSize was directly constructed from MemVT in the first place