diff options
author | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2015-11-25 21:40:03 +0000 |
---|---|---|
committer | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2015-11-25 21:40:03 +0000 |
commit | 70a134d29f2550588f50563a0a8c56891a70e06f (patch) | |
tree | b0c5fd5a4cb654976ab8f5975a241a2e5aa9647a | |
parent | 21c0a7131b9d96cf69d0787f4b6c989bf25e7fbe (diff) | |
download | bcm5719-llvm-70a134d29f2550588f50563a0a8c56891a70e06f.tar.gz bcm5719-llvm-70a134d29f2550588f50563a0a8c56891a70e06f.zip |
[Hexagon] Treat transfers of FP immediates are pseudo instructions
This is a temporary fix to address ICE on 2005-10-21-longlonggtu.ll.
The proper fix will be to use A2_tfrsi, but it will need more work to
teach all users of A2_tfrsi to also expect a floating-point operand.
llvm-svn: 254099
-rw-r--r-- | llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp | 14 | ||||
-rw-r--r-- | llvm/lib/Target/Hexagon/HexagonInstrInfoV5.td | 10 |
2 files changed, 19 insertions, 5 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp b/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp index 90df3903f54..1372463b5be 100644 --- a/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp +++ b/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp @@ -869,6 +869,20 @@ bool HexagonInstrInfo::expandPostRAPseudo(MachineBasicBlock::iterator MI) case Hexagon::TCRETURNr: MI->setDesc(get(Hexagon::J2_jumpr)); return true; + case Hexagon::TFRI_f: + case Hexagon::TFRI_cPt_f: + case Hexagon::TFRI_cNotPt_f: { + unsigned Opx = (Opc == Hexagon::TFRI_f) ? 1 : 2; + APFloat FVal = MI->getOperand(Opx).getFPImm()->getValueAPF(); + APInt IVal = FVal.bitcastToAPInt(); + MI->RemoveOperand(Opx); + unsigned NewOpc = (Opc == Hexagon::TFRI_f) ? Hexagon::A2_tfrsi : + (Opc == Hexagon::TFRI_cPt_f) ? Hexagon::C2_cmoveit : + Hexagon::C2_cmoveif; + MI->setDesc(get(NewOpc)); + MI->addOperand(MachineOperand::CreateImm(IVal.getZExtValue())); + return true; + } } return false; diff --git a/llvm/lib/Target/Hexagon/HexagonInstrInfoV5.td b/llvm/lib/Target/Hexagon/HexagonInstrInfoV5.td index 337f4ea2184..823961fb6e6 100644 --- a/llvm/lib/Target/Hexagon/HexagonInstrInfoV5.td +++ b/llvm/lib/Target/Hexagon/HexagonInstrInfoV5.td @@ -98,21 +98,21 @@ def CONST32_Float_Real : LDInst<(outs IntRegs:$dst), (ins f32imm:$src1), // HexagonInstrInfo.td patterns. let isExtended = 1, opExtendable = 1, isMoveImm = 1, isReMaterializable = 1, isPredicable = 1, AddedComplexity = 30, validSubTargets = HasV5SubT, - isCodeGenOnly = 1 in + isCodeGenOnly = 1, isPseudo = 1 in def TFRI_f : ALU32_ri<(outs IntRegs:$dst), (ins f32Ext:$src1), "$dst = #$src1", [(set F32:$dst, fpimm:$src1)]>, Requires<[HasV5T]>; -let isExtended = 1, opExtendable = 2, isPredicated = 1, - hasSideEffects = 0, validSubTargets = HasV5SubT, isCodeGenOnly = 1 in +let isExtended = 1, opExtendable = 2, isPredicated = 1, hasSideEffects = 0, + validSubTargets = HasV5SubT, isCodeGenOnly = 1, isPseudo = 1 in def TFRI_cPt_f : ALU32_ri<(outs IntRegs:$dst), (ins PredRegs:$src1, f32Ext:$src2), "if ($src1) $dst = #$src2", []>, Requires<[HasV5T]>; -let isPseudo = 1, isExtended = 1, opExtendable = 2, isPredicated = 1, - isPredicatedFalse = 1, hasSideEffects = 0, validSubTargets = HasV5SubT in +let isExtended = 1, opExtendable = 2, isPredicated = 1, isPredicatedFalse = 1, + hasSideEffects = 0, validSubTargets = HasV5SubT, isPseudo = 1 in def TFRI_cNotPt_f : ALU32_ri<(outs IntRegs:$dst), (ins PredRegs:$src1, f32Ext:$src2), "if (!$src1) $dst = #$src2", []>, |