[PowerPC] Sign extend comparison operand for signed atomic comparisons
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Tue, 19 Jan 2021 03:19:11 +0000 (21:19 -0600)
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Tue, 19 Jan 2021 03:19:25 +0000 (21:19 -0600)
commit61f69153e8dd7956d03ce46e30257c5bb3e41873
treea4783cee69e581389a555c00b93dfd1fd74c533c
parentbc713f6a004723d1325bc16e1efc32d0ac82f939
[PowerPC] Sign extend comparison operand for signed atomic comparisons

As of 8dacca943af8a53a23b1caf3142d10fb4a77b645, we sign extend the atomic loaded
operand for signed subword comparisons. However, the assumption that the other
operand is correctly sign extended doesn't always hold. This patch sign extends
the other operand if it needs to be sign extended.

This is a second fix for https://bugs.llvm.org/show_bug.cgi?id=30451

Differential revision: https://reviews.llvm.org/D94058
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/test/CodeGen/PowerPC/atomics-regression.ll
llvm/test/CodeGen/PowerPC/sign-ext-atomics.ll [new file with mode: 0644]