[InstSimplify] Treat invariant group insts as bitcasts for load operands
authorArthur Eubanks <aeubanks@google.com>
Thu, 22 Apr 2021 20:03:09 +0000 (13:03 -0700)
committerArthur Eubanks <aeubanks@google.com>
Tue, 1 Jun 2021 23:33:06 +0000 (16:33 -0700)
commit26044c6a54de3e03c73c5515702b95acdb0b7f22
treefd8d37d52944514f10bbf7490b7d96156d05bd9b
parent3aa943070cc1235c5b8d738dbeb0ca38cb7c6920
[InstSimplify] Treat invariant group insts as bitcasts for load operands

We can look through invariant group intrinsics for the purposes of
simplifying the result of a load.

Since intrinsics can't be constants, but we also don't want to
completely rewrite load constant folding, we convert the load operand to
a constant. For GEPs and bitcasts we just treat them as constants. For
invariant group intrinsics, we treat them as a bitcast.

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D101103
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/test/Transforms/InstSimplify/invariant.group-load.ll