[llvm] [RISCV][ISEL] Lowering to load-acquire/store-release for RISCV Zalasr (PR #82914)

Wang Pengcheng via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 26 20:20:41 PST 2024


================
@@ -5,13 +5,20 @@
 ; RUN:   | FileCheck -check-prefixes=RV32IA,RV32IA-WMO %s
 ; RUN: llc -mtriple=riscv32 -mattr=+a,+experimental-ztso -verify-machineinstrs < %s \
 ; RUN:   | FileCheck -check-prefixes=RV32IA,RV32IA-TSO %s
+; RUN: llc -mtriple=riscv32 -mattr=+a,+experimental-zalasr -verify-machineinstrs < %s \
----------------
wangpc-pp wrote:

Sorry, I may have misled you. The CHECKs looks weird now.
Here is my example:
```diff
; RUN: llc -mtriple=riscv32 -mattr=+a -verify-machineinstrs < %s \                                                                                                                                                                        
 ; RUN:   | FileCheck -check-prefixes=RV32IA,RV32IA-WMO %s                                                                                                                                                                                 
 ; RUN: llc -mtriple=riscv32 -mattr=+a,+experimental-ztso -verify-machineinstrs < %s \                                                                                                                                                     
-; RUN:   | FileCheck -check-prefixes=RV32IA,RV32IA-TSO %s                                                                                                                                                                                 
+; RUN:   | FileCheck -check-prefixes=RV32IA,RV32IA-TSO,RV32IA-NOZALASR-TSO %s                                                                                                                                                             
+; RUN: llc -mtriple=riscv32 -mattr=+a,+experimental-zalasr -verify-machineinstrs < %s \                                                                                                                                                   
+; RUN:   | FileCheck -check-prefixes=RV32IA,RV32IA-ZALASR-WMO %s                                                                                                                                                                          
+; RUN: llc -mtriple=riscv32 -mattr=+a,+experimental-zalasr,+experimental-ztso -verify-machineinstrs < %s \                                                                                                                                
+; RUN:   | FileCheck -check-prefixes=RV32IA,RV32IA-TSO,RV32IA-ZALASR-TSO %s                                                                                                                                                               
 ; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \                                                                                                                                                                                  
 ; RUN:   | FileCheck -check-prefix=RV64I %s
 ; RUN: llc -mtriple=riscv64 -mattr=+a -verify-machineinstrs < %s \
 ; RUN:   | FileCheck -check-prefixes=RV64IA,RV64IA-WMO %s
 ; RUN: llc -mtriple=riscv64 -mattr=+a,+experimental-ztso -verify-machineinstrs < %s \
-; RUN:   | FileCheck -check-prefixes=RV64IA,RV64IA-TSO %s
-
+; RUN:   | FileCheck -check-prefixes=RV64IA,RV64IA-TSO,RV64IA-NOZALASR-TSO %s
+; RUN: llc -mtriple=riscv64 -mattr=+a,+experimental-zalasr -verify-machineinstrs < %s \
+; RUN:   | FileCheck -check-prefixes=RV64IA,RV64IA-ZALASR-WMO %s
+; RUN: llc -mtriple=riscv64 -mattr=+a,+experimental-zalasr,+experimental-ztso -verify-machineinstrs < %s \
+; RUN:   | FileCheck -check-prefixes=RV64IA,RV64IA-TSO,RV64IA-ZALASR-TSO %s
```
Since there are differences (because of the difference of lowering `seq_cst`) between `RV32IA-TSO` and `RV32IA-ZALASR-TSO`, we need to add a prefix to the RUN line that is TSO without `Zalasr` to generate correct CHECKs. I name them `RV32IA-NOZALASR-TSO` and `RV64IA-NOZALASR-TSO`. I don't know if they are good names, maybe `RV32IA-STANDARD-TSO`, `RV32IA-NORMAL-TSO`, ...?

https://github.com/llvm/llvm-project/pull/82914


More information about the llvm-commits mailing list