Skip to content

Commit e9c561e

Browse files
committed
[RISCV][GISel] Add atomic load/store test. Add additional atomic load/store isel patterns."
1 parent dbe159b commit e9c561e

File tree

2 files changed

+1691
-0
lines changed

2 files changed

+1691
-0
lines changed

llvm/lib/Target/RISCV/RISCVGISel.td

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,19 @@ def : StPat<store, SH, GPR, i16>;
177177
def : LdPat<extloadi8, LBU, i16>; // Prefer unsigned due to no c.lb in Zcb.
178178
def : StPat<truncstorei8, SB, GPR, i16>;
179179

180+
let Predicates = [HasAtomicLdSt] in {
181+
def : LdPat<atomic_load_8, LB, i16>;
182+
def : LdPat<atomic_load_16, LH, i16>;
183+
184+
def : StPat<atomic_store_8, SB, GPR, i16>;
185+
def : StPat<atomic_store_16, SH, GPR, i16>;
186+
}
187+
188+
let Predicates = [HasAtomicLdSt, IsRV64] in {
189+
def : LdPat<atomic_load_32, LW, i32>;
190+
def : StPat<atomic_store_32, SW, GPR, i32>;
191+
}
192+
180193
//===----------------------------------------------------------------------===//
181194
// RV64 i32 patterns not used by SelectionDAG
182195
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)