[llvm] 2545078 - [SampleProfile] Avoid branch on undef UB in tests (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 3 05:23:41 PST 2023
Author: Nikita Popov
Date: 2023-01-03T14:23:25+01:00
New Revision: 25450788a44795bde1420f1228aa9670c3189018
URL: https://github.com/llvm/llvm-project/commit/25450788a44795bde1420f1228aa9670c3189018
DIFF: https://github.com/llvm/llvm-project/commit/25450788a44795bde1420f1228aa9670c3189018.diff
LOG: [SampleProfile] Avoid branch on undef UB in tests (NFC)
Added:
Modified:
llvm/test/Transforms/SampleProfile/pseudo-probe-peep.ll
llvm/test/Transforms/SampleProfile/pseudo-probe-selectionDAG.ll
llvm/test/Transforms/SampleProfile/pseudo-probe-twoaddr.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/SampleProfile/pseudo-probe-peep.ll b/llvm/test/Transforms/SampleProfile/pseudo-probe-peep.ll
index 00d641105a487..7b14af9851dc6 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 535e9b0e95f2c..5d01e78221e38 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 f16a21a9ded3a..d765f34160830 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 }
More information about the llvm-commits
mailing list