summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2016-12-10 19:58:00 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2016-12-10 19:58:00 +0000
commitfbc728853fce754143e5b8f5426c1f6c43b1377a (patch)
treee7b7415b20f4874774e05012105c0163e9e77034 /llvm/lib/Target/AMDGPU
parentfb58550d7310cdf7aae9e5f2487da6eea5980c65 (diff)
downloadbcm5719-llvm-fbc728853fce754143e5b8f5426c1f6c43b1377a.tar.gz
bcm5719-llvm-fbc728853fce754143e5b8f5426c1f6c43b1377a.zip
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
Diffstat (limited to 'llvm/lib/Target/AMDGPU')
-rw-r--r--llvm/lib/Target/AMDGPU/SIInstrInfo.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.h b/llvm/lib/Target/AMDGPU/SIInstrInfo.h
index 81d0ef42234..e68f6f92ba9 100644
--- a/llvm/lib/Target/AMDGPU/SIInstrInfo.h
+++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.h
@@ -500,7 +500,7 @@ public:
const MachineOperand &DefMO) const {
assert(UseMO.getParent() == &MI);
int OpIdx = MI.getOperandNo(&UseMO);
- if (!MI.getDesc().OpInfo || OpIdx > MI.getDesc().NumOperands) {
+ if (!MI.getDesc().OpInfo || OpIdx >= MI.getDesc().NumOperands) {
return false;
}
@@ -516,7 +516,7 @@ public:
bool isInlineConstant(const MachineInstr &MI, unsigned OpIdx,
const MachineOperand &MO) const {
- if (!MI.getDesc().OpInfo || OpIdx > MI.getDesc().NumOperands)
+ if (!MI.getDesc().OpInfo || OpIdx >= MI.getDesc().NumOperands)
return false;
if (MI.isCopy()) {
OpenPOWER on IntegriCloud