HomePhabricator

[PowerPC] Do not use FISel for calls and TOC-based accesses with PC-Rel

Authored by nemanjai on Aug 24 2020, 2:51 PM.

Description

[PowerPC] Do not use FISel for calls and TOC-based accesses with PC-Rel

PC-Relative addressing introduces a fair bit of complexity for correctly
eliminating TOC accesses. FastISel does not include any of that handling so we
miscompile code with -mcpu=pwr10 -O0 if it includes an external call that
FastISel does not handle followed by any of the following:

Floating point constant materialization
Materialization of a GlobalValue
Call that FastISel does handle

This patch switches to SDISel for any of the above.

Differential revision: https://reviews.llvm.org/D86343