blob: 21c2688ca70f662a61a10a8cf8c17ee9c08b18f0 [file] [log] [blame]
Tim Northovere3d42362013-02-01 11:40:47 +00001; RUN: llc -verify-machineinstrs -mtriple=aarch64-none-linux-gnu < %s | FileCheck %s
Tim Northover46ecdf52014-04-16 11:53:07 +00002; RUN: llc -verify-machineinstrs -mtriple=arm64-none-linux-gnu -o - %s | FileCheck %s
Tim Northovere0e3aef2013-01-31 12:12:40 +00003
4; Most important point here is that the promotion of the i1 works
5; correctly. Previously LLVM thought that i64 was the appropriate SetCC output,
6; which meant it proceded in two steps and produced an i64 -> i64 any_ext which
7; couldn't be selected and faulted.
8
9; It was expecting the smallest legal promotion of i1 to be the preferred SetCC
10; type, so we'll satisfy it (this actually arguably gives better code anyway,
11; with flag-manipulation operations allowed to use W-registers).
12
13declare {i64, i1} @llvm.umul.with.overflow.i64(i64, i64)
14
15define i64 @test_select(i64 %lhs, i64 %rhs) {
Stephen Linf799e3f2013-07-13 20:38:47 +000016; CHECK-LABEL: test_select:
Tim Northovere0e3aef2013-01-31 12:12:40 +000017
18 %res = call {i64, i1} @llvm.umul.with.overflow.i64(i64 %lhs, i64 %rhs)
19 %flag = extractvalue {i64, i1} %res, 1
20 %retval = select i1 %flag, i64 %lhs, i64 %rhs
21 ret i64 %retval
22; CHECK: ret
Stephen Linf799e3f2013-07-13 20:38:47 +000023}