HomePhabricator

[AArch64][GlobalISel] Don't match thread-local globals in matchFoldGlobalOffset

Authored by paquette on Apr 28 2021, 11:13 AM.

Description

[AArch64][GlobalISel] Don't match thread-local globals in matchFoldGlobalOffset

SelectionDAG has separate ISD opcodes for regular global values and thread-local
global values, while GlobalISel does not.

This combine was ported from SDAG directly without knowing that. As a result,
it was running on TLS globals.

This makes it so that matchFoldGlobalOffset doesn't match on TLS globals, and
adds an assert to selectTLSGlobalValue to make sure that TLS globals never
have offsets.

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