summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorJuergen Ributzka <juergen@apple.com>2014-04-10 01:36:59 +0000
committerJuergen Ributzka <juergen@apple.com>2014-04-10 01:36:59 +0000
commit48c8c07d0ad0bc14f14b4b0857e9d57eb018c32e (patch)
tree45be4f8eabac27f9f0c89df2168dcebf90df1bd9 /llvm/lib/Target
parenteb2ecff166b04d3af73b90aaccf3ba108300b199 (diff)
downloadbcm5719-llvm-48c8c07d0ad0bc14f14b4b0857e9d57eb018c32e.tar.gz
bcm5719-llvm-48c8c07d0ad0bc14f14b4b0857e9d57eb018c32e.zip
[ARM64] Fix immediate cost calculation for types larger than i64.
The immediate cost calculation code was hitting an assertion in the included test case, because APInt was still internally 128-bits. Truncating it to 64-bits fixed the issue. Fixes <rdar://problem/16572521>. llvm-svn: 205947
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/ARM64/ARM64TargetTransformInfo.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM64/ARM64TargetTransformInfo.cpp b/llvm/lib/Target/ARM64/ARM64TargetTransformInfo.cpp
index 8a6253d7681..5323b8965f4 100644
--- a/llvm/lib/Target/ARM64/ARM64TargetTransformInfo.cpp
+++ b/llvm/lib/Target/ARM64/ARM64TargetTransformInfo.cpp
@@ -166,7 +166,7 @@ unsigned ARM64TTI::getIntImmCost(const APInt &Imm, Type *Ty) const {
// chunk.
unsigned Cost = 0;
for (unsigned ShiftVal = 0; ShiftVal < BitSize; ShiftVal += 64) {
- APInt Tmp = ImmVal.ashr(ShiftVal).getLoBits(64);
+ APInt Tmp = ImmVal.ashr(ShiftVal).sextOrTrunc(64);
int64_t Val = Tmp.getSExtValue();
Cost += getIntImmCost(Val);
}
OpenPOWER on IntegriCloud