[PATCH] D157456: [JT] Fixes typo in assertions and updates test.

Micah Weston via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 8 16:56:40 PDT 2023


red1bluelost created this revision.
red1bluelost added a reviewer: ebrevnov.
Herald added a subscriber: hiraditya.
Herald added a project: All.
red1bluelost requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Noticed a typo in Jump Threading when checking BPI and BFI. This
lead to a test failing which needed BPI.

Ran check-llvm to verify no regressions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157456

Files:
  llvm/lib/Transforms/Scalar/JumpThreading.cpp
  llvm/test/Transforms/JumpThreading/select.ll


Index: llvm/test/Transforms/JumpThreading/select.ll
===================================================================
--- llvm/test/Transforms/JumpThreading/select.ll
+++ llvm/test/Transforms/JumpThreading/select.ll
@@ -1,6 +1,6 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
 ; RUN: opt -S -passes="jump-threading" -debug-only=branch-prob < %s 2>&1 | FileCheck %s
-; RUN: opt -S -passes="require<branch-prob>,jump-threading" -debug-only=branch-prob < %s 2>&1 | FileCheck -check-prefixes=CHECK,CHECK-BPI %s
+; RUN: opt -S -passes="require<branch-prob>,require<block-freq>,jump-threading" -debug-only=branch-prob < %s 2>&1 | FileCheck -check-prefixes=CHECK,CHECK-BPI %s
 ; REQUIRES: asserts
 
 ; CHECK-BPI-LABEL:  ---- Branch Probability Info : unfold1 ----
Index: llvm/lib/Transforms/Scalar/JumpThreading.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/JumpThreading.cpp
+++ llvm/lib/Transforms/Scalar/JumpThreading.cpp
@@ -2481,7 +2481,7 @@
                                                      BlockFrequencyInfo *BFI,
                                                      BranchProbabilityInfo *BPI,
                                                      bool HasProfile) {
-  assert(((BFI && BPI) || (!BFI && !BFI)) &&
+  assert(((BFI && BPI) || (!BFI && !BPI)) &&
          "Both BFI & BPI should either be set or unset");
 
   if (!BFI) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157456.548403.patch
Type: text/x-patch
Size: 1458 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230808/36b73cf0/attachment.bin>


More information about the llvm-commits mailing list