32 lines · plain
1; RUN: opt -S -debugify -codegenprepare %s -o - | FileCheck %s --check-prefix=DEBUGIFY2;3; Copied from codegen-prepare-addrmode-sext.ll -- for the twoArgsNoPromotion4; function, CGP attempts a type promotion transaction on the sext to replace5; it with %add, but then rolls it back. This involves re-inserting the sext6; instruction between two dbg.value intrinsics, and un-RAUWing the users of7; the sext.8; This test checks that this works correctly in both dbg.value mode, but also9; RemoveDIs non-intrinsic debug-info mode.10 11target datalayout = "e-i64:64-f80:128-s:64-n8:16:32:64-S128"12target triple = "x86_64-apple-macosx"13 14; DEBUGIFY-LABEL: @twoArgsNoPromotion15; DEBUGIFY-NEXT: %add = add16; DEBUGIFY-NEXT: #dbg_value(i32 %add,17; DEBUGIFY-NEXT: %sextadd = sext18; DEBUGIFY-NEXT: #dbg_value(i64 %sextadd,19; DEBUGIFY-NEXT: %arrayidx = getelementptr20; DEBUGIFY-NEXT: #dbg_value(ptr %arrayidx,21; DEBUGIFY-NEXT: %res = load i8,22; DEBUGIFY-NEXT: #dbg_value(i8 %res,23; DEBUGIFY-NEXT: ret i8 %res,24define i8 @twoArgsNoPromotion(i32 %arg1, i32 %arg2, ptr %base) {25 %add = add nsw i32 %arg1, %arg226 %sextadd = sext i32 %add to i6427 %arrayidx = getelementptr inbounds i8, ptr %base, i64 %sextadd28 %res = load i8, ptr %arrayidx29 ret i8 %res30}31 32