[PowerPC] Zero-extend constants in FastISel
authorHal Finkel <hfinkel@anl.gov>
Sun, 4 Sep 2016 06:07:19 +0000 (06:07 +0000)
committerHal Finkel <hfinkel@anl.gov>
Sun, 4 Sep 2016 06:07:19 +0000 (06:07 +0000)
commit73390c7acd40a5c7a1802c0f78b660f6a336b860
treec27324154c5aec2faada72642698fafdbb952d3a
parentfb6358d2b5b25601a3172011238e229995f1b1a4
[PowerPC] Zero-extend constants in FastISel

As it turns out, whether we zero-extend or sign-extend i8/i16 constants, which
are illegal types promoted to i32 on PowerPC, is a choice constrained by
assumptions within the infrastructure. Specifically, the logic in
FunctionLoweringInfo::ComputePHILiveOutRegInfo assumes that constant PHI
operands will be zero extended, and so, at least when materializing constants
that are PHI operands, we must do the same.

The rest of our fast-isel implementation does not appear to depend on the fact
that we were sign-extending i8/i16 constants, and all other targets also appear
to zero-extend small-bitwidth constants in fast-isel; we'll now do the same (we
had been doing this only for i1 constants, and sign-extending the others).

Fixes PR27721.

llvm-svn: 280614
llvm/lib/Target/PowerPC/PPCFastISel.cpp
llvm/test/CodeGen/PowerPC/fast-isel-call.ll