[PATCH] D102673: [ConstantFolding] Fold constrained arithmetic intrinsics

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 15 09:52:54 PDT 2021


spatel accepted this revision.
spatel added a comment.
This revision is now accepted and ready to land.

LGTM - see inline for some test file suggestions. 
Might want to get a 2nd opinion though - I haven't used constrained ops or FP exceptions in C outside of toy examples.



================
Comment at: llvm/test/Transforms/InstSimplify/constfold-constrained.ll:1
 ; RUN: opt < %s -instsimplify -S | FileCheck %s
 
----------------
If there's not too much noise, I recommend using utils/update_test_checks.py to auto-generate the FileCheck lines in this file - it should eliminate typos and make it easier to update the file with new tests. 

So (1) add new tests, (2) auto-generate the baseline CHECKs for all tests, (3) apply this patch and re-run the script, so we just have the test diffs.


================
Comment at: llvm/test/Transforms/InstSimplify/fdiv-strictfp.ll:27
 ;
-  %f = call float @llvm.experimental.constrained.fdiv.f32(float 3.0, float 2.0, metadata !"round.tonearest", metadata !"fpexcept.ignore") #0
   ret float %f
----------------
Fix this test to not be misleading as a preliminary/NFC commit?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102673



More information about the llvm-commits mailing list