diff options
author | Quentin Colombet <qcolombet@apple.com> | 2014-02-26 21:39:12 +0000 |
---|---|---|
committer | Quentin Colombet <qcolombet@apple.com> | 2014-02-26 21:39:12 +0000 |
commit | 85c9e16291fe0e22e70dbded404996c58358612e (patch) | |
tree | f66ad9ef74d060af37a25ac6395fec4229fc5ba9 /llvm/lib/IR/BasicBlock.cpp | |
parent | 8e9791f62c453e80c50c7ad342b10f969eeffd0d (diff) | |
download | bcm5719-llvm-85c9e16291fe0e22e70dbded404996c58358612e.tar.gz bcm5719-llvm-85c9e16291fe0e22e70dbded404996c58358612e.zip |
Lower unsigned vsetcc to psubus in certain cases
The current approach to lower a vsetult is to flip the sign bit of the
operands, swap the operands and then use a (signed) pcmpgt. psubus (unsigned
saturating subtract) can be used to emulate a vsetult more efficiently:
+ case ISD::SETULT: {
+ // If the comparison is against a constant we can turn this into a
+ // setule. With psubus, setule does not require a swap. This is
+ // beneficial because the constant in the register is no longer
+ // destructed as the destination so it can be hoisted out of a loop.
I also enable lowering via psubus in a few other cases where it's clearly
beneficial: setule and setuge if minu/maxu cannot be used.
rdar://problem/14338765
Patch by Adam Nemet <anemet@apple.com>.
llvm-svn: 202301
Diffstat (limited to 'llvm/lib/IR/BasicBlock.cpp')
0 files changed, 0 insertions, 0 deletions