From 3766f4baccac5cc17680ad4cefd1d5a0d3ba2870 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Tue, 7 Jan 2020 17:46:52 -0500 Subject: [PATCH] AMDGPU: Use new PatFrag system for d16 stores --- llvm/lib/Target/AMDGPU/AMDGPUInstructions.td | 20 +++++++------------- llvm/lib/Target/AMDGPU/DSInstructions.td | 4 ++-- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/AMDGPUInstructions.td b/llvm/lib/Target/AMDGPU/AMDGPUInstructions.td index 89e52d6..cc006f3 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUInstructions.td +++ b/llvm/lib/Target/AMDGPU/AMDGPUInstructions.td @@ -343,8 +343,9 @@ class StoreFrag : PatFrag < >; class StoreHi16 : PatFrag < - (ops node:$value, node:$ptr), (op (srl node:$value, (i32 16)), node:$ptr) ->; + (ops node:$value, node:$ptr), (op (srl node:$value, (i32 16)), node:$ptr)> { + let IsStore = 1; +} def LoadAddress_constant : AddressSpaceList<[ AddrSpaces.Constant ]>; def LoadAddress_global : AddressSpaceList<[ AddrSpaces.Global, AddrSpaces.Constant ]>; @@ -485,6 +486,10 @@ def truncstorei16_#as : PatFrag<(ops node:$val, node:$ptr), let MemoryVT = i16; } +def store_hi16_#as : StoreHi16 ; +def truncstorei8_hi16_#as : StoreHi16; +def truncstorei16_hi16_#as : StoreHi16; + defm atomic_store_#as : binary_atomic_op; } // End let AddressSpaces = ... @@ -520,16 +525,7 @@ defm atomic_load_xor : ret_noret_binary_atomic_op; defm atomic_load_fadd : ret_noret_binary_atomic_op; defm AMDGPUatomic_cmp_swap : ret_noret_binary_atomic_op; - -def store_hi16_private : StoreHi16 , PrivateAddress; -def truncstorei8_hi16_private : StoreHi16, PrivateAddress; - def store_atomic_global : GlobalStore; -def truncstorei8_hi16_global : StoreHi16 , GlobalAddress; -def truncstorei16_hi16_global : StoreHi16 , GlobalAddress; - -def store_local_hi16 : StoreHi16 , LocalAddress; -def truncstorei8_local_hi16 : StoreHi16, LocalAddress; def atomic_store_local : LocalStore ; @@ -559,8 +555,6 @@ def store_align16_local: PatFrag<(ops node:$val, node:$ptr), def atomic_store_flat : FlatStore ; -def truncstorei8_hi16_flat : StoreHi16, FlatStoreAddress; -def truncstorei16_hi16_flat : StoreHi16, FlatStoreAddress; class local_binary_atomic_op : diff --git a/llvm/lib/Target/AMDGPU/DSInstructions.td b/llvm/lib/Target/AMDGPU/DSInstructions.td index f0987cf..f4e50e3 100644 --- a/llvm/lib/Target/AMDGPU/DSInstructions.td +++ b/llvm/lib/Target/AMDGPU/DSInstructions.td @@ -733,8 +733,8 @@ defm : DSAtomicWritePat_mc ; defm : DSAtomicWritePat_mc ; let OtherPredicates = [D16PreservesUnusedBits] in { -def : DSWritePat ; -def : DSWritePat ; +def : DSWritePat ; +def : DSWritePat ; } -- 2.7.4