summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPCFastISel.cpp
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2014-12-25 23:08:25 +0000
committerHal Finkel <hfinkel@anl.gov>2014-12-25 23:08:25 +0000
commit0c505b08a53a8cd96124264512f4bdf81e648f72 (patch)
treeccd63c8bf37335d1ae6efd7f87d33025896c2cfd /llvm/lib/Target/PowerPC/PPCFastISel.cpp
parentb723834d82961103dcaf75dd8fa98eb81ca092ff (diff)
downloadbcm5719-llvm-0c505b08a53a8cd96124264512f4bdf81e648f72.tar.gz
bcm5719-llvm-0c505b08a53a8cd96124264512f4bdf81e648f72.zip
[PowerPC] [FastISel] i1 constants must be zero extended
When materializing constant i1 values, they must be zero extended. We represent i1 values as [0, 1], not [0, -1], in i32 registers. As it turns out, this code path was dead for i1 values prior to r216006 (which is why this did not manifest in miscompiles until recently). Fixes -O0 self-hosting on PPC64/Linux. llvm-svn: 224842
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCFastISel.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPCFastISel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCFastISel.cpp b/llvm/lib/Target/PowerPC/PPCFastISel.cpp
index d558bb128eb..7af9101e537 100644
--- a/llvm/lib/Target/PowerPC/PPCFastISel.cpp
+++ b/llvm/lib/Target/PowerPC/PPCFastISel.cpp
@@ -2109,7 +2109,7 @@ unsigned PPCFastISel::fastMaterializeConstant(const Constant *C) {
else if (const GlobalValue *GV = dyn_cast<GlobalValue>(C))
return PPCMaterializeGV(GV, VT);
else if (isa<ConstantInt>(C))
- return PPCMaterializeInt(C, VT);
+ return PPCMaterializeInt(C, VT, VT != MVT::i1);
return 0;
}
OpenPOWER on IntegriCloud