diff options
author | Matthias Braun <matze@braunis.de> | 2017-05-31 22:23:08 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2017-05-31 22:23:08 +0000 |
commit | 605f779516f93df9ae3c976cc00d94f4dafdaf21 (patch) | |
tree | 496a2bca58c793f8a745d6cb88deeeb18af77726 /llvm/lib/CodeGen | |
parent | 57ac61e005886d7010db668ef8b430e003a8d413 (diff) | |
download | bcm5719-llvm-605f779516f93df9ae3c976cc00d94f4dafdaf21.tar.gz bcm5719-llvm-605f779516f93df9ae3c976cc00d94f4dafdaf21.zip |
ImplicitNullChecks: Clear kill/dead flags when moving instructions around
The values are marked as livein in the successor blocks so marking them
as killed or dead was wrong.
llvm-svn: 304366
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/ImplicitNullChecks.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/ImplicitNullChecks.cpp b/llvm/lib/CodeGen/ImplicitNullChecks.cpp index 24e289dd4f1..444416a7700 100644 --- a/llvm/lib/CodeGen/ImplicitNullChecks.cpp +++ b/llvm/lib/CodeGen/ImplicitNullChecks.cpp @@ -607,8 +607,20 @@ MachineInstr *ImplicitNullChecks::insertFaultingInstr( .addMBB(HandlerMBB) .addImm(MI->getOpcode()); - for (auto &MO : MI->uses()) - MIB.add(MO); + for (auto &MO : MI->uses()) { + if (MO.isReg()) { + MachineOperand NewMO = MO; + if (MO.isUse()) { + NewMO.setIsKill(false); + } else { + assert(MO.isDef() && "Expected def or use"); + NewMO.setIsDead(false); + } + MIB.add(NewMO); + } else { + MIB.add(MO); + } + } MIB.setMemRefs(MI->memoperands_begin(), MI->memoperands_end()); |