[PowerPC] Materialize 34-bit constants with pli directly
authorAmy Kwan <amy.kwan1@ibm.com>
Tue, 6 Apr 2021 17:25:53 +0000 (12:25 -0500)
committerAmy Kwan <amy.kwan1@ibm.com>
Tue, 6 Apr 2021 18:38:11 +0000 (13:38 -0500)
commitbd6033eca7be937a236401fdbbf414d6929a44e8
tree918044901953b6288264f022e19de075846ec98b
parenta7ef45bc5c1d0c2788680dbcb261304d7dfae03c
[PowerPC] Materialize 34-bit constants with pli directly

Previously, 34-bit constants were materialized in selectI64Imm(), and we relied
on td pattern matching to instead produce a pli. This becomes problematic as
there is no guarantee that the 34-bit constant will reach the td pattern
selection for pli. It is also possible for other transformations (such as complex
bit permutations) to also produce and utilize the 34-bit constant materialized
through selectI64Imm().

This patch instead produces pli on Power10 directly whenever the constant fits
within 34-bits.

Differential Revision: https://reviews.llvm.org/D99906
llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
llvm/test/CodeGen/PowerPC/p10-constants.ll