Commit graph

5 commits

Author SHA1 Message Date
Martin Kinkelin
7be38fd220
Try to use memcmp for (in)equality of non-mutable static arrays and mutable slices (#3401)
Fixes #3400. The frontend pre-casts the static array operand to the
slice type for cases like `bool[4] == bool[]`, but that's not possible
in case the static array is non-mutable but the slice type is mutable.

So check the element types for equivalence, not the array types, as
static arrays and slices are NOT equivalent.
2020-04-17 22:09:55 +02:00
Martin Kinkelin
c25614eb6b Adapt lit-tests to LLVM 9 2019-09-25 03:42:19 +02:00
Martin Kinkelin
12720e096b Adapt lit-test to druntime changes 2019-08-25 00:36:15 +02:00
Johan Engelen
79d83cdb80
Fix array_equals_memcmp_dyn test. (#2637)
The frontend now does most of the dyn-dyn comparison optimization (turning it into a druntime template function call).

Fixes a failure on PPC.
2018-05-07 19:53:35 +02:00
Johan Engelen
a4055962fe Implement optimization: compare slices using memcmp if valid (#2047)
This also fixes a pessimization where the `memcmp` call would become an `invoke` if the user provides his own `memcmp` prototype in the code (the prototype would not carry the `nounwind` function attribute).
2017-03-29 20:00:21 +02:00