This fixes a miscompilation in the AArch64 fast-isel which was triggered when a branch is based on an icmp with condition eq or ne, and type i1, i8 or i16. The cbz instruction compares the whole 32-bit register, so values with the bottom 1, 8 or 16 bits clear would cause the wrong branch to be taken.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Hi Oliver,
This looks fine, just one very minor quibble.
lib/Target/AArch64/AArch64FastISel.cpp | ||
---|---|---|
2184 | BW < 32? |
Comment Actions
Hi Oliver,
thanks for catching this. I only have a minor comment inline.
It would be great if you also could optimize the i1 case by emitting a 'tbs' instead. Maybe in a separate commit?
Thanks and LGTM.
-Juergen
lib/Target/AArch64/AArch64FastISel.cpp | ||
---|---|---|
2185 | getValueType doesn't use kill flags - a simple 'true' will do here. | |
test/CodeGen/AArch64/fast-isel-cbz.ll | ||
3 | This case could be optimized to use tbz instead. |
BW < 32?