Skip to content

Commit

Permalink
[AArch64] Modify read of threadpointer to be marked that it may load …
Browse files Browse the repository at this point in the history
…memory, rather than having unmodeled side effects.
  • Loading branch information
neboat committed Oct 21, 2023
1 parent 87df7da commit db598df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ static void RemoveUnusedGlue(SDNode *N, SelectionDAG *DAG) {
void ScheduleDAGSDNodes::ClusterNeighboringLoads(SDNode *Node) {
SDValue Chain;
unsigned NumOps = Node->getNumOperands();
if (NumOps == 0)
return;
if (Node->getOperand(NumOps-1).getValueType() == MVT::Other)
Chain = Node->getOperand(NumOps-1);
if (!Chain)
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AArch64/AArch64InstrInfo.td
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,7 @@ def : Pat<(AArch64mrs imm:$id),

// The thread pointer (on Linux, at least, where this has been implemented) is
// TPIDR_EL0.
let hasSideEffects = 1 in {
let mayLoad = 1 in {
def MOVbaseTLS : Pseudo<(outs GPR64:$dst), (ins),
[(set GPR64:$dst, AArch64threadpointer)]>, Sched<[WriteSys]>;
}
Expand Down

0 comments on commit db598df

Please sign in to comment.