[clang-tidy] Speed up deduplicating warnings from alias checks (#174237)
Right now, the deduplication algorithm runs in O(n²) time, because it
goes warning-by-warning (an O(n) operation), removing duplicates using
`std::vector::erase` (another O(n) operation). This starts taking up a
noticeable amount of time as you start getting a lot of warnings. For
example, running all checks over `clang/lib/Sema/Sema.cpp` and the
headers it includes:
```sh
time ./build/release/bin/clang-tidy -p build/debug --checks=* clang/lib/Sema/Sema.cpp -header-filter=.* > /dev/null
```
...takes 2m9s on my system before this change and 1m52s after. Now, this
scenario *is* a bit artificial; I imagine runs with so many warnings are
uncommon in practice. On the other hand, the change is quite small,
so we're not really going out of our way to improve it.
[lldb] Handle not being able to read a file in the SourceManager (#174346)
Even if a file has a valid modification time, it's possible that reading
the data fails. The SourceManager wasn't accounting for that, which
would result in a crash due to an unchecked read from a null `data_sp`.
We were seeing the issue when trying to read from a buggy virtual file
system, but presumably the same thing can happen with a poorly timed
unmount of a drive.
rdar://166414707
Merge branches 'users/chapuni/mcdc/nest/covmapdesc', 'users/chapuni/mcdc/nest/covgen', 'users/chapuni/mcdc/nest/logopstack' and 'users/chapuni/mcdc/nest/bitmapaddr' into HEAD
[clang][bytecode] Fix typeid test under msan (#174317)
The original problem description sounded sane but it was lacking a bit.
What happens where is that the global block is ultimately not
initialized simply because it was already created before and its
initializer failed, causing us to call invokeDtor() in a previous
evaluation.
Check for the initialion state earlier and abort there instead of
accessing the (now uninitialized) data of the block, causing msan
failures.
See the failed msan build at
https://lab.llvm.org/buildbot/#/builders/164/builds/17206
[flang][cuda] Skip sizeof intrinsic in check (#174339)
#174025 introduced a new semantic check for host intrinsic with device
variable.`sizeof` intrinsic extension should be skipped for this check.
[X86] LowerMINMAX - use valuetracking to attempt to find a smaller type that can efficiently lower min/max ops (#174294)
We currently use the generic expansions to custom lower integer min/max
instructions, but if we have sufficient leading bits, SSE/AVX is always
better off handling it directly with smaller types.
vXi64 cmp/min/max is particularly weak, and as we narrow the types the
better legality we have - this approach seems to work well for x86, but
I'm not sure if its valid enough to try generically in this manner.
However, I added the signed/unsigned generic flip fold to
expandIntMINMAX to further improve SSE2 codegen, similar to what we
already attempt in DAGCombiner (which with a bit more work we might be
able to remove now).
All thats missing is better ComputeNumSignBits handling for vXi64 ashr
expansion, which still misses a lot of cases when split across vXi32
types and shuffles.
Fixes #174169
IR: Promote "denormal-fp-math" to a first class attribute
Convert "denormal-fp-math" and "denormal-fp-math-f32" into a first
class denormal_fpenv attribute. Previously the query for the effective
deormal mode involved two string attribute queries with parsing. I'm
introducing more uses of this, so it makes sense to convert this
to a more efficient encoding. The old representation was also awkward
since it was split across two separate attributes. The new encoding
just stores the default and float modes as bitfields, largely avoiding
the need to consider if the other mode is set.
The syntax in the common cases looks like this:
`denormal_fpenv(preservesign,preservesign)`
`denormal_fpenv(float: preservesign,preservesign)`
`denormal_fpenv(dynamic,dynamic float: preservesign,preservesign)`
I wasn't sure about reusing the float type name instead of adding a
new keyword. It's parsed as a type but only accepts float. I'm also
debating switching the name to subnormal to match the current
[18 lines not shown]
Partially reapply "ValueTracking: Improve handling of fadd in computeKnownFPClass." (#174290) (#174332)
This partially reverts commit 108a22ed5fa1836b4cfcd05e9d96f98a533068d5.
Restore the sign-bit tracking for both inputs known-negative case,
and leave the 0 handling for later. There is a libc test improperly
relying on running code compiled for IEEE behavior that changed
the output denormal mode.