OSDN Git Service

[PowerPC] Guard against illegal selection of add for TargetConstant operands
authorHal Finkel <hfinkel@anl.gov>
Tue, 2 Sep 2014 06:23:54 +0000 (06:23 +0000)
committerHal Finkel <hfinkel@anl.gov>
Tue, 2 Sep 2014 06:23:54 +0000 (06:23 +0000)
commitdea837d3c5179309642875dae6d2b20b5b4bd197
treebcd36a6f7d6e554eaf3d70f9bb9e4a1579e242db
parent901a3419d155257029ad10f701d1e4fb9708c4bd
[PowerPC] Guard against illegal selection of add for TargetConstant operands

r208640 was reverted because it caused a self-hosting failure on ppc64. The
underlying cause was the formation of ISD::ADD nodes with ISD::TargetConstant
operands. Because we have no patterns for 'add' taking 'timm' nodes, these are
selected as r+r add instructions (which is a miscompile). Guard against this
kind of behavior in the future by making the backend crash should this occur
(instead of silently generating invalid output).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216897 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCISelDAGToDAG.cpp