As per title. This is extracted from D29872 and I threw SADDO in.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Fix the ISD::SUB case, which needs to was threated as ADDE. It is probably possible to do somethign better, but it's good enough for now.
The multiple fall-throughs make this confusing. Since there's now three different properties that need to be checked (ADD vs SUB, carry-result vs no carry-result, carry-in vs no carry-in), a single fallthrough chain isn't really sufficient. I'd put all of the variants for all kinds of ADD/SUB in one case section, with ifs for the parts that need to be distinguished from each-other.
Should also move USUBO and SSUBO support down with the ADD/SUB variants, and treat them appropriately.
Also, ought to fix the exact same issue that occurs in ComputeNumSignBits for these operations.
lib/CodeGen/SelectionDAG/SelectionDAG.cpp | ||
---|---|---|
2505 ↗ | (On Diff #89954) | Add some description comments |
2508 ↗ | (On Diff #89954) | Worth doing an early out here if KnownZeroLow == 0? |
2513 ↗ | (On Diff #89954) | KnownZero.setBits(0, KnownZeroLow); |
2523 ↗ | (On Diff #89954) | KnownZero.setBits(1, BitWidth); |
2555 ↗ | (On Diff #89954) | KnownZero.setBit(1, KnownZeroLow); |