1; RUN: not opt -verify < %s 2>&1 | FileCheck %s 2 3; Operand bundles uses are like regular uses, and need to be dominated 4; by their defs. 5 6declare void @g() 7 8define void @f0(i32* %ptr) { 9; CHECK: Instruction does not dominate all uses! 10; CHECK-NEXT: %x = add i32 42, 1 11; CHECK-NEXT: call void @g() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ] 12 13 entry: 14 %l = load i32, i32* %ptr 15 call void @g() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.0, i64 100, i32 %l) ] 16 %x = add i32 42, 1 17 ret void 18} 19 20define void @f1(i32* %ptr) personality i8 3 { 21; CHECK: Instruction does not dominate all uses! 22; CHECK-NEXT: %x = add i32 42, 1 23; CHECK-NEXT: invoke void @g() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ] 24 25 entry: 26 %l = load i32, i32* %ptr 27 invoke void @g() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.0, i64 100, i32 %l) ] to label %normal unwind label %exception 28 29exception: 30 %cleanup = landingpad i8 cleanup 31 br label %normal 32 33normal: 34 %x = add i32 42, 1 35 ret void 36} 37 38define void @f_deopt(i32* %ptr) { 39; CHECK: Multiple deopt operand bundles 40; CHECK-NEXT: call void @g() [ "deopt"(i32 42, i64 100, i32 %x), "deopt"(float 0.000000e+00, i64 100, i32 %l) ] 41; CHECK-NOT: call void @g() [ "deopt"(i32 42, i64 120, i32 %x) ] 42 43 entry: 44 %l = load i32, i32* %ptr 45 call void @g() [ "deopt"(i32 42, i64 100, i32 %x), "deopt"(float 0.0, i64 100, i32 %l) ] 46 call void @g() [ "deopt"(i32 42, i64 120) ] ;; The verifier should not complain about this one 47 %x = add i32 42, 1 48 ret void 49} 50 51define void @f_gc_transition(i32* %ptr) { 52; CHECK: Multiple gc-transition operand bundles 53; CHECK-NEXT: call void @g() [ "gc-transition"(i32 42, i64 100, i32 %x), "gc-transition"(float 0.000000e+00, i64 100, i32 %l) ] 54; CHECK-NOT: call void @g() [ "gc-transition"(i32 42, i64 120, i32 %x) ] 55 56 entry: 57 %l = load i32, i32* %ptr 58 call void @g() [ "gc-transition"(i32 42, i64 100, i32 %x), "gc-transition"(float 0.0, i64 100, i32 %l) ] 59 call void @g() [ "gc-transition"(i32 42, i64 120) ] ;; The verifier should not complain about this one 60 %x = add i32 42, 1 61 ret void 62} 63