summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorJuergen Ributzka <juergen@apple.com>2014-11-10 21:05:31 +0000
committerJuergen Ributzka <juergen@apple.com>2014-11-10 21:05:31 +0000
commitea5870a530944186ee90b69265c1236198e27a5c (patch)
tree9ce8082725e6b86f64431e440e19b4d11d3d14b5 /llvm/lib/Target
parentd441725d3d952685dc3c86d3e8d18b5006b108f8 (diff)
downloadbcm5719-llvm-ea5870a530944186ee90b69265c1236198e27a5c.tar.gz
bcm5719-llvm-ea5870a530944186ee90b69265c1236198e27a5c.zip
[AArch64][FastISel] Fix kill flags for integer extends.
In the case we optimize an integer extend away and replace it directly with the source register, we also have to clear all kill flags at all its uses. This is necessary, because the orignal IR instruction might be trivially dead, but we replaced it with a nop at MI level. llvm-svn: 221628
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/AArch64/AArch64FastISel.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64FastISel.cpp b/llvm/lib/Target/AArch64/AArch64FastISel.cpp
index 01b2dee2612..8ec0ce4c926 100644
--- a/llvm/lib/Target/AArch64/AArch64FastISel.cpp
+++ b/llvm/lib/Target/AArch64/AArch64FastISel.cpp
@@ -4197,6 +4197,14 @@ bool AArch64FastISel::selectIntExt(const Instruction *I) {
.addImm(AArch64::sub_32);
SrcReg = ResultReg;
}
+ // Conservatively clear all kill flags from all uses, because we are
+ // replacing a sign-/zero-extend instruction at IR level with a nop at MI
+ // level. The result of the instruction at IR level might have been
+ // trivially dead, which is now not longer true.
+ unsigned UseReg = lookUpRegForValue(I);
+ if (UseReg)
+ MRI.clearKillFlags(UseReg);
+
updateValueMap(I, SrcReg);
return true;
}
OpenPOWER on IntegriCloud