[PATCH] D102919: [InstCombine][msp430] Pre-commit test case for @llvm.powi and 16-bit ints

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 21 06:31:34 PDT 2021


bjope created this revision.
bjope requested review of this revision.
Herald added a project: LLVM.

This is a pre-commit of a test case D99439 <https://reviews.llvm.org/D99439> which is a patch that
updates @llvm.powi to handle different int sizes for the exponent.

Problem is that @llvm.powi is used as an IR construct that maps
to RT libcalls to __powi* functions, and those lib functions depend
on sizeof(int) to use correct type for the exponent.

The test cases show that we use i32 for the powi expenent, which
later would result in wrong type being used in libcalls (miscompile).

But there are also a couple of the negative test cases that show
that we rewrite into using powi when having a uitofp conversion
from i16, which would be wrong when doing the libcall as an
"unsigned int" isn't guaranteed to fit inside the "int" argument
in the called libcall function.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102919

Files:
  llvm/test/Transforms/InstCombine/pow_fp_int16.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102919.347013.patch
Type: text/x-patch
Size: 19207 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210521/cc30c952/attachment.bin>


More information about the llvm-commits mailing list