OSDN Git Service

Reland r301880(!): "[InstSimplify] Handle selects of GEPs with 0 offset"
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Tue, 24 Apr 2018 00:25:01 +0000 (00:25 +0000)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Tue, 24 Apr 2018 00:25:01 +0000 (00:25 +0000)
commit557491f34d42e51670d8e43d0556cbd06ca19735
tree15aa8ce85420b1f399c3f521c66e8225eb076613
parenta6786e9cb26b650b1da6575d7a2fd4330262e102
Reland r301880(!): "[InstSimplify] Handle selects of GEPs with 0 offset"

I was reminded today that this patch got reverted in r301885. I can no
longer reproduce the failure that caused the revert locally (...almost
one year later), and the patch applied pretty cleanly, so I guess we'll
see if the bots still get angry about it.

The original breakage was InstSimplify complaining (in "assertion
failed" form) about getting passed some crazy IR when running `ninja
check-sanitizer`. I'm unable to find traces of what, exactly, said crazy
IR was. I suppose we'll find out pretty soon if that's still the case.
:)

Original commit:

  Author: gbiv
  Date: Mon May  1 18:12:08 2017
  New Revision: 301880

  URL: http://llvm.org/viewvc/llvm-project?rev=301880&view=rev
  Log:
  [InstSimplify] Handle selects of GEPs with 0 offset

  In particular (since it wouldn't fit nicely in the summary):
  (select (icmp eq V 0) P (getelementptr P V)) -> (getelementptr P V)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330667 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/InstructionSimplify.cpp
test/Transforms/InstSimplify/select.ll