[ARM] Convert floating point splats to integer
authorDavid Green <david.green@arm.com>
Wed, 13 May 2020 13:35:32 +0000 (14:35 +0100)
committerDavid Green <david.green@arm.com>
Wed, 13 May 2020 14:24:16 +0000 (15:24 +0100)
commitfa15255d8af53126bbcb017f2fb6f9961e8574df
tree70f59ccbc5a55e948d0981a986f6c5515b09c3ad
parenta5d80818fa702876ced0e62bffcd24d3d9bf43b9
[ARM] Convert floating point splats to integer

Under MVE a vdup will always take a gpr register, not a floating point
value. During DAG combine we convert the types to a bitcast to an
integer in an attempt to fold the bitcast into other instructions. This
is OK, but only works inside the same basic block. To do the same trick
across a basic block boundary we need to convert the type in
codegenprepare, before the splat is sunk into the loop.

This adds a convertSplatType function to codegenprepare to do that,
putting bitcasts around the splat to force the type to an integer. There
is then some adjustment to the code in shouldSinkOperands to handle the
extra bitcasts.

Differential Revision: https://reviews.llvm.org/D78728
15 files changed:
llvm/include/llvm/CodeGen/TargetLowering.h
llvm/lib/CodeGen/CodeGenPrepare.cpp
llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/lib/Target/ARM/ARMISelLowering.h
llvm/test/CodeGen/Thumb2/mve-float16regloops.ll
llvm/test/CodeGen/Thumb2/mve-float32regloops.ll
llvm/test/CodeGen/Thumb2/mve-fma-loops.ll
llvm/test/CodeGen/Thumb2/mve-intrinsics/dup.ll
llvm/test/CodeGen/Thumb2/mve-intrinsics/ternary.ll
llvm/test/CodeGen/Thumb2/mve-intrinsics/vaddq.ll
llvm/test/CodeGen/Thumb2/mve-intrinsics/vmulq.ll
llvm/test/CodeGen/Thumb2/mve-intrinsics/vsubq.ll
llvm/test/CodeGen/Thumb2/mve-postinc-lsr.ll
llvm/test/CodeGen/Thumb2/mve-pred-threshold.ll
llvm/test/CodeGen/Thumb2/mve-vldst4.ll