mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
f3bb2fa95f
For `ret i64 add (i64 ptrtoint (i32* @foo to i64), i64 1701208431)`, ``` X86DAGToDAGISel::matchAdd ... // AM.setBaseReg(CurDAG->getRegister(X86::RIP, MVT::i64)); if (!matchAddressRecursively(N.getOperand(0), AM, Depth+1) && // Try folding offset but fail; there is a symbolic displacement, so offset cannot be too large !matchAddressRecursively(Handle.getValue().getOperand(1), AM, Depth+1)) return false; ... // Try again after commuting the operands. // AM.Disp = Val; foldOffsetIntoAddress() does not know there will be a symbolic displacement if (!matchAddressRecursively(Handle.getValue().getOperand(1), AM, Depth+1) && // AM.setBaseReg(CurDAG->getRegister(X86::RIP, MVT::i64)); !matchAddressRecursively(Handle.getValue().getOperand(0), AM, Depth+1)) // Succeeded! Produced leaq sym+disp(%rip),... return false; ``` `foldOffsetIntoAddress()` currently does not know there is a symbolic displacement and can fold a large offset. The produced `leaq sym+disp(%rip), %rax` instruction is relocated by an R_X86_64_PC32. If disp is large and sym+disp-rip>=2**31, there will be a relocation overflow. This approach is still not elegant. Unfortunately the isRIPRelative interface is a bit clumsy. I tried several solutions and eventually picked this one. Differential Revision: https://reviews.llvm.org/D73606 |
||
---|---|---|
.. | ||
Analysis | ||
Assembler | ||
Bindings | ||
Bitcode | ||
BugPoint | ||
CodeGen | ||
DebugInfo | ||
Demangle | ||
Examples | ||
ExecutionEngine | ||
Feature | ||
FileCheck | ||
Instrumentation | ||
Integer | ||
JitListener | ||
Linker | ||
LTO | ||
MachineVerifier | ||
MC | ||
Object | ||
ObjectYAML | ||
Other | ||
Reduce | ||
SafepointIRVerifier | ||
Support | ||
SymbolRewriter | ||
TableGen | ||
ThinLTO/X86 | ||
tools | ||
Transforms | ||
Unit | ||
Verifier | ||
YAMLParser | ||
.clang-format | ||
CMakeLists.txt | ||
lit.cfg.py | ||
lit.site.cfg.py.in | ||
TestRunner.sh |