[NVPTX] Add missing preconditions to tensormap replace tests (#174190)
This change adds preconditions for the ISA and SM versions to the
`ptxas` RUN lines for the tests added in
14b1d770db7f9ee49693063ad851215dede0766e which were accidentally
omitted.
[clang][bytecode] Check builtin_memchr for non-block pointers earlier (#174192)
The getType() call might fail. We can't pull the isReadable() check up
though because that creates different diagnostic output compared to the
current interpreter.
Fixes #172202
[clang][bytecode] Check for null Record (#174193)
This is an error case that results in a null Record, so don't crash
later in that case.
Fixes #173941
[CHR] Fix crash when marking merged condition unknown (#173902)
CHR builds the merged hot-path predicate with
IRBuilder::CreateLogicalAnd. That helper is implemented as a select and
can constant-fold to a non- Instruction (e.g. i1 true). The pass then
attempted to mark the merged condition as having explicitly unknown
branch weights when profile data is present, but it unconditionally did
cast<Instruction>(MergedCondition), which can crash in release builds.
Guard the metadata update with dyn_cast<Instruction> and pass the
containing Function explicitly to avoid calling Instruction::getFunction
when the value is not attached yet.
Add a regression test that exercises the constant-folding case.
Crashing stack:
```
2. Running pass "chr" on function "repro_crash"
[14 lines not shown]
ValueTracking: Improve handling of fadd in computeKnownFPClass.
This already recognized that if both inputs are positive, the
result is positive. Extend this to the mirror situation with
negative inputs.
Also special case fadd x, x. Canonically, fmul x, 2 is fadd x, x.
We can tell the sign bit won't change, and 0 will propagate.
ValueTracking: Add more baseline tests for computeKnownFPClass of fadd
Test cases with fadd x, x. Also test cases where both inputs are known
negative.
procfs - Don't reset fd offset when reading regs, fpregs, or dbregs files.
* For repeated reads, we can simply use pread(2). And this way, we allow for
normal shell tooling to work correctly on these procfs files.
* This also matches the behavior on NetBSD.