[SampleProfile] Avoid branch on undef UB in tests (NFC)
authorNikita Popov <npopov@redhat.com>
Tue, 3 Jan 2023 13:23:25 +0000 (14:23 +0100)
committerNikita Popov <npopov@redhat.com>
Tue, 3 Jan 2023 13:23:25 +0000 (14:23 +0100)
llvm/test/Transforms/SampleProfile/pseudo-probe-peep.ll
llvm/test/Transforms/SampleProfile/pseudo-probe-selectionDAG.ll
llvm/test/Transforms/SampleProfile/pseudo-probe-twoaddr.ll

index 00d6411..7b14af9 100644 (file)
@@ -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.
index 535e9b0..5d01e78 100644 (file)
@@ -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.
index f16a21a..d765f34 100644 (file)
@@ -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 }