llvm.org GIT mirror llvm / 20cfdfe
[WinEH] Don't remove unannotated inline-asm calls Inline-asm calls aren't annotated with funclet bundle operands because they don't throw and cannot be inlined through. We shouldn't require them to bear an funclet bundle operand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261942 91177308-0d34-0410-b5e6-96231b3b80d8 David Majnemer 4 years ago
2 changed file(s) with 29 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
947947 if (FuncletBundleOperand == FuncletPad)
948948 continue;
949949
950 // Skip call sites which are nounwind intrinsics.
950 // Skip call sites which are nounwind intrinsics or inline asm.
951951 auto *CalledFn =
952952 dyn_cast(CS.getCalledValue()->stripPointerCasts());
953 if (CalledFn && CalledFn->isIntrinsic() && CS.doesNotThrow())
953 if (CalledFn && ((CalledFn->isIntrinsic() && CS.doesNotThrow()) ||
954 CS.isInlineAsm()))
954955 continue;
955956
956957 // This call site was not part of this funclet, remove it.
0 ; RUN: opt -winehprepare < %s
1
2 target triple = "x86_64-pc-windows-msvc"
3
4 define void @test1() personality i32 (...)* @__CxxFrameHandler3 {
5 entry:
6 invoke void @f(i32 1)
7 to label %exit unwind label %cleanup
8
9 cleanup:
10 %cp = cleanuppad within none []
11 call void asm sideeffect "", ""()
12 cleanupret from %cp unwind to caller
13
14 exit:
15 ret void
16 }
17
18 ; CHECK-LABEL: define void @test1(
19 ; CHECK: %[[cp:.*]] = cleanuppad within none []
20 ; CHECK-NEXT: call void asm sideeffect "", ""()
21 ; CHECK-NEXT: cleanupret from %[[cp]] unwind to caller
22
23 declare void @f(i32)
24
25 declare i32 @__CxxFrameHandler3(...)