OSDN Git Service

Revert "Revert r341269: [Constant Hoisting] Hoisting Constant GEP Expressions"
authorZhaoshi Zheng <zhaoshiz@coduaurora.org>
Tue, 4 Sep 2018 22:17:03 +0000 (22:17 +0000)
committerZhaoshi Zheng <zhaoshiz@coduaurora.org>
Tue, 4 Sep 2018 22:17:03 +0000 (22:17 +0000)
commite4422b6a2a2e01f8fe0ddadfaa7836c21a1ea864
treef8ccf6343598b1c896b47cec1ff9fc3052e710e2
parenta989ec75d4861188cbd060ed22d16fa4486dd8dc
Revert "Revert r341269: [Constant Hoisting] Hoisting Constant GEP Expressions"

Reland r341269. Use std::stable_sort when sorting constant condidates.

Reverting commit, r341365:

  Revert r341269: [Constant Hoisting] Hoisting Constant GEP Expressions

  One of the tests is failing 50% of the time when expensive checks are
  enabled. Not sure how deep the problem is so just reverting while the
  author can investigate so that the bots stop repeatedly failing and
  blaming things incorrectly. Will respond with details on the original
  commit.

Original commit, r341269:

  [Constant Hoisting] Hoisting Constant GEP Expressions

  Leverage existing logic in constant hoisting pass to transform constant GEP
  expressions sharing the same base global variable. Multi-dimensional GEPs are
  rewritten into single-dimensional GEPs.

  https://reviews.llvm.org/D51396

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341417 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/Scalar/ConstantHoisting.h
lib/Transforms/Scalar/ConstantHoisting.cpp
test/CodeGen/AArch64/consthoist-gep.ll [new file with mode: 0644]
test/Transforms/ConstantHoisting/AArch64/const-hoist-gep.ll [new file with mode: 0644]
test/Transforms/ConstantHoisting/ARM/const-hoist-gep.ll [new file with mode: 0644]
test/Transforms/ConstantHoisting/ARM/same-offset-multi-types.ll [new file with mode: 0644]