llvm-project/llvm/test/Transforms/Scalarizer
Bjorn Pettersson 4c7f820b2b Update @llvm.powi to handle different int sizes for the exponent
This can be seen as a follow up to commit 0ee439b705,
that changed the second argument of __powidf2, __powisf2 and
__powitf2 in compiler-rt from si_int to int. That was to align with
how those runtimes are defined in libgcc.
One thing that seem to have been missing in that patch was to make
sure that the rest of LLVM also handle that the argument now depends
on the size of int (not using the si_int machine mode for 32-bit).
When using __builtin_powi for a target with 16-bit int clang crashed.
And when emitting libcalls to those rtlib functions, typically when
lowering @llvm.powi), the backend would always prepare the exponent
argument as an i32 which caused miscompiles when the rtlib was
compiled with 16-bit int.

The solution used here is to use an overloaded type for the second
argument in @llvm.powi. This way clang can use the "correct" type
when lowering __builtin_powi, and then later when emitting the libcall
it is assumed that the type used in @llvm.powi matches the rtlib
function.

One thing that needed some extra attention was that when vectorizing
calls several passes did not support that several arguments could
be overloaded in the intrinsics. This patch allows overload of a
scalar operand by adding hasVectorInstrinsicOverloadedScalarOpd, with
an entry for powi.

Differential Revision: https://reviews.llvm.org/D99439
2021-06-17 09:38:28 +02:00
..
basic-inseltpoison.ll [Scalarizer] Use poison as insertelement's placeholder 2021-01-04 00:35:28 +09:00
basic.ll [Scalarizer] Use poison as insertelement's placeholder 2021-01-04 00:35:28 +09:00
cache-bug.ll
constant-extractelement.ll
constant-insertelement.ll [Scalarizer] Use poison as insertelement's placeholder 2021-01-04 00:35:28 +09:00
crash-bug.ll
dbginfo.ll Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00
dbgloc-bug-inseltpoison.ll Precommit tests that have poison as shufflevector's placeholder 2020-12-29 17:09:31 +09:00
dbgloc-bug.ll
global-bug-2.ll
global-bug.ll
intrinsics.ll Update @llvm.powi to handle different int sizes for the exponent 2021-06-17 09:38:28 +02:00
order-bug-inseltpoison.ll [Scalarizer] Use poison as insertelement's placeholder 2021-01-04 00:35:28 +09:00
order-bug.ll [Scalarizer] Use poison as insertelement's placeholder 2021-01-04 00:35:28 +09:00
phi-bug-inseltpoison.ll Precommit tests that have poison as shufflevector's placeholder 2020-12-29 17:09:31 +09:00
phi-bug.ll
phi-unreachable-pred.ll
scatter-order.ll [Scalarizer] Use poison as insertelement's placeholder 2021-01-04 00:35:28 +09:00
store-bug.ll
variable-extractelement.ll [Scalarizer] Use poison as insertelement's placeholder 2021-01-04 00:35:28 +09:00
variable-insertelement.ll [Scalarizer] Use poison as insertelement's placeholder 2021-01-04 00:35:28 +09:00
vector-gep.ll [IR] Let IRBuilder's CreateVectorSplat/CreateShuffleVector use poison as placeholder 2020-12-30 04:21:04 +09:00