summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2018-01-27 08:41:03 +0000
committerCraig Topper <craig.topper@intel.com>2018-01-27 08:41:03 +0000
commitc80f0ced84ba856a86889b70701150dad1bab395 (patch)
treeab6fbcaf64b1e07775311a2e849a6fcb707033b1 /llvm/lib/CodeGen
parent77a5c965607757d3c0f7e83525a41f655bb5db89 (diff)
downloadbcm5719-llvm-c80f0ced84ba856a86889b70701150dad1bab395.tar.gz
bcm5719-llvm-c80f0ced84ba856a86889b70701150dad1bab395.zip
[SelectionDAG] Make DAGTypeLegalizer::PromoteSetCCOperands handle SETEQ/SETNE correctly for vector types.
The code was using getValueSizeInBits and combining with the result of a call to DAG.ComputeNumSignBits. But for vector types getValueSizeInBits returns the width of the full vector while ComputeNumSignBits is going to give a number no larger than the width of a single element. So we should be using getScalarValueSizeInBits to get the element width. llvm-svn: 323583
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
index eaa827309b0..31e87692cbd 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
@@ -990,11 +990,11 @@ void DAGTypeLegalizer::PromoteSetCCOperands(SDValue &NewLHS,SDValue &NewRHS,
// than the width of NewLHS/NewRH, we can avoid inserting real truncate
// instruction, which is redudant eventually.
unsigned OpLEffectiveBits =
- OpL.getValueSizeInBits() - DAG.ComputeNumSignBits(OpL) + 1;
+ OpL.getScalarValueSizeInBits() - DAG.ComputeNumSignBits(OpL) + 1;
unsigned OpREffectiveBits =
- OpR.getValueSizeInBits() - DAG.ComputeNumSignBits(OpR) + 1;
- if (OpLEffectiveBits <= NewLHS.getValueSizeInBits() &&
- OpREffectiveBits <= NewRHS.getValueSizeInBits()) {
+ OpR.getScalarValueSizeInBits() - DAG.ComputeNumSignBits(OpR) + 1;
+ if (OpLEffectiveBits <= NewLHS.getScalarValueSizeInBits() &&
+ OpREffectiveBits <= NewRHS.getScalarValueSizeInBits()) {
NewLHS = OpL;
NewRHS = OpR;
} else {
OpenPOWER on IntegriCloud