[PATCH] D52945: [GlobalIsel] Add llvm.invariant.start and llvm.invariant.end
Jessica Paquette via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 5 13:39:26 PDT 2018
paquette created this revision.
paquette added reviewers: aemerson, dsanders, rtereshin, kristof.beyls.
Herald added a subscriber: rovka.
Herald added a reviewer: javed.absar.
Port over the implementation in SelectionDAGBuilder.cpp into the IRTranslator and update the arm64-irtranslator test.
These were causing fallbacks in CTMark/Bullet (-Rpass-missed=gisel-select), and this patch fixes that.
https://reviews.llvm.org/D52945
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
@@ -2207,3 +2207,17 @@
block:
ret void
}
+
+%t = type { i32 }
+declare {}* @llvm.invariant.start.p0i8(i64, i8* nocapture) readonly nounwind
+declare void @llvm.invariant.end.p0i8({}*, i64, i8* nocapture) nounwind
+define void @test_invariant_intrin() {
+; CHECK-LABEL: name: test_invariant_intrin
+; CHECK: %{{[0-9]+}}:_(s64) = G_IMPLICIT_DEF
+; CHECK-NEXT: RET_ReallyLR
+ %x = alloca %t
+ %y = bitcast %t* %x to i8*
+ %inv = call {}* @llvm.invariant.start.p0i8(i64 8, i8* %y)
+ call void @llvm.invariant.end.p0i8({}* %inv, i64 8, i8* %y)
+ ret void
+}
Index: lib/CodeGen/GlobalISel/IRTranslator.cpp
===================================================================
--- lib/CodeGen/GlobalISel/IRTranslator.cpp
+++ lib/CodeGen/GlobalISel/IRTranslator.cpp
@@ -955,6 +955,14 @@
.addUse(getOrCreateVReg(*CI.getArgOperand(0)));
return true;
}
+ case Intrinsic::invariant_start: {
+ LLT PtrTy = getLLTForType(*CI.getArgOperand(0)->getType(), *DL);
+ unsigned Undef = MRI->createGenericVirtualRegister(PtrTy);
+ MIRBuilder.buildUndef(Undef);
+ return true;
+ }
+ case Intrinsic::invariant_end:
+ return true;
}
return false;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52945.168521.patch
Type: text/x-patch
Size: 1419 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181005/6630068d/attachment.bin>
More information about the llvm-commits
mailing list