diff options
| author | Craig Topper <craig.topper@gmail.com> | 2015-04-04 04:22:12 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@gmail.com> | 2015-04-04 04:22:12 +0000 |
| commit | 7ea899a15f017957dfad9dff3919077be42fe2da (patch) | |
| tree | 3f2d810712234637b73e5ccd727a1ed6723ed096 /llvm/lib | |
| parent | b2e6190aca6d329a4d719d1e34234cefbd87db7d (diff) | |
| download | bcm5719-llvm-7ea899a15f017957dfad9dff3919077be42fe2da.tar.gz bcm5719-llvm-7ea899a15f017957dfad9dff3919077be42fe2da.zip | |
[X86] Apply AddedComplexity consistently for similar patterns. This keeps them together in the DAGISel tables and reduces table size slightly.
llvm-svn: 234086
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/X86/X86InstrCompiler.td | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/Target/X86/X86InstrCompiler.td b/llvm/lib/Target/X86/X86InstrCompiler.td index 227f69a9d84..45e6d0a7f4d 100644 --- a/llvm/lib/Target/X86/X86InstrCompiler.td +++ b/llvm/lib/Target/X86/X86InstrCompiler.td @@ -1235,7 +1235,8 @@ def : Pat<(store (add (loadi64 addr:$dst), 0x00000000800000000), addr:$dst), // This can also reduce instruction size by eliminating the need for the REX // prefix. -let AddedComplexity = 1 in // Give priority over i64immSExt8. +// AddedComplexity is needed to give priority over i64immSExt8 and i64immSExt32. +let AddedComplexity = 1 in { def : Pat<(and GR64:$src, i64immZExt32SExt8:$imm), (SUBREG_TO_REG (i64 0), @@ -1244,7 +1245,6 @@ def : Pat<(and GR64:$src, i64immZExt32SExt8:$imm), (i32 (GetLo8XForm imm:$imm))), sub_32bit)>; -let AddedComplexity = 1 in // Give priority over i64immSExt32. def : Pat<(and GR64:$src, i64immZExt32:$imm), (SUBREG_TO_REG (i64 0), @@ -1252,8 +1252,13 @@ def : Pat<(and GR64:$src, i64immZExt32:$imm), (EXTRACT_SUBREG GR64:$src, sub_32bit), (i32 (GetLo32XForm imm:$imm))), sub_32bit)>; +} // AddedComplexity = 1 +// AddedComplexity is needed due to the increased complexity on the +// i64immZExt32SExt8 and i64immZExt32 patterns above. Applying this to all +// the MOVZX patterns keeps thems together in DAGIsel tables. +let AddedComplexity = 1 in { // r & (2^16-1) ==> movz def : Pat<(and GR32:$src1, 0xffff), (MOVZX32rr16 (EXTRACT_SUBREG GR32:$src1, sub_16bit))>; @@ -1271,7 +1276,6 @@ def : Pat<(and GR16:$src1, 0xff), Requires<[Not64BitMode]>; // r & (2^32-1) ==> movz -let AddedComplexity = 1 in // Give priority over i64immZExt32. def : Pat<(and GR64:$src, 0x00000000FFFFFFFF), (SUBREG_TO_REG (i64 0), (MOV32rr (EXTRACT_SUBREG GR64:$src, sub_32bit)), @@ -1283,7 +1287,6 @@ def : Pat<(and GR64:$src, 0xffff), (MOVZX32rr16 (i16 (EXTRACT_SUBREG GR64:$src, sub_16bit))), sub_32bit)>; // r & (2^8-1) ==> movz -let AddedComplexity = 1 in // Give priority over i64immSExt32. def : Pat<(and GR64:$src, 0xff), (SUBREG_TO_REG (i64 0), (MOVZX32rr8 (i8 (EXTRACT_SUBREG GR64:$src, sub_8bit))), @@ -1297,6 +1300,7 @@ def : Pat<(and GR16:$src1, 0xff), (EXTRACT_SUBREG (MOVZX32rr8 (i8 (EXTRACT_SUBREG GR16:$src1, sub_8bit))), sub_16bit)>, Requires<[In64BitMode]>; +} // AddedComplexity = 1 // sext_inreg patterns |

