[all-commits] [llvm/llvm-project] 703ee9: [AlignFromAssume] Bailout w/non-constant alignment...

Philip Reames via All-commits all-commits at lists.llvm.org
Wed Sep 1 17:37:00 PDT 2021


  Branch: refs/heads/release/13.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 703ee975d26a1542e2a431722af0ce904a0ca149
      https://github.com/llvm/llvm-project/commit/703ee975d26a1542e2a431722af0ce904a0ca149
  Author: Philip Reames <listmail at philipreames.com>
  Date:   2021-09-01 (Wed, 01 Sep 2021)

  Changed paths:
    M llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
    M llvm/test/Transforms/AlignmentFromAssumptions/simple.ll

  Log Message:
  -----------
  [AlignFromAssume] Bailout w/non-constant alignments (pr51680)

This is a bailout for pr51680.  This pass appears to assume that the alignment operand to an align tag on an assume bundle is constant.  This doesn't appear to be required anywhere, and clang happily generates non-constant alignments for cases such as this case taken from the bug report:

// clang -cc1 -triple powerpc64-- -S -O1 opal_pci-min.c
extern int a[];
long *b;
long c;
void *d(long, int *, int, long, long, long) __attribute__((__alloc_align__(6)));
void e() {
  b = d(c, a, 0, 0, 5, c);
  b[0] = 0;
}

This was exposed by a SCEV change which allowed a non-constant alignment to reach further into the pass' code.  We could generalize the pass, but for now, let's fix the crash.

(cherry picked from commit 9b45fd909ffa754acbb4e927bc2d55c7ab0d4e3f)




More information about the All-commits mailing list