[llvm-commits] [llvm] r139360 - in /llvm/trunk: include/llvm/Intrinsics.td test/Transforms/GVN/2011-09-07-TypeIdFor.ll
Duncan Sands
baldrick at free.fr
Fri Sep 9 00:50:37 PDT 2011
Author: baldrick
Date: Fri Sep 9 02:50:37 2011
New Revision: 139360
URL: http://llvm.org/viewvc/llvm-project?rev=139360&view=rev
Log:
Mark the eh.typeid.for intrinsic as being 'const', which it is inside
any given function. As pointed out by John McCall, this is needed to
have redundant eh.typeid.for tests be eliminated in the presence of
cleanups.
Modified:
llvm/trunk/include/llvm/Intrinsics.td
llvm/trunk/test/Transforms/GVN/2011-09-07-TypeIdFor.ll
Modified: llvm/trunk/include/llvm/Intrinsics.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Intrinsics.td?rev=139360&r1=139359&r2=139360&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Intrinsics.td (original)
+++ llvm/trunk/include/llvm/Intrinsics.td Fri Sep 9 02:50:37 2011
@@ -309,7 +309,9 @@
[llvm_ptr_ty, llvm_ptr_ty, llvm_vararg_ty]>;
def int_eh_resume : Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty], [Throws]>;
-def int_eh_typeid_for : Intrinsic<[llvm_i32_ty], [llvm_ptr_ty], [IntrReadMem]>;
+// The result of eh.typeid.for depends on the enclosing function, but inside a
+// given function it is 'const' and may be CSE'd etc.
+def int_eh_typeid_for : Intrinsic<[llvm_i32_ty], [llvm_ptr_ty], [IntrNoMem]>;
def int_eh_return_i32 : Intrinsic<[], [llvm_i32_ty, llvm_ptr_ty]>;
def int_eh_return_i64 : Intrinsic<[], [llvm_i64_ty, llvm_ptr_ty]>;
Modified: llvm/trunk/test/Transforms/GVN/2011-09-07-TypeIdFor.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/2011-09-07-TypeIdFor.ll?rev=139360&r1=139359&r2=139360&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/GVN/2011-09-07-TypeIdFor.ll (original)
+++ llvm/trunk/test/Transforms/GVN/2011-09-07-TypeIdFor.ll Fri Sep 9 02:50:37 2011
@@ -7,6 +7,8 @@
declare void @_Z4barv()
+declare void @_Z7cleanupv()
+
declare i32 @llvm.eh.typeid.for(i8*) nounwind readonly
declare i8* @__cxa_begin_catch(i8*) nounwind
@@ -50,6 +52,7 @@
br label %return
next2: ; preds = %next
+ call void @_Z7cleanupv()
%typeid = tail call i32 @llvm.eh.typeid.for(i8* bitcast (%struct.__fundamental_type_info_pseudo* @_ZTIi to i8*))
; CHECK-NOT: call i32 @llvm.eh.typeid.for
%4 = icmp eq i32 %filter3.i, %typeid
More information about the llvm-commits
mailing list