[all-commits] [llvm/llvm-project] a8a31f: [Scalarizer] Fix a non-deterministic scatter order...

Björn Pettersson via All-commits all-commits at lists.llvm.org
Mon Apr 20 07:06:48 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a8a31fdd80ccd5c9939ac41a8751ab3e7b8e146d
      https://github.com/llvm/llvm-project/commit/a8a31fdd80ccd5c9939ac41a8751ab3e7b8e146d
  Author: Bjorn Pettersson <bjorn.a.pettersson at ericsson.com>
  Date:   2020-04-20 (Mon, 20 Apr 2020)

  Changed paths:
    M llvm/lib/Transforms/Scalar/Scalarizer.cpp
    A llvm/test/Transforms/Scalarizer/scatter-order.ll

  Log Message:
  -----------
  [Scalarizer] Fix a non-deterministic scatter order problem

Summary:
The indexing operator in Scatterer may result in building new
instructions. When using multiple such operators in a function
argument list the order in which we build instructions depend on
argument evaluation order (which is undefined in C++).
This patch avoid such problems by expanding the components using
the [] operator prior to the function call.

Problem was seen when comparing output, while builing LLVM with
different compilers (clang vs gcc).

Reviewers: foad, cameron.mcinally, uabelho

Reviewed By: foad

Subscribers: hiraditya, mgrang, llvm-commits

Tags: #llvm

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




More information about the All-commits mailing list