1. [RISCV] Use tail agnostic policy for vsetvli instruction emitted in the custom inserter (details)
  2. [Polly] Consider InvalidContext to determine partial READ. (details)
Commit b90e2d850e780d290b554963db1cd264625a73a4 by craig.topper
[RISCV] Use tail agnostic policy for vsetvli instruction emitted in the custom inserter

The compiler is making no effort to preserve upper elements. To do so would require another source operand tied with the destination and a different intrinsic interface to give control of this source to the programmer.

This patch changes the tail policy to agnostic so that the CPU doesn't need to make an effort to preserve them.

This is consistent with the RVV intrinsic spec here

Differential Revision:
The file was modifiedllvm/lib/Target/RISCV/RISCVISelLowering.cpp
The file was modifiedllvm/test/CodeGen/RISCV/rvv/add-vsetvli-vlmax.ll
The file was modifiedllvm/test/CodeGen/RISCV/rvv/load-add-store-64.ll
The file was modifiedllvm/test/CodeGen/RISCV/rvv/load-add-store-8.ll
The file was modifiedllvm/test/CodeGen/RISCV/rvv/load-add-store-32.ll
The file was modifiedllvm/test/CodeGen/RISCV/rvv/load-add-store-16.ll
The file was modifiedllvm/test/CodeGen/RISCV/rvv/add-vsetvli-gpr.mir
Commit bc633fe46bbec1cf70d4a3f740da43888979d8c6 by llvm-project
[Polly] Consider InvalidContext to determine partial READ.

MemoryAccess::setNewAccessRelation() in assert-builds checks whether the
access relation for a READ has a memory location for every instance of
the domain. Otherwise, we would not have value to load from. That check
already considered that instances outside the Scop's context do not
matter since they are never executed (or would be undefined behavior).
In this patch also take instances of the InvalidContext into account,
as these can also be assumed to never occur. InvalidContext was
introduced to avoid the computational complexity of subtracting
restrictions from the AssumedContext. However, this additional check in
setNewAccessRelation is only done in assert-builds.

The assertion case with an InvalidContext may occur with DeLICM on a
conditionally infinite loops, as it is the case in the following code:

    for (int i = 0; i < n; i+=b)
      vreg = ...;
    *Dest = vreg;

The loop is infinite when b=0, and [b] -> { : b = 0 }  is part of the
InvalidContext. When DeLICM tries to map the memory for %vreg to *Dest,
there is no store instance that uses the value of vreg when b = 0, hence
no location to map it to. However, the case is irrelevant since Polly's
runtime condition check ensures that this is never case.

The file was modifiedpolly/include/polly/Support/ISLTools.h
The file was modifiedpolly/lib/Support/ISLTools.cpp
The file was modifiedpolly/lib/Analysis/ScopInfo.cpp
The file was addedpolly/test/DeLICM/load-in-cond-inf-loop.ll