Jan Wen Voung | 6dc3076 | 2013-03-12 16:27:52 +0000 | [diff] [blame] | 1 | ; REQUIRES: asserts |
Chandler Carruth | 5da5343 | 2012-07-02 18:37:59 +0000 | [diff] [blame] | 2 | ; RUN: opt -mergefunc -stats -disable-output < %s 2>&1 | grep "functions merged" |
Nick Lewycky | 13e04ae | 2011-01-27 08:38:19 +0000 | [diff] [blame] | 3 | |
| 4 | ; This test is checks whether we can merge |
| 5 | ; vector<intptr_t>::push_back(0) |
| 6 | ; and |
| 7 | ; vector<void *>::push_back(0) |
| 8 | ; . |
| 9 | |
| 10 | target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" |
| 11 | target triple = "x86_64-unknown-linux-gnu" |
| 12 | |
| 13 | %0 = type { i32, void ()* } |
| 14 | %1 = type { i64, i1 } |
| 15 | %"class.std::vector" = type { [24 x i8] } |
| 16 | |
| 17 | @vi = global %"class.std::vector" zeroinitializer, align 8 |
| 18 | @__dso_handle = external unnamed_addr global i8* |
| 19 | @vp = global %"class.std::vector" zeroinitializer, align 8 |
| 20 | @llvm.global_ctors = appending global [1 x %0] [%0 { i32 65535, void ()* @_GLOBAL__I_a }] |
| 21 | |
| 22 | define linkonce_odr void @_ZNSt6vectorIlSaIlEED1Ev(%"class.std::vector"* nocapture %this) unnamed_addr align 2 { |
| 23 | entry: |
| 24 | %tmp2.i.i = bitcast %"class.std::vector"* %this to i64** |
Manman Ren | 1a5ff28 | 2013-04-30 17:52:57 +0000 | [diff] [blame] | 25 | %tmp3.i.i = load i64** %tmp2.i.i, align 8 |
Nick Lewycky | 13e04ae | 2011-01-27 08:38:19 +0000 | [diff] [blame] | 26 | %tobool.i.i.i = icmp eq i64* %tmp3.i.i, null |
| 27 | br i1 %tobool.i.i.i, label %_ZNSt6vectorIlSaIlEED2Ev.exit, label %if.then.i.i.i |
| 28 | |
| 29 | if.then.i.i.i: ; preds = %entry |
| 30 | %0 = bitcast i64* %tmp3.i.i to i8* |
| 31 | tail call void @_ZdlPv(i8* %0) nounwind |
| 32 | ret void |
| 33 | |
| 34 | _ZNSt6vectorIlSaIlEED2Ev.exit: ; preds = %entry |
| 35 | ret void |
| 36 | } |
| 37 | |
| 38 | declare i32 @__cxa_atexit(void (i8*)*, i8*, i8*) |
| 39 | |
| 40 | define linkonce_odr void @_ZNSt6vectorIPvSaIS0_EED1Ev(%"class.std::vector"* nocapture %this) unnamed_addr align 2 { |
| 41 | entry: |
| 42 | %tmp2.i.i = bitcast %"class.std::vector"* %this to i8*** |
Manman Ren | 1a5ff28 | 2013-04-30 17:52:57 +0000 | [diff] [blame] | 43 | %tmp3.i.i = load i8*** %tmp2.i.i, align 8 |
Nick Lewycky | 13e04ae | 2011-01-27 08:38:19 +0000 | [diff] [blame] | 44 | %tobool.i.i.i = icmp eq i8** %tmp3.i.i, null |
| 45 | br i1 %tobool.i.i.i, label %_ZNSt6vectorIPvSaIS0_EED2Ev.exit, label %if.then.i.i.i |
| 46 | |
| 47 | if.then.i.i.i: ; preds = %entry |
| 48 | %0 = bitcast i8** %tmp3.i.i to i8* |
| 49 | tail call void @_ZdlPv(i8* %0) nounwind |
| 50 | ret void |
| 51 | |
| 52 | _ZNSt6vectorIPvSaIS0_EED2Ev.exit: ; preds = %entry |
| 53 | ret void |
| 54 | } |
| 55 | |
| 56 | declare void @_Z1fv() |
| 57 | |
| 58 | declare void @_ZNSt6vectorIPvSaIS0_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS0_S2_EERKS0_(%"class.std::vector"* nocapture %this, i8** %__position.coerce, i8** nocapture %__x) align 2 |
| 59 | |
| 60 | declare void @_ZdlPv(i8*) nounwind |
| 61 | |
| 62 | declare void @llvm.memmove.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind |
| 63 | |
| 64 | declare void @_ZSt17__throw_bad_allocv() noreturn |
| 65 | |
| 66 | declare noalias i8* @_Znwm(i64) |
| 67 | |
| 68 | declare void @_ZNSt6vectorIlSaIlEE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPlS1_EERKl(%"class.std::vector"* nocapture %this, i64* %__position.coerce, i64* nocapture %__x) align 2 |
| 69 | |
| 70 | declare void @_GLOBAL__I_a() |
| 71 | |
| 72 | declare %1 @llvm.uadd.with.overflow.i64(i64, i64) nounwind readnone |