[PATCH] D149422: [ValueTracking] Add tests for checking whether `div`/`rem` is safe to speculate; NFC

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 28 01:14:27 PDT 2023


nikic added a comment.

The test cases would probably be simpler if this were using LICM.



================
Comment at: llvm/test/Analysis/ValueTracking/speculate-div.ll:2
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -S --passes='simplifycfg<hoist-common-insts>' %s | FileCheck %s
+
----------------
Should have mentioned this earlier, but please don't put tests into llvm/test/Analysis/ValueTracking, unless they use special analysis printers. Instead put them into the pass being tested, here `llvm/test/Transforms/SimplifyCFG`.


================
Comment at: llvm/test/Analysis/ValueTracking/speculate-div.ll:7
+
+define void @f_sdiv_not_okay(i1 %c, ptr nocapture noundef %d, ptr nocapture noundef readonly %m, ptr nocapture noundef readonly %b, i16 %xx) {
+; CHECK-LABEL: @f_sdiv_not_okay(
----------------
The function attributes shouldn't be needed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149422/new/

https://reviews.llvm.org/D149422



More information about the llvm-commits mailing list