From 8e4847ee957a7c7c434a72fdb7a6010004ca86f4 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Sun, 16 Dec 2007 15:51:49 +0000 Subject: Make instcombine promote inline asm calls to 'nounwind' calls. Remove special casing of inline asm from the inliner. There is a potential problem: the verifier rejects invokes of inline asm (not sure why). If an asm call is not marked "nounwind" in some .ll, and instcombine is not run, but the inliner is run, then an illegal module will be created. This is bad but I'm not sure what the best approach is. I'm tempted to remove the check in the verifier... llvm-svn: 45073 --- llvm/lib/VMCore/Instructions.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'llvm/lib/VMCore/Instructions.cpp') diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp index 5207ea52f49..511a0e851a1 100644 --- a/llvm/lib/VMCore/Instructions.cpp +++ b/llvm/lib/VMCore/Instructions.cpp @@ -65,6 +65,12 @@ bool CallSite::onlyReadsMemory() const { else return cast(I)->onlyReadsMemory(); } +bool CallSite::isNoUnwind() const { + if (CallInst *CI = dyn_cast(I)) + return CI->isNoUnwind(); + else + return cast(I)->isNoUnwind(); +} -- cgit v1.2.3