[Hexagon] Couple of fixes in optimize addressing mode
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>
Mon, 10 Dec 2018 21:56:04 +0000 (21:56 +0000)
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>
Mon, 10 Dec 2018 21:56:04 +0000 (21:56 +0000)
commit9f003f9262cd5a9e2ceb360f905782ed2bdc483f
tree7114783b0b288a519de9b34324354df2613af5d6
parent9ccde61f8182d53d8aad74ef60e8c72bc2213e64
[Hexagon] Couple of fixes in optimize addressing mode

- Check if an operand is an immediate before calling getImm. Some operands
  that take constant values can actually have global symbols or other
  constant expressions.
- When a load-constant instruction can be folded into users, make sure to
  only delete it when all users have been successfully converted.

llvm-svn: 348802
llvm/lib/Target/Hexagon/HexagonOptAddrMode.cpp
llvm/test/CodeGen/Hexagon/addrmode-immop.mir [new file with mode: 0644]