Enhance address-mode folding of ISD::ADD to handle cases where the
authorDan Gohman <gohman@apple.com>
Fri, 13 Mar 2009 02:25:09 +0000 (02:25 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 13 Mar 2009 02:25:09 +0000 (02:25 +0000)
commit77502c93442c5953c05e39fcd4c17d9e2aca766f
treecb356e11b4103eaa48e8040b8e0ca4df940075c0
parent990afedb3a4b7d32832d74ad5b5863c19f909e1f
Enhance address-mode folding of ISD::ADD to handle cases where the
operands can't both be fully folded at the same time. For example,
in the included testcase, a global variable is being added with
an add of two values. The global variable wants RIP-relative
addressing, so it can't share the address with another base
register, but it's still possible to fold the initial add.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66865 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelDAGToDAG.cpp
test/CodeGen/X86/fold-add.ll [new file with mode: 0644]