[PATCH] D127964: [DCE] Eliminate no-op atan and atan2 calls

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 19 11:41:55 PDT 2022


spatel added a comment.

There's an earlier check in `canConstantFoldCallTo()` that appears to prevent folding on "atanl" (and other long double calls), but it would be good to include a test like this to confirm:

  define x86_fp80 @atanl_x86(x86_fp80 %x) {
    %call = call x86_fp80 @atanl(x86_fp80 noundef 0xK3FFF8CCCCCCCCCCCCCCD)
    ret x86_fp80 %call
  }



================
Comment at: llvm/test/Transforms/EarlyCSE/atan.ll:2
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -early-cse -S < %s | FileCheck %s
+
----------------
Unless there's a reason/difference, I'd expect tests like this to be in the folder tests/Transforms/InstSimplify/ConstProp with similar tests for mathlib calls and use "RUN: opt -passes=instsimplify..."


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

https://reviews.llvm.org/D127964



More information about the llvm-commits mailing list