LLVM: lib/Transforms/InstCombine/InstCombineAtomicRMW.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

15

16using namespace llvm;

17

18

19

20

21

22

27 return CF->isZero() && CF->isNegative();

29 return CF->isZero() && !CF->isNegative();

30 default:

31 return false;

32 };

33

35 if(C)

36 return false;

37

43 return C->isZero();

45 return C->isMinusOne();

47 return C->isMaxValue(true);

49 return C->isMinValue(true);

51 return C->isMaxValue(false);

53 return C->isMinValue(false);

54 default:

55 return false;

56 }

57}

58

59

60

65

66 return !CF->isNegative() && CF->isInfinity();

68

69 return CF->isNegative() && CF->isInfinity();

72 return CF->isNaN();

73 default:

74 return false;

75 };

76

78 if(C)

79 return false;

80

82 default:

83 return false;

85 return true;

87 return C->isAllOnesValue();

89 return C->isZero();

91 return C->isMinValue(true);

93 return C->isMaxValue(true);

95 return C->isMinValue(false);

97 return C->isMaxValue(false);

98 };

99}

100

102

103

104

105

107 return nullptr;

108

109

110

114 return &RMWI;

115 }

116

119 "AtomicRMWs don't make sense with Unordered or NotAtomic");

120

122 return nullptr;

123

124

125

126

127

136 }

137

138 return nullptr;

139}

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

static bool isIdempotentRMW(AtomicRMWInst &RMWI)

Return true if and only if the given instruction does not modify the memory location referenced.

Definition InstCombineAtomicRMW.cpp:23

static bool isSaturating(AtomicRMWInst &RMWI)

Return true if the given instruction always produces a value in memory equivalent to its value operan...

Definition InstCombineAtomicRMW.cpp:61

This file provides internal interfaces used to implement the InstCombine.

an instruction that atomically reads a memory location, combines it with another value,...

bool isVolatile() const

Return true if this is a RMW on a volatile memory location.

@ Min

*p = old <signed v ? old : v

@ Max

*p = old >signed v ? old : v

@ UMin

*p = old <unsigned v ? old : v

@ FMin

*p = minnum(old, v) minnum matches the behavior of llvm.minnum.

@ UMax

*p = old >unsigned v ? old : v

@ FMax

*p = maxnum(old, v) maxnum matches the behavior of llvm.maxnum.

void setOperation(BinOp Operation)

BinOp getOperation() const

AtomicOrdering getOrdering() const

Returns the ordering constraint of this rmw instruction.

static Constant * getNegativeZero(Type *Ty)

Instruction * visitAtomicRMWInst(AtomicRMWInst &SI)

Definition InstCombineAtomicRMW.cpp:101

Instruction * replaceOperand(Instruction &I, unsigned OpNum, Value *V)

Replace operand of instruction and add old operand to the worklist.

bool isFloatingPointTy() const

Return true if this is one of the floating-point types.

bool isIntegerTy() const

True if this is an instance of IntegerType.

Type * getType() const

All values are typed, get the type of this value.

@ C

The default llvm calling convention, compatible with C.

This is an optimization pass for GlobalISel generic memory operations.

decltype(auto) dyn_cast(const From &Val)

dyn_cast - Return the argument parameter cast to the specified type.