diff options
| author | Dan Gohman <gohman@apple.com> | 2011-06-16 15:55:48 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2011-06-16 15:55:48 +0000 |
| commit | 8eb36ef4976b01a04fd690721d30426054093d38 (patch) | |
| tree | 7d46066b284966589376b438b024b7f3496c585b /llvm | |
| parent | 5ccf812b1de916794f9c5df3ac6d8b7b03166f0b (diff) | |
| download | bcm5719-llvm-8eb36ef4976b01a04fd690721d30426054093d38.tar.gz bcm5719-llvm-8eb36ef4976b01a04fd690721d30426054093d38.zip | |
Add a comment describing why transforming (shl x, 1) to (add x, x) is to be
considered safe enough in this context.
llvm-svn: 133159
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Target/X86/X86InstrCompiler.td | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86InstrCompiler.td b/llvm/lib/Target/X86/X86InstrCompiler.td index 33534cd82bd..adcc747eb4b 100644 --- a/llvm/lib/Target/X86/X86InstrCompiler.td +++ b/llvm/lib/Target/X86/X86InstrCompiler.td @@ -1368,6 +1368,11 @@ def : Pat<(store (i8 (trunc_su (srl_su GR16:$src, (i8 8)))), addr:$dst), // (shl x, 1) ==> (add x, x) +// Note that if x is undef (immediate or otherwise), we could theoretically +// end up with the two uses of x getting different values, producing a result +// where the least significant bit is not 0. However, the probability of this +// happening is considered low enough that this is officially not a +// "real problem". def : Pat<(shl GR8 :$src1, (i8 1)), (ADD8rr GR8 :$src1, GR8 :$src1)>; def : Pat<(shl GR16:$src1, (i8 1)), (ADD16rr GR16:$src1, GR16:$src1)>; def : Pat<(shl GR32:$src1, (i8 1)), (ADD32rr GR32:$src1, GR32:$src1)>; |

