diff options
author | Nemanja Ivanovic <nemanja.i.ibm@gmail.com> | 2021-03-19 06:24:42 -0500 |
---|---|---|
committer | Nemanja Ivanovic <nemanja.i.ibm@gmail.com> | 2021-03-19 07:15:53 -0500 |
commit | a8697c57fa994ebb9524d837ba1ebe7ab00bfb6e (patch) | |
tree | 83cec874b329a3b8e89c04b0a5462462623535e4 /llvm/lib/IR/Module.cpp | |
parent | 4f750f6ebc412869ce6bb28331313a9c9a9d9af7 (diff) | |
download | llvm-a8697c57fa994ebb9524d837ba1ebe7ab00bfb6e.zip llvm-a8697c57fa994ebb9524d837ba1ebe7ab00bfb6e.tar.gz llvm-a8697c57fa994ebb9524d837ba1ebe7ab00bfb6e.tar.bz2 |
[PowerPC] Fix the check for 16-bit signed field in peephole
When a D-Form instruction is fed by an add-immediate, we attempt
to merge the two immediates to form a single displacement so we
can remove the add-immediate.
However, we don't check whether the new displacement fits into
a 16-bit signed immediate field early enough. Namely, we do a
sign-extend from 16 bits first which will discard high bits and
then we check whether the result is a 16-bit signed immediate.
It of course will always be.
Move the check prior to the sign extend to ensure we are checking
the correct value.
Fixes https://bugs.llvm.org/show_bug.cgi?id=49640
Diffstat (limited to 'llvm/lib/IR/Module.cpp')
0 files changed, 0 insertions, 0 deletions