OSDN Git Service

Revert r312898 "[ARM] Use ADDCARRY / SUBCARRY"
authorHans Wennborg <hans@hanshq.net>
Mon, 11 Sep 2017 23:52:02 +0000 (23:52 +0000)
committerHans Wennborg <hans@hanshq.net>
Mon, 11 Sep 2017 23:52:02 +0000 (23:52 +0000)
commite4fcd18350440bf10ff339ab9c8e9e05baa6fd93
tree1c10dcb52fd5eb0dcab644f985d96adcafec295c
parent9e8c499282cc91a60fd74a5279a123a478c93845
Revert r312898 "[ARM] Use ADDCARRY / SUBCARRY"

It caused PR34564.

> This is a preparatory step for D34515 and also is being recommitted as its
> first version caused PR34045.
>
> This change:
>  - makes nodes ISD::ADDCARRY and ISD::SUBCARRY legal for i32
>  - lowering is done by first converting the boolean value into the carry flag
>    using (_, C) ← (ARMISD::ADDC R, -1) and converted back to an integer value
>    using (R, _) ← (ARMISD::ADDE 0, 0, C). An ARMISD::ADDE between the two
>    operations does the actual addition.
>  - for subtraction, given that ISD::SUBCARRY second result is actually a
>    borrow, we need to invert the value of the second operand and result before
>    and after using ARMISD::SUBE. We need to invert the carry result of
>    ARMISD::SUBE to preserve the semantics.
>  - given that the generic combiner may lower ISD::ADDCARRY and
>    ISD::SUBCARRYinto ISD::UADDO and ISD::USUBO we need to update their lowering
>    as well otherwise i64 operations now would require branches. This implies
>    updating the corresponding test for unsigned.
>  - add new combiner to remove the redundant conversions from/to carry flags
>    to/from boolean values (ARMISD::ADDC (ARMISD::ADDE 0, 0, C), -1) → C
>  - fixes PR34045
>
> Differential Revision: https://reviews.llvm.org/D35192

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312980 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMISelLowering.cpp
lib/Target/ARM/ARMISelLowering.h
test/CodeGen/ARM/intrinsics-overflow.ll
test/CodeGen/ARM/pr34045.ll [deleted file]