[fast-isel] Add support for the expect intrinsic.
authorChad Rosier <mcrosier@apple.com>
Thu, 7 Mar 2013 20:42:17 +0000 (20:42 +0000)
committerChad Rosier <mcrosier@apple.com>
Thu, 7 Mar 2013 20:42:17 +0000 (20:42 +0000)
rdar://13370942

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176649 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/FastISel.cpp
test/CodeGen/ARM/fast-isel-intrinsic.ll

index a11f434ae00831c1ebb9a42f69339c7a3913164e..35f7fcbd390aebc8a91f94e640705f5b089fae2d 100644 (file)
@@ -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,
index 41089785cefe92c054db0a03d3e7a053e50a12e0..48105dd3893b3db0c137e5e546aa323282cc81a3 100644 (file)
@@ -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