[PATCH] D78455: [Scalarizer] Fix a non-deterministic scatter order problem

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 19 09:37:08 PDT 2020


bjope created this revision.
bjope added reviewers: foad, cameron.mcinally, uabelho.
Herald added subscribers: mgrang, hiraditya.
Herald added a project: LLVM.

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).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78455

Files:
  llvm/lib/Transforms/Scalar/Scalarizer.cpp
  llvm/test/Transforms/Scalarizer/scatter-order.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78455.258607.patch
Type: text/x-patch
Size: 7776 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200419/e1eb66d4/attachment.bin>


More information about the llvm-commits mailing list