[PATCH] D141360: [PowerPC][GISel] Select sync instructions required by atomic operations
Kai Luo via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 10 07:20:21 PST 2023
lkail updated this revision to Diff 487800.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141360/new/
https://reviews.llvm.org/D141360
Files:
llvm/lib/Target/PowerPC/GISel/PPCRegisterBankInfo.cpp
llvm/test/CodeGen/PowerPC/GlobalISel/ppc-isel-sync.ll
Index: llvm/test/CodeGen/PowerPC/GlobalISel/ppc-isel-sync.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/PowerPC/GlobalISel/ppc-isel-sync.ll
@@ -0,0 +1,21 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -verify-machineinstrs -mtriple=powerpc64le -global-isel \
+; RUN: -ppc-asm-full-reg-names < %s | FileCheck %s
+
+declare void @llvm.ppc.isync()
+declare void @llvm.ppc.sync()
+declare void @llvm.ppc.lwsync()
+
+define void @test_sync() {
+; CHECK-LABEL: test_sync:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: isync
+; CHECK-NEXT: sync
+; CHECK-NEXT: lwsync
+; CHECK-NEXT: blr
+entry:
+ call void @llvm.ppc.isync()
+ call void @llvm.ppc.sync()
+ call void @llvm.ppc.lwsync()
+ ret void
+}
Index: llvm/lib/Target/PowerPC/GISel/PPCRegisterBankInfo.cpp
===================================================================
--- llvm/lib/Target/PowerPC/GISel/PPCRegisterBankInfo.cpp
+++ llvm/lib/Target/PowerPC/GISel/PPCRegisterBankInfo.cpp
@@ -175,6 +175,13 @@
getValueMapping(PMI_GPR64)});
break;
}
+ case TargetOpcode::G_INTRINSIC_W_SIDE_EFFECTS: {
+ // FIXME: We have to check every operand in this MI and compute value
+ // mapping accordingly.
+ SmallVector<const ValueMapping *, 8> OpdsMapping(NumOperands);
+ OperandsMapping = getOperandsMapping(OpdsMapping);
+ break;
+ }
default:
return getInvalidInstructionMapping();
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141360.487800.patch
Type: text/x-patch
Size: 1503 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230110/53bb68e3/attachment.bin>
More information about the llvm-commits
mailing list