llvm.org GIT mirror llvm / f318352
[GlobalISel] IRTranslator: Translate the intrinsics ignored by CodeGen Summary: Translate `llvm.assume`, `llvm.var.annotation` and `llvm.sideeffect` to nothing as they have no effect on CodeGen. Reviewers: qcolombet, aditya_nandakumar, dsanders, paquette, aemerson, arsenm Reviewed By: arsenm Subscribers: hiraditya, wdng, rovka, kristof.beyls, javed.absar, Petar.Avramovic, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63022 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362834 91177308-0d34-0410-b5e6-96231b3b80d8 Volkan Keles 4 months ago
2 changed file(s) with 32 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
11071107 }
11081108 case Intrinsic::invariant_end:
11091109 return true;
1110 case Intrinsic::assume:
1111 case Intrinsic::var_annotation:
1112 case Intrinsic::sideeffect:
1113 // Discard annotate attributes, assumptions, and artificial side-effects.
1114 return true;
11101115 }
11111116 return false;
11121117 }
23892389 %y = call float @llvm.rint.f32(float %x)
23902390 ret float %y
23912391 }
2392
2393 declare void @llvm.assume(i1)
2394 define void @test_assume(i1 %x) {
2395 ; CHECK-LABEL: name: test_assume
2396 ; CHECK-NOT: llvm.assume
2397 ; CHECK: RET_ReallyLR
2398 call void @llvm.assume(i1 %x)
2399 ret void
2400 }
2401
2402 declare void @llvm.sideeffect()
2403 define void @test_sideeffect() {
2404 ; CHECK-LABEL: name: test_sideeffect
2405 ; CHECK-NOT: llvm.sideeffect
2406 ; CHECK: RET_ReallyLR
2407 call void @llvm.sideeffect()
2408 ret void
2409 }
2410
2411 declare void @llvm.var.annotation(i8*, i8*, i8*, i32)
2412 define void @test_var_annotation(i8*, i8*, i8*, i32) {
2413 ; CHECK-LABEL: name: test_var_annotation
2414 ; CHECK-NOT: llvm.var.annotation
2415 ; CHECK: RET_ReallyLR
2416 call void @llvm.var.annotation(i8* %0, i8* %1, i8* %2, i32 %3)
2417 ret void
2418 }