This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GlobalISel] When generating SUBS for compares, don't write to wzr/xzr.
ClosedPublic

Authored by aemerson on May 22 2020, 3:34 PM.

Details

Summary

Although writing to wzr/xzr is correct since we don't care about the result of the sub, only the flags, doing so causes tail merge blocks to fail.

Writing to an unused virtual register instead allows the optimization to fire, improving performance significantly on 256.bzip2.

Diff Detail

Event Timeline

aemerson created this revision.May 22 2020, 3:34 PM
paquette added inline comments.May 22 2020, 3:36 PM
llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
3702

Can probably remove this

3705

Can probably remove this

aemerson updated this revision to Diff 265820.May 22 2020, 5:18 PM

Deleted old lines.

This revision is now accepted and ready to land.May 22 2020, 9:46 PM
This revision was automatically updated to reflect the committed changes.