From: Colin LeMahieu Date: Fri, 16 Jan 2015 20:16:14 +0000 (+0000) Subject: [Hexagon] Fix 226309, replacement atomic store patterns didn't actually exist, added... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6a1bcaf6ff3be2bce85db3b60aaa7db6162497df;p=llvm [Hexagon] Fix 226309, replacement atomic store patterns didn't actually exist, added new versions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226315 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/Hexagon/HexagonInstrInfo.td b/lib/Target/Hexagon/HexagonInstrInfo.td index ab8d1fb17f9..69a3a34a7ca 100644 --- a/lib/Target/Hexagon/HexagonInstrInfo.td +++ b/lib/Target/Hexagon/HexagonInstrInfo.td @@ -2906,6 +2906,23 @@ let addrMode = BaseImmOffset, InputType = "imm", isCodeGenOnly = 0 in { u6_1Ext, 0b011, 1>; } +class Storex_simple_pat + : Pat<(Store Value:$Rt, (i32 IntRegs:$Rs)), + (MI IntRegs:$Rs, 0, Value:$Rt)>; + +// Regular stores in the DAG have two operands: value and address. +// Atomic stores also have two, but they are reversed: address, value. +// To use atomic stores with the patterns, they need to have their operands +// swapped. This relies on the knowledge that the F.Fragment uses names +// "ptr" and "val". +class SwapSt + : PatFrag<(ops node:$val, node:$ptr), F.Fragment>; + +def: Storex_simple_pat, I32, S2_storerb_io>; +def: Storex_simple_pat, I32, S2_storerh_io>; +def: Storex_simple_pat, I32, S2_storeri_io>; +def: Storex_simple_pat, I64, S2_storerd_io>; + def : Pat<(truncstorei8 (i32 IntRegs:$src1), ADDRriS11_0:$addr), (S2_storerb_io AddrFI:$addr, 0, (i32 IntRegs:$src1))>;