This is an archive of the discontinued LLVM Phabricator instance.

[X86] Replace custom scalar integer absolute matching with ISD::ABS lowering.
ClosedPublic

Authored by RKSimon on Oct 13 2017, 10:25 AM.

Details

Summary

X86 has its own copy of integer absolute pattern matching to combine directly to a SUB+CMOV.

This patch replaces the combine with custom lowering to permit more ISD::ABS combines.

Test cases are mostly covered by iabs.ll (rL315706 and rL315711). I can try to add further scalar ISD::ABS combine tests to combine-abs.ll if you think it useful.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon created this revision.Oct 13 2017, 10:25 AM
This revision is now accepted and ready to land.Oct 18 2017, 10:49 PM
This revision was automatically updated to reflect the committed changes.