mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 05:22:04 +00:00
Add comments and test case for [X86TTI] Make constant base pointers for GetElementPtr opaque (r204739).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205468 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -915,6 +915,9 @@ unsigned X86TTI::getIntImmCost(unsigned Opcode, unsigned Idx, const APInt &Imm,
|
||||
switch (Opcode) {
|
||||
default: return TCC_Free;
|
||||
case Instruction::GetElementPtr:
|
||||
// Always hoist the base address of a GetElementPtr. This prevents the
|
||||
// creation of new constants for every base constant that gets constant
|
||||
// folded with the offset.
|
||||
if (Idx == 0)
|
||||
return 2 * TCC_Basic;
|
||||
return TCC_Free;
|
||||
|
||||
Reference in New Issue
Block a user