summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2017-02-08 21:22:15 +0000
committerTim Northover <tnorthover@apple.com>2017-02-08 21:22:15 +0000
commit0a9b27933a7aa84d04f133096727e94300dfc3be (patch)
tree27d630b182d4572c3c0c832c646c34904559fc04 /llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp
parent4a24705dd61e583c489349a4e2a87008ca68d16b (diff)
downloadbcm5719-llvm-0a9b27933a7aa84d04f133096727e94300dfc3be.tar.gz
bcm5719-llvm-0a9b27933a7aa84d04f133096727e94300dfc3be.zip
GlobalISel: expand mul-with-overflow into mul-hi on AArch64.
AArch64 has specific instructions to multiply two numbers at double the width and produce the high part of the result. These can be used to implement LLVM's mul.with.overflow instructions fairly simply. Helps with C++ operator new[]. llvm-svn: 294519
Diffstat (limited to 'llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp')
-rw-r--r--llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp b/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp
index ad0482ac7d5..32f9c5f80d0 100644
--- a/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp
@@ -64,7 +64,10 @@ AArch64LegalizerInfo::AArch64LegalizerInfo() {
for (auto Ty : { s1, s8, s16, s32, s64 })
setAction({BinOp, Ty}, Lower);
- for (unsigned Op : {G_UADDE, G_USUBE, G_SADDO, G_SSUBO, G_SMULO, G_UMULO}) {
+ for (unsigned Op : {G_SMULO, G_UMULO})
+ setAction({Op, s64}, Lower);
+
+ for (unsigned Op : {G_UADDE, G_USUBE, G_SADDO, G_SSUBO, G_SMULH, G_UMULH}) {
for (auto Ty : { s32, s64 })
setAction({Op, Ty}, Legal);
OpenPOWER on IntegriCloud