From: Colin LeMahieu Date: Tue, 1 Mar 2016 21:37:41 +0000 (+0000) Subject: [Hexagon] Modifying r262258 to only be in effect in the hand assembler path, not... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5cb6eea664e70144647099da95793545d09fcdc8;p=platform%2Fupstream%2Fllvm.git [Hexagon] Modifying r262258 to only be in effect in the hand assembler path, not the integrated assembler. llvm-svn: 262400 --- diff --git a/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp b/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp index 89340eb..6292a58 100644 --- a/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp +++ b/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp @@ -35,6 +35,7 @@ #include "llvm/MC/MCSectionELF.h" #include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCSubtargetInfo.h" +#include "llvm/MC/MCValue.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ELF.h" @@ -1433,6 +1434,21 @@ bool HexagonAsmParser::parseInstruction(OperandVector &Operands) { Expr = MCBinaryExpr::createAnd(Expr, MCConstantExpr::create(0xffff, Context), Context); + } else { + MCValue Value; + if (Expr->evaluateAsRelocatable(Value, nullptr, nullptr)) { + if (!Value.isAbsolute()) { + switch(Value.getAccessVariant()) { + case MCSymbolRefExpr::VariantKind::VK_TPREL: + case MCSymbolRefExpr::VariantKind::VK_DTPREL: + // Don't lazy extend these expression variants + MustNotExtend = !MustExtend; + break; + default: + break; + } + } + } } Expr = HexagonMCExpr::create(Expr, Context); HexagonMCInstrInfo::setMustNotExtend(*Expr, MustNotExtend); diff --git a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInstrInfo.cpp b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInstrInfo.cpp index bfd4e5f..769c76e 100644 --- a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInstrInfo.cpp +++ b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInstrInfo.cpp @@ -21,7 +21,6 @@ #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCInstrInfo.h" #include "llvm/MC/MCSubtargetInfo.h" -#include "llvm/MC/MCValue.h" namespace llvm { void HexagonMCInstrInfo::addConstant(MCInst &MI, uint64_t Value, @@ -432,19 +431,8 @@ bool HexagonMCInstrInfo::isConstExtended(MCInstrInfo const &MCII, HexagonMCInstrInfo::mustNotExtend(*MO.getExpr())) return false; int64_t Value; - if (!MO.getExpr()->evaluateAsAbsolute(Value)) { - MCValue Value; - if (!MO.getExpr()->evaluateAsRelocatable(Value, nullptr, nullptr)) - return true; - switch(Value.getAccessVariant()) { - case MCSymbolRefExpr::VariantKind::VK_TPREL: - case MCSymbolRefExpr::VariantKind::VK_DTPREL: - // Don't lazy extend these expression variants - return false; - default: - return true; - } - } + if (!MO.getExpr()->evaluateAsAbsolute(Value)) + return true; int MinValue = HexagonMCInstrInfo::getMinValue(MCII, MCI); int MaxValue = HexagonMCInstrInfo::getMaxValue(MCII, MCI); return (MinValue > Value || Value > MaxValue);