aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2013-03-07 20:42:17 +0000
committerChad Rosier <mcrosier@apple.com>2013-03-07 20:42:17 +0000
commit33947b4391458ed3ba2d7e7c741968325cbffa1d (patch)
tree6eb31f37076c83d350c782f4e05d6bda19d7c054
parent3853f74aba301ef08b699bac2fa8e53230714a58 (diff)
[fast-isel] Add support for the expect intrinsic.
rdar://13370942 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176649 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/SelectionDAG/FastISel.cpp5
-rw-r--r--test/CodeGen/ARM/fast-isel-intrinsic.ll12
2 files changed, 17 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp
index a11f434ae0..35f7fcbd39 100644
--- a/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -698,6 +698,11 @@ bool FastISel::SelectCall(const User *I) {
UpdateValueMap(Call, ResultReg);
return true;
}
+ case Intrinsic::expect: {
+// unsigned ResultReg = getRegForValue(Call->getArgOperand(0));
+// UpdateValueMap(Call, ResultReg);
+// return true;
+ }
}
// Usually, it does not make sense to initialize a value,
diff --git a/test/CodeGen/ARM/fast-isel-intrinsic.ll b/test/CodeGen/ARM/fast-isel-intrinsic.ll
index 41089785ce..48105dd389 100644
--- a/test/CodeGen/ARM/fast-isel-intrinsic.ll
+++ b/test/CodeGen/ARM/fast-isel-intrinsic.ll
@@ -238,3 +238,15 @@ define void @t7() nounwind ssp {
call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8]* @temp, i32 0, i32 4), i8* getelementptr inbounds ([60 x i8]* @temp, i32 0, i32 16), i32 3, i32 2, i1 false)
ret void
}
+
+define i32 @t8(i32 %x) nounwind {
+entry:
+; ARM: t8
+; ARM-NOT: FastISel missed call: %expval = call i32 @llvm.expect.i32(i32 %x, i32 1)
+; THUMB: t8
+; THUMB-NOT: FastISel missed call: %expval = call i32 @llvm.expect.i32(i32 %x, i32 1)
+ %expval = call i32 @llvm.expect.i32(i32 %x, i32 1)
+ ret i32 %expval
+}
+
+declare i32 @llvm.expect.i32(i32, i32) nounwind readnone