llvm-project/llvm/unittests
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
..
ADT StringExtrasTest.cpp - add missing newline at the end of file. NFCI. 2021-06-11 14:32:35 +01:00
Analysis Update @llvm.powi to handle different int sizes for the exponent 2021-06-17 09:38:28 +02:00
AsmParser [SVE] Remove calls to VectorType::getNumElements from AsmParserTest 2020-07-07 14:55:42 -07:00
BinaryFormat [BinaryFormat] Add formatv support for DW_OP constants 2020-06-08 15:27:44 +02:00
Bitcode [AMDGPU] Set the default globals address space to 1 2020-11-20 15:46:53 +00:00
Bitstream Switch from llvm::is_trivially_copyable to std::is_trivially_copyable 2020-12-02 22:02:48 -08:00
CodeGen GlobalISel: Avoid use of G_INSERT in insertParts 2021-06-08 14:44:24 -04:00
DebugInfo [Debug-Info][CodeView] Fix GUID string generation for MSVC generated objects. 2021-06-15 06:53:21 +01:00
Demangle [demangler] Initial support for the new Rust mangling scheme 2021-05-03 16:44:30 -07:00
ExecutionEngine [ORC] Fix missing function in unit test. 2021-06-15 21:39:00 +10:00
FileCheck Bump googletest to 1.10.0 2021-05-14 19:16:31 +02:00
Frontend [OPENMP]Fix PR50129: omp cancel parallel not working as expected. 2021-06-04 08:24:55 -07:00
FuzzMutate [FuzzMutate] Add mutator to modify instruction flags. 2021-01-23 19:05:20 +00:00
IR [VP] Binary floating-point intrinsics. 2021-06-14 08:51:41 +02:00
InterfaceStub [llvm] Fix ODRViolations for VersionTuple YAML specializations NFC 2020-10-20 18:29:15 -07:00
LineEditor
Linker [RGT] Recode more unreachable assertions and tautologies 2021-03-19 09:17:22 -07:00
MC [SystemZ][z/OS] Validate symbol names for z/OS for printing without quotes 2021-05-26 10:37:09 -04:00
MI [AMDGPU] Rename amdgcn_wwm to amdgcn_strict_wwm 2021-03-03 09:33:57 +01:00
Object [AIX][XCOFF] emit vector info of traceback table. 2021-06-14 11:15:22 -04:00
ObjectYAML Add -Wno-error=unknown flag to clang-format. 2020-09-19 10:17:57 +02:00
Option [clang][cli] Accept strings instead of options in ImpliedByAnyOf 2021-01-26 09:30:36 +01:00
Passes [NFC] Format PassesBindingsTests CMake like other unittests 2021-05-18 10:40:07 -07:00
ProfileData [SampleFDO] New hierarchical discriminator for FS SampleFDO (llvm-profdata part) 2021-06-04 11:22:06 -07:00
Remarks
Support [Tests] Add missing include (NFC) 2021-06-03 18:58:29 +02:00
TableGen Make TableGenGlobalISel an object library 2021-06-05 15:04:33 +02:00
Target [ARM] Add patterns for vmulh 2021-05-26 09:22:12 +01:00
TextAPI [llvm][TextAPI] add mapping from OS string to Platform 2021-05-06 16:25:56 -07:00
Transforms [VPlan] Add mayReadOrWriteMemory & friends. 2021-05-24 13:11:32 +01:00
XRay Put back the trailing commas on TYPED_TEST_SUITE 2021-05-17 14:14:13 +02:00
tools [llvm-exegesis] Loop unrolling for loop snippet repetitor mode 2021-05-25 12:08:27 +03:00
CMakeLists.txt Reland [FileCheck] Move FileCheck implementation out of LLVMSupport into its own library 2020-09-01 14:59:28 +02:00
unittest.cfg.in