aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Instructions.cpp
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2015-12-04 20:34:37 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2015-12-04 20:34:37 +0000
commit18ceafeb2dbb83ecea8a75a87ea9c2aff5c8d19a (patch)
tree40915098348471b2f15f922be8e3b2b547280f71 /llvm/lib/IR/Instructions.cpp
parent9d27f1b0b2a5470f11e69b2e0c70c0f44d350111 (diff)
downloadllvm-18ceafeb2dbb83ecea8a75a87ea9c2aff5c8d19a.zip
llvm-18ceafeb2dbb83ecea8a75a87ea9c2aff5c8d19a.tar.gz
llvm-18ceafeb2dbb83ecea8a75a87ea9c2aff5c8d19a.tar.bz2
[OperandBundles] Allow operand-specific attributes in operand bundles
Currently `OperandBundleUse::operandsHaveAttr` computes its result without being given a specific operand. This is problematic because it forces us to say that, e.g., even non-pointer operands in `"deopt"` operand bundles are `readonly`, which doesn't make sense. This commit changes `operandsHaveAttr` to work in the context of a specific operand, so that we can give the operand attributes that make sense for the operands's `llvm::Type`. llvm-svn: 254764
Diffstat (limited to 'llvm/lib/IR/Instructions.cpp')
-rw-r--r--llvm/lib/IR/Instructions.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp
index b8c72dd..bba0ef2 100644
--- a/llvm/lib/IR/Instructions.cpp
+++ b/llvm/lib/IR/Instructions.cpp
@@ -369,7 +369,7 @@ bool CallInst::dataOperandHasImpliedAttr(unsigned i,
assert(hasOperandBundles() && i >= (getBundleOperandsStartIndex() + 1) &&
"Must be either a call argument or an operand bundle!");
- return getOperandBundleForOperand(i - 1).operandsHaveAttr(A);
+ return bundleOperandHasAttr(i - 1, A);
}
/// IsConstantOne - Return true only if val is constant int 1
@@ -646,7 +646,7 @@ bool InvokeInst::dataOperandHasImpliedAttr(unsigned i,
assert(hasOperandBundles() && i >= (getBundleOperandsStartIndex() + 1) &&
"Must be either an invoke argument or an operand bundle!");
- return getOperandBundleForOperand(i - 1).operandsHaveAttr(A);
+ return bundleOperandHasAttr(i - 1, A);
}
void InvokeInst::addAttribute(unsigned i, Attribute::AttrKind attr) {