[all-commits] [llvm/llvm-project] 1d8f2e: [SCEVExpander] Support expanding nonintegral point...

Florian Hahn via All-commits all-commits at lists.llvm.org
Sat Sep 19 09:22:37 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 1d8f2e52925b3a3ab52726c745169f273239329d
      https://github.com/llvm/llvm-project/commit/1d8f2e52925b3a3ab52726c745169f273239329d
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2020-09-19 (Sat, 19 Sep 2020)

  Changed paths:
    M llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
    M llvm/unittests/Transforms/Utils/ScalarEvolutionExpanderTest.cpp

  Log Message:
  -----------
  [SCEVExpander] Support expanding nonintegral pointers with constant base.

Currently SCEVExpander creates inttoptr for non-integral pointers if the
base is a null constant for example. This results in invalid IR.

This patch changes InsertNoopCastOfTo to emit a GEP & bitcast to convert
to a non-integral pointer. First, a GEP of i8* null is generated and the
integral value is used as index. The GEP is then bitcasted to the target
type.

This was exposed by D71539.

Reviewed By: efriedma

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




More information about the All-commits mailing list