From 25450788a44795bde1420f1228aa9670c3189018 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 3 Jan 2023 14:23:25 +0100 Subject: [PATCH] [SampleProfile] Avoid branch on undef UB in tests (NFC) --- llvm/test/Transforms/SampleProfile/pseudo-probe-peep.ll | 4 ++-- llvm/test/Transforms/SampleProfile/pseudo-probe-selectionDAG.ll | 4 ++-- llvm/test/Transforms/SampleProfile/pseudo-probe-twoaddr.ll | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/llvm/test/Transforms/SampleProfile/pseudo-probe-peep.ll b/llvm/test/Transforms/SampleProfile/pseudo-probe-peep.ll index 00d6411..7b14af9 100644 --- a/llvm/test/Transforms/SampleProfile/pseudo-probe-peep.ll +++ b/llvm/test/Transforms/SampleProfile/pseudo-probe-peep.ll @@ -1,10 +1,10 @@ ; REQUIRES: x86_64-linux ; RUN: llc -mtriple=x86_64-- -stop-after=peephole-opt -o - %s | FileCheck %s -define internal i32 @arc_compare() { +define internal i32 @arc_compare(i1 %c) { entry: %0 = load i64, ptr undef, align 8 - br i1 undef, label %return, label %if.end + br i1 %c, label %return, label %if.end if.end: ; preds = %entry ; Chek a register copy has been sinked into the compare instruction. diff --git a/llvm/test/Transforms/SampleProfile/pseudo-probe-selectionDAG.ll b/llvm/test/Transforms/SampleProfile/pseudo-probe-selectionDAG.ll index 535e9b0..5d01e78 100644 --- a/llvm/test/Transforms/SampleProfile/pseudo-probe-selectionDAG.ll +++ b/llvm/test/Transforms/SampleProfile/pseudo-probe-selectionDAG.ll @@ -3,10 +3,10 @@ ; RUN: FileCheck %s < %t --check-prefix=IR ; RUN: llc -mtriple=x86_64-- -stop-after=finalize-isel %t -o - | FileCheck %s --check-prefix=MIR -define internal i32 @arc_compare() { +define internal i32 @arc_compare(i1 %c) { entry: %0 = load i64, ptr undef, align 8 - br i1 undef, label %return, label %if.end + br i1 %c, label %return, label %if.end if.end: ; preds = %entry ;; Check pseudo probes are next to each other at the beginning of this block. diff --git a/llvm/test/Transforms/SampleProfile/pseudo-probe-twoaddr.ll b/llvm/test/Transforms/SampleProfile/pseudo-probe-twoaddr.ll index f16a21a..d765f34 100644 --- a/llvm/test/Transforms/SampleProfile/pseudo-probe-twoaddr.ll +++ b/llvm/test/Transforms/SampleProfile/pseudo-probe-twoaddr.ll @@ -2,13 +2,13 @@ ; RUN: llc -stop-after=twoaddressinstruction -mtriple=x86_64-- -o - %s | FileCheck %s -define dso_local double @twoaddressinstruction() local_unnamed_addr { +define dso_local double @twoaddressinstruction(i1 %c) local_unnamed_addr { for.end: %0 = load i64, ptr undef, align 8 br label %for.body14.preheader for.body14.preheader: ; preds = %for.end - br i1 undef, label %for.cond25.preheader.loopexit.unr-lcssa, label %for.body14.preheader.new + br i1 %c, label %for.cond25.preheader.loopexit.unr-lcssa, label %for.body14.preheader.new for.body14.preheader.new: ; preds = %for.body14.preheader %unroll_iter136 = and i64 %0, -4 @@ -35,4 +35,4 @@ for.body14: ; preds = %for.body14, %for.bo ; Function Attrs: inaccessiblememonly nounwind willreturn declare void @llvm.pseudoprobe(i64, i64, i32, i64) #0 -attributes #0 = { inaccessiblememonly nounwind willreturn } \ No newline at end of file +attributes #0 = { inaccessiblememonly nounwind willreturn } -- 2.7.4