[mips] Small code generation improvement for conditional operator (select)
authorMatheus Almeida <matheus.almeida@imgtec.com>
Thu, 5 Dec 2013 12:07:05 +0000 (12:07 +0000)
committerMatheus Almeida <matheus.almeida@imgtec.com>
Thu, 5 Dec 2013 12:07:05 +0000 (12:07 +0000)
commitbc7114feab7b31dc1d117dde8d8900b6b6aa1d06
tree94f374b2670fed20bca3f691c87ee04155e2ede9
parent00877e733fc0366a93240b85dccfbd853c6135c5
[mips] Small code generation improvement for conditional operator (select)
in case the operands are constants and its difference is |1|.
It should be possible in those cases to rematerialize the result using
MIPS's slt and similar instructions.

The small update to some of the tests in cmov.ll, sel1c.ll and sel2c.ll was needed
otherwise the optimization implemented in this patch would have been triggered
(difference between the operands was 1) and that would have changed the semantic
of the tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196498 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/MipsISelLowering.cpp
test/CodeGen/Mips/cmov.ll
test/CodeGen/Mips/sel1c.ll
test/CodeGen/Mips/sel2c.ll