This is an archive of the discontinued LLVM Phabricator instance.

[x86] try harder to form 'inc' from an 'add'
AbandonedPublic

Authored by spatel on Jan 31 2019, 2:43 PM.

Details

Summary

This should prevent at least 1 of the regressions noted in D57516, but it appears that there are other patterns to account for.

In the affected test (and I'm not sure how to expose this without the uaddo intrinsic/op), we have this after legalization:

t28: i64,i32 = X86ISD::ADD t5, Constant:i64<1>

  t8: ch = store<(store 8 into %ir.s641)> t5:1, t28, t2, undef:i64
t32: ch = X86ISD::BRCOND t8, BasicBlock:ch<return 0x7fefc9071c08>, Constant:i8<1>, t28:1

That 'constant 1' in the branch is COND_AE (CF == 0), but 'inc' doesn't set CF.

Diff Detail