This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Improve codegen for icmp {ne,eq} with a constant
ClosedPublic

Authored by luismarques on Mar 24 2019, 3:04 PM.

Details

Summary

Adds two patterns to improve the codegen of GPR value comparisons with small
constants. Instead of first loading the constant into another register and then
doing an XOR of those registers, these patterns directly use the constant as an
XORI immediate.

Diff Detail

Repository
rL LLVM

Event Timeline

luismarques created this revision.Mar 24 2019, 3:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2019, 3:04 PM
asb accepted this revision.Mar 25 2019, 2:13 AM

LGTM, thanks. But would be better titled to reflect that it include GPR != simm12 optimisation. Maybe even better titled as "[RISCV] Improve codegen for icmp {ne,eq} with a constant" or similar (IMHO!)

This revision is now accepted and ready to land.Mar 25 2019, 2:13 AM
luismarques retitled this revision from [RISCV] Improve codegen of GPR == simm12 to [RISCV] Improve codegen for icmp {ne,eq} with a constant.Mar 25 2019, 3:27 AM