diff options
author | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2017-06-13 17:10:16 +0000 |
---|---|---|
committer | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2017-06-13 17:10:16 +0000 |
commit | b3a8d20e27b41be00e1876c606d43c5794815e0b (patch) | |
tree | c33878415f9f7d04530abe3edfdb642fdfd438a0 /llvm/lib/Target/Hexagon/HexagonPatterns.td | |
parent | c9c403c0d471f7305c713760285666aa2407c5e0 (diff) | |
download | bcm5719-llvm-b3a8d20e27b41be00e1876c606d43c5794815e0b.tar.gz bcm5719-llvm-b3a8d20e27b41be00e1876c606d43c5794815e0b.zip |
[Hexagon] Generate store-immediate instructions for stack objects
Store-immediate instructions have a non-extendable offset. Since the
actual offset for a stack object is not known until much later, only
generate these stores when the stack size (at the time of instruction
selection) is small.
llvm-svn: 305305
Diffstat (limited to 'llvm/lib/Target/Hexagon/HexagonPatterns.td')
-rw-r--r-- | llvm/lib/Target/Hexagon/HexagonPatterns.td | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonPatterns.td b/llvm/lib/Target/Hexagon/HexagonPatterns.td index a8c5658337b..689419638f5 100644 --- a/llvm/lib/Target/Hexagon/HexagonPatterns.td +++ b/llvm/lib/Target/Hexagon/HexagonPatterns.td @@ -1475,16 +1475,22 @@ def i32in8ImmPred: PatLeaf<(i32 imm), [{ return v == (int64_t)(int8_t)v; }]>; +class SmallStackStore<PatFrag Store> + : PatFrag<(ops node:$Val, node:$Addr), (Store node:$Val, node:$Addr), [{ + return isSmallStackStore(cast<StoreSDNode>(N)); +}]>; let AddedComplexity = 40 in { // Even though the offset is not extendable in the store-immediate, we // can still generate the fi# in the base address. If the final offset // is not valid for the instruction, we will replace it with a scratch // register. -// def: Storexm_fi_pat <truncstorei8, s32_0ImmPred, ToImmByte, S4_storeirb_io>; -// def: Storexm_fi_pat <truncstorei16, i16in8ImmPred, ToImmHalf, -// S4_storeirh_io>; -// def: Storexm_fi_pat <store, i32in8ImmPred, ToImmWord, S4_storeiri_io>; + def: Storexm_fi_pat <SmallStackStore<truncstorei8>, s32_0ImmPred, + ToImmByte, S4_storeirb_io>; + def: Storexm_fi_pat <SmallStackStore<truncstorei16>, i16in8ImmPred, + ToImmHalf, S4_storeirh_io>; + def: Storexm_fi_pat <SmallStackStore<store>, i32in8ImmPred, + ToImmWord, S4_storeiri_io>; // defm: Storexm_fi_add_pat <truncstorei8, s32_0ImmPred, u6_0ImmPred, ToImmByte, // S4_storeirb_io>; |