forked from OSchip/llvm-project
AMDGPU: Fix asan errors when folding operands
This was failing when trying to fold immediates into operand 1 of a phi, which only has one statically known operand. llvm-svn: 289337
This commit is contained in:
parent
fb58550d73
commit
fbc728853f
|
@ -500,7 +500,7 @@ public:
|
||||||
const MachineOperand &DefMO) const {
|
const MachineOperand &DefMO) const {
|
||||||
assert(UseMO.getParent() == &MI);
|
assert(UseMO.getParent() == &MI);
|
||||||
int OpIdx = MI.getOperandNo(&UseMO);
|
int OpIdx = MI.getOperandNo(&UseMO);
|
||||||
if (!MI.getDesc().OpInfo || OpIdx > MI.getDesc().NumOperands) {
|
if (!MI.getDesc().OpInfo || OpIdx >= MI.getDesc().NumOperands) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -516,7 +516,7 @@ public:
|
||||||
|
|
||||||
bool isInlineConstant(const MachineInstr &MI, unsigned OpIdx,
|
bool isInlineConstant(const MachineInstr &MI, unsigned OpIdx,
|
||||||
const MachineOperand &MO) const {
|
const MachineOperand &MO) const {
|
||||||
if (!MI.getDesc().OpInfo || OpIdx > MI.getDesc().NumOperands)
|
if (!MI.getDesc().OpInfo || OpIdx >= MI.getDesc().NumOperands)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (MI.isCopy()) {
|
if (MI.isCopy()) {
|
||||||
|
|
Loading…
Reference in New Issue