diff options
| author | Hal Finkel <hfinkel@anl.gov> | 2015-01-05 21:10:24 +0000 |
|---|---|---|
| committer | Hal Finkel <hfinkel@anl.gov> | 2015-01-05 21:10:24 +0000 |
| commit | 200d2ad188472aa70620c92d2c3e51ed0f08d0b4 (patch) | |
| tree | 572fac326c5e7a9c6b23bc994bfaf66db2f51b21 /llvm/lib/Target/X86/X86TargetObjectFile.cpp | |
| parent | 71b96b35e11f1bf2046b7c52262e4632c27b60f5 (diff) | |
| download | bcm5719-llvm-200d2ad188472aa70620c92d2c3e51ed0f08d0b4.tar.gz bcm5719-llvm-200d2ad188472aa70620c92d2c3e51ed0f08d0b4.zip | |
[PowerPC] Fold i1 extensions with other ops
Consider this function from our README.txt file:
int foo(int a, int b) { return (a < b) << 4; }
We now explicitly track CR bits by default, so the comment in the README.txt
about not really having a SETCC is no longer accurate, but we did generate this
somewhat silly code:
cmpw 0, 3, 4
li 3, 0
li 12, 1
isel 3, 12, 3, 0
sldi 3, 3, 4
blr
which generates the zext as a select between 0 and 1, and then shifts the
result by a constant amount. Here we preprocess the DAG in order to fold the
results of operations on an extension of an i1 value into the SELECT_I[48]
pseudo instruction when the resulting constant can be materialized using one
instruction (just like the 0 and 1). This was not implemented as a DAGCombine
because the resulting code would have been anti-canonical and depends on
replacing chained user nodes, which does not fit well into the lowering
paradigm. Now we generate:
cmpw 0, 3, 4
li 3, 0
li 12, 16
isel 3, 12, 3, 0
blr
which is less silly.
llvm-svn: 225203
Diffstat (limited to 'llvm/lib/Target/X86/X86TargetObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions

