1*33b939c3SRoman Lebedev; RUN: opt -passes=consthoist -S < %s | FileCheck %s 2cee313d2SEric Christophertarget triple = "thumbv6m-none-eabi" 3cee313d2SEric Christopher 4cee313d2SEric Christopher%T = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, 5cee313d2SEric Christopheri32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, 6cee313d2SEric Christopheri32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, 7cee313d2SEric Christopheri32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, 8cee313d2SEric Christopheri32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, 9cee313d2SEric Christopheri32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, 10cee313d2SEric Christopheri32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, 11cee313d2SEric Christopheri32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, 12cee313d2SEric Christopheri32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, 13cee313d2SEric Christopheri32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, 14cee313d2SEric Christopheri32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, 15cee313d2SEric Christopheri32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, 16cee313d2SEric Christopheri32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, 17cee313d2SEric Christopheri32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, 18cee313d2SEric Christopheri32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, 19cee313d2SEric Christopheri32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, 20cee313d2SEric Christopheri32, i32, i32, i32, i32, i32 } 21cee313d2SEric Christopher 22cee313d2SEric Christopher; The second operand of insertvalue is able to be hoisted. 23cee313d2SEric Christopherdefine void @test1(%T %P) { 24cee313d2SEric Christopher; CHECK-LABEL: @test1 25cee313d2SEric Christopher; CHECK: %const = bitcast i32 256 to i32 26cee313d2SEric Christopher; CHECK: %1 = insertvalue %T %P, i32 %const, 256 27cee313d2SEric Christopher; CHECK: %2 = insertvalue %T %P, i32 %const, 256 28cee313d2SEric Christopher %1 = insertvalue %T %P, i32 256, 256 29cee313d2SEric Christopher %2 = insertvalue %T %P, i32 256, 256 30cee313d2SEric Christopher ret void 31cee313d2SEric Christopher} 32