diff options
author | Petar Avramovic <Petar.Avramovic@amd.com> | 2021-09-17 11:21:55 +0200 |
---|---|---|
committer | Petar Avramovic <Petar.Avramovic@amd.com> | 2021-09-17 11:22:13 +0200 |
commit | d477a7c2e704f58be816159cd8ac11d5384334b5 (patch) | |
tree | 7bbafcb6297d83db827965914b67aea09639494c /llvm/lib/CodeGen/LiveDebugVariables.cpp | |
parent | 37cdc7ebd9a373100cbbe39f5b9be7a4e4f7813d (diff) | |
download | llvm-d477a7c2e704f58be816159cd8ac11d5384334b5.zip llvm-d477a7c2e704f58be816159cd8ac11d5384334b5.tar.gz llvm-d477a7c2e704f58be816159cd8ac11d5384334b5.tar.bz2 |
GlobalISel/Utils: Refactor integer/float constant match functions
Rework getConstantstVRegValWithLookThrough in order to make it clear if we
are matching integer/float constant only or any constant(default).
Add helper functions that get DefVReg and APInt/APFloat from constant instr
getIConstantVRegValWithLookThrough: integer constant, only G_CONSTANT
getFConstantVRegValWithLookThrough: float constant, only G_FCONSTANT
getAnyConstantVRegValWithLookThrough: either G_CONSTANT or G_FCONSTANT
Rename getConstantVRegVal and getConstantVRegSExtVal to getIConstantVRegVal
and getIConstantVRegSExtVal. These now only match G_CONSTANT as described
in comment.
Relevant matchers now return both DefVReg and APInt/APFloat.
Replace existing uses of getConstantstVRegValWithLookThrough and
getConstantVRegVal with new helper functions. Any constant match is
only required in:
ConstantFoldBinOp: for constant argument that was bit-cast of float to int
getAArch64VectorSplat: AArch64::G_DUP operands can be any constant
amdgpu select for G_BUILD_VECTOR_TRUNC: operands can be any constant
In other places use integer only constant match.
Differential Revision: https://reviews.llvm.org/D104409
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugVariables.cpp')
0 files changed, 0 insertions, 0 deletions