File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
lib/Transforms/InstCombine
test/Transforms/InstCombine Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -4907,6 +4907,9 @@ bool InstCombiner::transformConstExprCastCall(CallBase &Call) {
4907
4907
if (Call.isInAllocaArgument (i))
4908
4908
return false ; // Cannot transform to and from inalloca.
4909
4909
4910
+ if (CallerPAL.hasParamAttribute (i, Attribute::SwiftError))
4911
+ return false ;
4912
+
4910
4913
// If the parameter is passed as a byval argument, then we have to have a
4911
4914
// sized type and the sized type has to have the same size as the old type.
4912
4915
if (ParamTy != ActTy && CallerPAL.hasParamAttribute (i, Attribute::ByVal)) {
Original file line number Diff line number Diff line change
1
+ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2
+ ; RUN: opt -instcombine -S %s | FileCheck %s
3
+
4
+ ; The swifterror value can only be loaded, stored or used as swifterror
5
+ ; argument. Make sure we do not try to turn the function bitcast into an
6
+ ; argument bitcast.
7
+ define swiftcc void @spam (i32** swifterror %arg ) {
8
+ ; CHECK-LABEL: @spam(
9
+ ; CHECK-NEXT: bb:
10
+ ; CHECK-NEXT: call swiftcc void bitcast (void (i64**)* @widget to void (i32**)*)(i32** swifterror [[ARG:%.*]])
11
+ ; CHECK-NEXT: ret void
12
+ ;
13
+ bb:
14
+ call swiftcc void bitcast (void (i64** )* @widget to void (i32** )*)(i32** swifterror %arg )
15
+ ret void
16
+ }
17
+
18
+ declare swiftcc void @widget (i64** )
You can’t perform that action at this time.
0 commit comments