HomePhabricator

[Scalarizer] Fix a non-deterministic scatter order problem

Authored by bjope on Apr 19 2020, 3:56 AM.

Description

[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

Details

Committed
bjopeApr 20 2020, 7:05 AM
Reviewer
foad
Differential Revision
D78455: [Scalarizer] Fix a non-deterministic scatter order problem
Parents
rG515020c091e7: [SveEmitter] Add more immediate operand checks.
Branches
Unknown
Tags
Unknown