summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/R600/SIFoldOperands.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2015-02-13 19:05:03 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2015-02-13 19:05:03 +0000
commit11a4d6774b7c98c55f225a02f982a91c781768d1 (patch)
treeb7945a3d3fc4b500fea27c0ecc6b76dcae4d57ec /llvm/lib/Target/R600/SIFoldOperands.cpp
parent8a9e404c0ef45034b6ff6878b3fce43bdada7d8e (diff)
downloadbcm5719-llvm-11a4d6774b7c98c55f225a02f982a91c781768d1.tar.gz
bcm5719-llvm-11a4d6774b7c98c55f225a02f982a91c781768d1.zip
R600/SI: Allow f64 inline immediates in i64 operands
This requires considering the size of the operand when checking immediate legality. llvm-svn: 229135
Diffstat (limited to 'llvm/lib/Target/R600/SIFoldOperands.cpp')
-rw-r--r--llvm/lib/Target/R600/SIFoldOperands.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/R600/SIFoldOperands.cpp b/llvm/lib/Target/R600/SIFoldOperands.cpp
index 64f1b3d8cfd..848638fae79 100644
--- a/llvm/lib/Target/R600/SIFoldOperands.cpp
+++ b/llvm/lib/Target/R600/SIFoldOperands.cpp
@@ -172,6 +172,7 @@ bool SIFoldOperands::runOnMachineFunction(MachineFunction &MF) {
if (!isSafeToFold(MI.getOpcode()))
continue;
+ unsigned OpSize = TII->getOpSize(MI, 1);
MachineOperand &OpToFold = MI.getOperand(1);
bool FoldingImm = OpToFold.isImm();
@@ -183,7 +184,7 @@ bool SIFoldOperands::runOnMachineFunction(MachineFunction &MF) {
// Folding immediates with more than one use will increase program size.
// FIXME: This will also reduce register usage, which may be better
// in some cases. A better heuristic is needed.
- if (FoldingImm && !TII->isInlineConstant(OpToFold) &&
+ if (FoldingImm && !TII->isInlineConstant(OpToFold, OpSize) &&
!MRI.hasOneUse(MI.getOperand(0).getReg()))
continue;
OpenPOWER on IntegriCloud