[all-commits] [llvm/llvm-project] b0c190: [ARM, MVE] Add reversed isel patterns for MVE `vcmp...
Simon Tatham via All-commits
all-commits at lists.llvm.org
Fri Nov 15 06:06:11 PST 2019
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: b0c1900820c3f0a94e3c74e6dcb1317b9cda5af8
https://github.com/llvm/llvm-project/commit/b0c1900820c3f0a94e3c74e6dcb1317b9cda5af8
Author: Simon Tatham <simon.tatham at arm.com>
Date: 2019-11-15 (Fri, 15 Nov 2019)
Changed paths:
M llvm/lib/Target/ARM/ARMInstrMVE.td
M llvm/test/CodeGen/Thumb2/mve-pred-and.ll
M llvm/test/CodeGen/Thumb2/mve-vcmpfr.ll
M llvm/test/CodeGen/Thumb2/mve-vcmpr.ll
Log Message:
-----------
[ARM,MVE] Add reversed isel patterns for MVE `vcmp qN,rN`
Summary:
As well as vector/vector compare instructions, MVE also has a family
of comparisons taking a vector and a scalar, which compare every lane
of the vector against the same value. We generate those at isel time
using isel patterns that match `(ARMvcmp vector, (ARMvdup scalar))`.
This commit adds corresponding patterns for the operand-reversed form
`(ARMvcmp (ARMvdup scalar), vector)`, with condition codes swapped as
necessary. That way, we can still generate the vector/scalar compare
instruction if the IR happens to have been rearranged to put the
operands the other way round, which can happen in some optimization
phases. Previously, a vcmp the other way round was handled by emitting
a `vdup` instruction to //explicitly// replicate the scalar input into
a vector, and then doing a vector/vector comparison.
I haven't added a new test, because it turned out that several
existing tests were already exhibiting that failure mode. So just
updating the expected output in the existing MVE codegen tests
demonstrates what's been improved.
Reviewers: ostannard, MarkMurrayARM, dmgreen
Reviewed By: dmgreen
Subscribers: kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70296
More information about the All-commits
mailing list