]> granicus.if.org Git - llvm/commit
[GlobalISel][Localizer] Allow localization of G_INTTOPTR and chains of instructions.
authorAmara Emerson <aemerson@apple.com>
Fri, 21 Jun 2019 00:36:19 +0000 (00:36 +0000)
committerAmara Emerson <aemerson@apple.com>
Fri, 21 Jun 2019 00:36:19 +0000 (00:36 +0000)
commitf469a1f4e37503190d46ea344bb24f0c48d90fff
tree56c441d267cf1fba5baab32b3bc16308b68a21db
parentd3ca385e82dede1994405586086a7938dad6d5b7
[GlobalISel][Localizer] Allow localization of G_INTTOPTR and chains of instructions.

G_INTTOPTR can prevent the localizer from moving G_CONSTANTs, but since it's
essentially a side effect free cast instruction we can remat both instructions.
This patch changes the localizer to enable localization of the chains by
iterating over the entry block instructions in reverse order. That way, uses will
localized first, and then the defs are free to be localized as well.

This also changes the previous SmallPtrSet of localized instructions to use a
SetVector instead. We're dealing with pointers and need deterministic iteration
order.

Overall, this change improves ARM64 -O0 CTMark code size by around 0.7% geomean.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364001 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/GlobalISel/Localizer.h
lib/CodeGen/GlobalISel/Localizer.cpp
test/CodeGen/AArch64/GlobalISel/localizer.mir