[PATCH] D63022: [GlobalISel] IRTranslator: Translate the intrinsics ignored by CodeGen
Volkan Keles via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 7 12:44:55 PDT 2019
volkan created this revision.
volkan added reviewers: qcolombet, aditya_nandakumar, dsanders, paquette, aemerson, arsenm.
Herald added subscribers: Petar.Avramovic, javed.absar, kristof.beyls, rovka, wdng.
Herald added a project: LLVM.
Translate `llvm.assume`, `llvm.var.annotation' and 'llvm.sideeffect' to nothing
as they have no effect on CodeGen.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D63022
Files:
lib/CodeGen/GlobalISel/IRTranslator.cpp
test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll
Index: test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll
===================================================================
--- test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll
+++ test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll
@@ -2390,3 +2390,30 @@
%y = call float @llvm.rint.f32(float %x)
ret float %y
}
+
+declare void @llvm.assume(i1)
+define void @test_assume(i1 %x) {
+ ; CHECK-LABEL: name: test_assume
+ ; CHECK-NOT: llvm.assume
+ ; CHECK: RET_ReallyLR
+ call void @llvm.assume(i1 %x)
+ ret void
+}
+
+declare void @llvm.sideeffect()
+define void @test_sideeffect() {
+ ; CHECK-LABEL: name: test_sideeffect
+ ; CHECK-NOT: llvm.sideeffect
+ ; CHECK: RET_ReallyLR
+ call void @llvm.sideeffect()
+ ret void
+}
+
+declare void @llvm.var.annotation(i8*, i8*, i8*, i32)
+define void @test_var_annotation(i8*, i8*, i8*, i32) {
+ ; CHECK-LABEL: name: test_var_annotation
+ ; CHECK-NOT: llvm.var.annotation
+ ; CHECK: RET_ReallyLR
+ call void @llvm.var.annotation(i8* %0, i8* %1, i8* %2, i32 %3)
+ ret void
+}
Index: lib/CodeGen/GlobalISel/IRTranslator.cpp
===================================================================
--- lib/CodeGen/GlobalISel/IRTranslator.cpp
+++ lib/CodeGen/GlobalISel/IRTranslator.cpp
@@ -1108,6 +1108,11 @@
}
case Intrinsic::invariant_end:
return true;
+ case Intrinsic::assume:
+ case Intrinsic::var_annotation:
+ case Intrinsic::sideeffect:
+ // Discard annotate attributes, assumptions, and artificial side-effects.
+ return true;
}
return false;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63022.203598.patch
Type: text/x-patch
Size: 1579 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190607/021b2e49/attachment.bin>
More information about the llvm-commits
mailing list