aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2011-12-21 00:31:10 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2011-12-21 00:31:10 +0000
commitc7541c49a9dbb88c0ffe4b74bc8065eb68585148 (patch)
tree997ce780418f4e3176495d5042562ac688b9d50d /lib/Target
parentc79507a4dd0c64e3d96fee6c57d0b2e3d14f4b77 (diff)
downloadexternal_llvm-c7541c49a9dbb88c0ffe4b74bc8065eb68585148.zip
external_llvm-c7541c49a9dbb88c0ffe4b74bc8065eb68585148.tar.gz
external_llvm-c7541c49a9dbb88c0ffe4b74bc8065eb68585148.tar.bz2
Fix bug in zero-store peephole pattern reported in pr11615.
The patch and test case were originally written by Mans Rullgard. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147024 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/Mips/MipsInstrInfo.td12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Target/Mips/MipsInstrInfo.td b/lib/Target/Mips/MipsInstrInfo.td
index eb8b16b..e5d76c8 100644
--- a/lib/Target/Mips/MipsInstrInfo.td
+++ b/lib/Target/Mips/MipsInstrInfo.td
@@ -1022,10 +1022,14 @@ let Predicates = [IsN64] in {
}
// peepholes
-def : Pat<(store (i32 0), addr:$dst), (SW ZERO, addr:$dst)>,
- Requires<[NotN64]>;
-def : Pat<(store (i32 0), addr:$dst), (SW_P8 ZERO, addr:$dst)>,
- Requires<[IsN64]>;
+let Predicates = [NotN64] in {
+ def : Pat<(store_a (i32 0), addr:$dst), (SW ZERO, addr:$dst)>;
+ def : Pat<(store_u (i32 0), addr:$dst), (USW ZERO, addr:$dst)>;
+}
+let Predicates = [IsN64] in {
+ def : Pat<(store_a (i32 0), addr:$dst), (SW_P8 ZERO, addr:$dst)>;
+ def : Pat<(store_u (i32 0), addr:$dst), (USW_P8 ZERO, addr:$dst)>;
+}
// brcond patterns
multiclass BrcondPats<RegisterClass RC, Instruction BEQOp, Instruction BNEOp,