This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Correct the check of signed 9-bit imm in getIndexedAddressParts()
ClosedPublic

Authored by haicheng on Dec 7 2016, 1:30 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

haicheng updated this revision to Diff 80648.Dec 7 2016, 1:30 PM
haicheng retitled this revision from to [AArch64] Correct the check of signed 9-bit imm in getIndexedAddressParts().
haicheng updated this object.
haicheng added a reviewer: t.p.northover.
haicheng set the repository for this revision to rL LLVM.
haicheng added subscribers: gberry, llvm-commits.
efriedma added inline comments.
lib/Target/AArch64/AArch64ISelLowering.cpp
10248

This has undefined behavior if RHCS == INT64_MIN.

haicheng updated this revision to Diff 80698.Dec 7 2016, 5:47 PM

Address Eli's comment. Thank you.

haicheng marked an inline comment as done.Dec 7 2016, 5:47 PM

Seems like an obvious fix. Can you also add tests at the boundary where they shouldn't be encoded in 9-bit form?

haicheng updated this revision to Diff 82155.Dec 20 2016, 2:29 PM

Add more tests as requested by Renato. Thank you.

rengolin accepted this revision.Dec 21 2016, 5:28 AM
rengolin added a reviewer: rengolin.

LGTM. Thanks!

This revision is now accepted and ready to land.Dec 21 2016, 5:28 AM
This revision was automatically updated to reflect the committed changes.