Skip to content

Commit 0928312

Browse files
authored
[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.
1 parent 0e6685a commit 0928312

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/include/llvm/IR/OperandTraits.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ struct VariadicOperandTraits {
9494
template <unsigned MINARITY = 1>
9595
struct HungoffOperandTraits {
9696
static Use *op_begin(User* U) {
97-
return U->getOperandList();
97+
return U->getHungOffOperands();
9898
}
9999
static Use *op_end(User* U) {
100-
return U->getOperandList() + U->getNumOperands();
100+
return U->getHungOffOperands() + U->getNumOperands();
101101
}
102102
static unsigned operands(const User *U) {
103103
return U->getNumOperands();

0 commit comments

Comments
 (0)