diff options
| author | Simon Dardis <simon.dardis@imgtec.com> | 2016-07-25 09:57:28 +0000 |
|---|---|---|
| committer | Simon Dardis <simon.dardis@imgtec.com> | 2016-07-25 09:57:28 +0000 |
| commit | 618975206e7bdac07f52e3955032477960d4548b (patch) | |
| tree | 7ab57f8f28d55627db5d92851ee8a2e8b64c5b59 /llvm/lib/Target/Mips/MicroMipsInstrInfo.td | |
| parent | 3a18a931a8f47879c4b246600a2bd59ca4f61c82 (diff) | |
| download | bcm5719-llvm-618975206e7bdac07f52e3955032477960d4548b.tar.gz bcm5719-llvm-618975206e7bdac07f52e3955032477960d4548b.zip | |
[mips] Optimize materialization of i64 constants
Avoid MipsAnalyzeImmediate usage if the constant fits in an 32-bit
integer. This allows us to generate the same instructions for the
materialization of the same constants regardless the width of their
type.
Patch by: Vasileios Kalintiris
Contributions by: Simon Dardis
Reviewers: Daniel Sanders
Differential Review: https://reviews.llvm.org/D21689
llvm-svn: 276628
Diffstat (limited to 'llvm/lib/Target/Mips/MicroMipsInstrInfo.td')
| -rw-r--r-- | llvm/lib/Target/Mips/MicroMipsInstrInfo.td | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/MicroMipsInstrInfo.td b/llvm/lib/Target/Mips/MicroMipsInstrInfo.td index 3e839271a43..39229463fef 100644 --- a/llvm/lib/Target/Mips/MicroMipsInstrInfo.td +++ b/llvm/lib/Target/Mips/MicroMipsInstrInfo.td @@ -981,6 +981,12 @@ let DecoderNamespace = "MicroMips" in { // MicroMips arbitrary patterns that map to one or more instructions //===----------------------------------------------------------------------===// +def : MipsPat<(i32 immLi16:$imm), + (LI16_MM immLi16:$imm)>; + +let AdditionalPredicates = [InMicroMips] in +defm : MaterializeImms<i32, ZERO, ADDiu_MM, LUi_MM, ORi_MM>; + let Predicates = [InMicroMips] in { def : MipsPat<(i32 immLi16:$imm), (LI16_MM immLi16:$imm)>; |

