[PATCH] D84100: [ARM] Optimize immediate selection
Sam Parker via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 10 05:18:39 PDT 2020
samparker added inline comments.
================
Comment at: llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp:3319
+ NewUseOpc1 = UseOpc == ARM::ADDrr ? ARM::ADDri : ARM::SUBri;
+ NewUseOpc2 = UseOpc == ARM::ADDrr ? ARM::ADDri : ARM::SUBri;
+ } else if (ARM_AM::isSOImmTwoPartVal(-ImmVal)) {
----------------
NewUseOpc2 = NewUseOpc1, same for below.
================
Comment at: llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp:3365
+ if (ARM_AM::isT2SOImmTwoPartVal(ImmVal)) {
+ NewUseOpc1 = UseOpc == ARM::t2ADDrr ? t2ADD : t2SUB;
+ NewUseOpc2 = UseOpc == ARM::t2ADDrr ? t2ADD : t2SUB;
----------------
NewUseOpc2 = NewUseOpc1, same for below.
================
Comment at: llvm/test/CodeGen/ARM/add-sub-imm.ll:2
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=arm-eabi %s -o - | FileCheck %s --check-prefix=CHECK
----------------
We should have a test run for a Thumb2 target as well. It would also be a good idea for some edge-case negative tests to exercise isSOImmTwoPartValSub some more.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D84100/new/
https://reviews.llvm.org/D84100
More information about the llvm-commits
mailing list