mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-18 19:28:16 +00:00
Don't copy regs that are only used in the entry block into a vreg. This
changes the code generated for: short %test(short %A) { %B = xor short %A, -32768 ret short %B } to: _test: xori r2, r3, 32768 xoris r2, r2, 65535 extsh r3, r2 blr instead of: _test: rlwinm r2, r3, 0, 16, 31 xori r2, r3, 32768 xoris r2, r2, 65535 extsh r3, r2 blr llvm-svn: 23109
This commit is contained in:
parent
5f55dd72af
commit
e9cc12f5c4
@ -1077,9 +1077,15 @@ LowerArguments(BasicBlock *BB, SelectionDAGLowering &SDL,
|
||||
AI != E; ++AI,++a)
|
||||
if (!AI->use_empty()) {
|
||||
SDL.setValue(AI, Args[a]);
|
||||
SDOperand Copy =
|
||||
CopyValueToVirtualRegister(SDL, AI, FuncInfo.ValueMap[AI]);
|
||||
UnorderedChains.push_back(Copy);
|
||||
|
||||
if (IsOnlyUsedInOneBasicBlock(AI) == F.begin()) {
|
||||
// Only used in the entry block, no need to copy it to a vreg for
|
||||
// other blocks.
|
||||
} else {
|
||||
SDOperand Copy =
|
||||
CopyValueToVirtualRegister(SDL, AI, FuncInfo.ValueMap[AI]);
|
||||
UnorderedChains.push_back(Copy);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Otherwise, if any argument is only accessed in a single basic block,
|
||||
|
Loading…
x
Reference in New Issue
Block a user