aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2023-12-07 11:23:16 -0800
committerGitHub <noreply@github.com>2023-12-07 11:23:16 -0800
commit0928312ec882005fa396dedba9a53f0817e4a2fb (patch)
treef1940e2c192b8e3f7b413bfd8a87db8da9059bc7
parent0e6685ab1a8313cd1dc7eb3c99ff642e6c492aa2 (diff)
downloadllvm-0928312ec882005fa396dedba9a53f0817e4a2fb.zip
llvm-0928312ec882005fa396dedba9a53f0817e4a2fb.tar.gz
llvm-0928312ec882005fa396dedba9a53f0817e4a2fb.tar.bz2
[IR] Use User::getHungOffOperands() in HungoffOperandTraits::op_begin/op_end(). NFC (#74744)
User::getOperandList has to check the HasHungOffUses bit in Value to determine how the operand list is stored. If we're using HungoffOperandTraits we can assume how it is stored without checking the flag. Noticed that the for loop in matchSimpleRecurrence was triggering loop unswitch when built with clang due to specializing based on how the operand list of the PHINode was stored. This reduces the size of llc on my local Release+Asserts build by around 41K.
-rw-r--r--llvm/include/llvm/IR/OperandTraits.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/include/llvm/IR/OperandTraits.h b/llvm/include/llvm/IR/OperandTraits.h
index 979ad35..ffece63 100644
--- a/llvm/include/llvm/IR/OperandTraits.h
+++ b/llvm/include/llvm/IR/OperandTraits.h
@@ -94,10 +94,10 @@ struct VariadicOperandTraits {
template <unsigned MINARITY = 1>
struct HungoffOperandTraits {
static Use *op_begin(User* U) {
- return U->getOperandList();
+ return U->getHungOffOperands();
}
static Use *op_end(User* U) {
- return U->getOperandList() + U->getNumOperands();
+ return U->getHungOffOperands() + U->getNumOperands();
}
static unsigned operands(const User *U) {
return U->getNumOperands();