aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/FileUtilities.cpp
diff options
context:
space:
mode:
authorMicah Weston <micahsweston@gmail.com>2022-01-26 04:21:48 +0000
committerBen Shi <ben.shi@streamcomputing.com>2022-01-26 04:22:27 +0000
commitf65651cc8aa87ba3a505ba3edebf81a9797685a2 (patch)
treeadfbd5a39eac8edd1d26d7a72c617c13c171cb0a /llvm/lib/Support/FileUtilities.cpp
parentf2c2333b6d2f0a00b02143fc3914462ebda5a015 (diff)
downloadllvm-f65651cc8aa87ba3a505ba3edebf81a9797685a2.zip
llvm-f65651cc8aa87ba3a505ba3edebf81a9797685a2.tar.gz
llvm-f65651cc8aa87ba3a505ba3edebf81a9797685a2.tar.bz2
[AArch64] Fixes ADD/SUB opt bug and abstracts shared behavior in MIPeepholeOpt for ADD, SUB, and AND.
This fixes a bug where (SUBREG_TO_REG 0 (MOVi32imm <negative-number>) sub_32) would generate invalid code since the top 32-bits were not zeroed when inspecting the immediate value. A new test was added for this case. Change to abstract shared behavior in MIPeepholeOpt. Both visitAND and visitADDSUB attempt to split an RR instruction with an immediate operand into two RI instructions with the immediate split. The differing behavior lies in how the immediate is split into two pieces and how the new instructions are built. The rest of the behavior (adding new VRegs, checking for the MOVImm, constraining reg classes, removing old intructions) are shared between the operations. The new helper function splitTwoPartImm implements the shared behavior and delegates differing behavior to two function objects passed by the caller. One function object splits the immediate into two values and returns the opcode to use if it is a valid split. The other function object builds the new instructions. I felt this abstraction would help since I believe it will help reduce the code repetition when adding new instructions of the pattern, such as SUBS for this conditional optimization. Tested it locally by running check all with compiler-rt, mlir, clang-tools-extra, flang, llvm, and clang enabled. Reviewed By: dmgreen Differential Revision: https://reviews.llvm.org/D118000
Diffstat (limited to 'llvm/lib/Support/FileUtilities.cpp')
0 files changed, 0 insertions, 0 deletions