summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorJessica Paquette <jpaquette@apple.com>2019-02-12 17:28:17 +0000
committerJessica Paquette <jpaquette@apple.com>2019-02-12 17:28:17 +0000
commit0e71e73faacf2a061f27654e59c22586adff51b8 (patch)
treeae426db5f4eadd6215b73d52af97eab3947f28b7 /llvm/lib/CodeGen
parent5338f41ced1f5d78928f453b3bffce5ee24aa099 (diff)
downloadbcm5719-llvm-0e71e73faacf2a061f27654e59c22586adff51b8.tar.gz
bcm5719-llvm-0e71e73faacf2a061f27654e59c22586adff51b8.zip
[GlobalISel][AArch64] Select llvm.bswap* for non-vector types
This teaches the IRTranslator to emit G_BSWAP when it runs into Intrinsic::bswap. This allows us to select G_BSWAP for non-vector types in AArch64. Add a select-bswap.mir test, and add global isel checks to a couple existing tests in test/CodeGen/AArch64. This doesn't handle every bswap case, since some of these rely on known bits stuff. This just lets us handle the naive case. Differential Revision: https://reviews.llvm.org/D58081 llvm-svn: 353861
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
index 9b94a9923f0..dd4e0df3188 100644
--- a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
@@ -794,6 +794,8 @@ IRTranslator::getSimpleUnaryIntrinsicOpcode(Intrinsic::ID ID) {
switch (ID) {
default:
break;
+ case Intrinsic::bswap:
+ return TargetOpcode::G_BSWAP;
case Intrinsic::ceil:
return TargetOpcode::G_FCEIL;
case Intrinsic::cos:
OpenPOWER on IntegriCloud