[all-commits] [llvm/llvm-project] 4bf015: [AlignmentFromAssumptions] Fix a SCEV assertion re...

Richard Diamond via All-commits all-commits at lists.llvm.org
Sat Mar 28 23:26:35 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 4bf015c035e4e5b63c7222dfb15ff274a5ed905c
      https://github.com/llvm/llvm-project/commit/4bf015c035e4e5b63c7222dfb15ff274a5ed905c
  Author: Richard Diamond <wichard at vitalitystudios.com>
  Date:   2020-03-29 (Sun, 29 Mar 2020)

  Changed paths:
    M llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
    A llvm/test/Transforms/AlignmentFromAssumptions/amdgpu-crash.ll

  Log Message:
  -----------
  [AlignmentFromAssumptions] Fix a SCEV assertion resulting from address space differences.

Summary:
On targets with different pointer sizes, -alignment-from-assumptions could attempt to create SCEV expressions which use different effective SCEV types. The provided test illustrates the issue.

In `getNewAlignment`, AASCEV would be the (only) alloca, which would have an effective SCEV type of i32. But PtrSCEV, the GEP in this case, due to being in the flat/default address space, will have an effective SCEV of i64.

This patch resolves the issue by truncating PtrSCEV to AASCEV's effective type.

Reviewers: hfinkel, jdoerfert

Reviewed By: jdoerfert

Subscribers: jvesely, nhaehnle, hiraditya, javed.absar, kerbowa, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75471




More information about the All-commits mailing list