@@ -19,78 +19,78 @@ SPDX-License-Identifier: MIT
19
19
namespace IGCLLVM
20
20
{
21
21
22
- inline llvm::Value* getCalledValue (llvm::CallInst& CI)
23
- {
22
+ inline llvm::Value* getCalledValue (llvm::CallInst& CI)
23
+ {
24
24
#if LLVM_VERSION_MAJOR <= 10
25
- return CI.getCalledValue ();
25
+ return CI.getCalledValue ();
26
26
#else
27
- return CI.getCalledOperand ();
27
+ return CI.getCalledOperand ();
28
28
#endif
29
- }
29
+ }
30
30
31
- inline llvm::Value* getCalledValue (llvm::CallInst* CI)
32
- {
31
+ inline llvm::Value* getCalledValue (llvm::CallInst* CI)
32
+ {
33
33
#if LLVM_VERSION_MAJOR <= 10
34
- return CI->getCalledValue ();
34
+ return CI->getCalledValue ();
35
35
#else
36
- return CI->getCalledOperand ();
36
+ return CI->getCalledOperand ();
37
37
#endif
38
- }
38
+ }
39
39
40
- inline const llvm::Value* getCalledValue (const llvm::CallInst* CI)
41
- {
40
+ inline const llvm::Value* getCalledValue (const llvm::CallInst* CI)
41
+ {
42
42
#if LLVM_VERSION_MAJOR <= 10
43
- return CI->getCalledValue ();
43
+ return CI->getCalledValue ();
44
44
#else
45
- return CI->getCalledOperand ();
45
+ return CI->getCalledOperand ();
46
46
#endif
47
- }
47
+ }
48
48
49
- inline unsigned getNumArgOperands (const llvm::CallInst* CI)
50
- {
49
+ inline unsigned getNumArgOperands (const llvm::CallInst* CI)
50
+ {
51
51
#if LLVM_VERSION_MAJOR < 14
52
- return CI->getNumArgOperands ();
52
+ return CI->getNumArgOperands ();
53
53
#else
54
- return CI->arg_size ();
54
+ return CI->arg_size ();
55
55
#endif
56
- }
56
+ }
57
57
58
- inline unsigned getArgOperandNo (llvm::CallInst &CI, const llvm::Use *U) {
58
+ inline unsigned getArgOperandNo (llvm::CallInst &CI, const llvm::Use *U) {
59
59
#if LLVM_VERSION_MAJOR < 10
60
- IGC_ASSERT_MESSAGE (CI.isArgOperand (U), " Arg operand # out of range!" );
61
- return (unsigned )(U - CI.arg_begin ());
60
+ IGC_ASSERT_MESSAGE (CI.isArgOperand (U), " Arg operand # out of range!" );
61
+ return (unsigned )(U - CI.arg_begin ());
62
62
#else
63
- return CI.getArgOperandNo (U);
63
+ return CI.getArgOperandNo (U);
64
64
#endif
65
- }
65
+ }
66
66
67
- inline llvm::Constant* getShuffleMaskForBitcode (llvm::ShuffleVectorInst* SVI)
68
- {
67
+ inline llvm::Constant* getShuffleMaskForBitcode (llvm::ShuffleVectorInst* SVI)
68
+ {
69
69
#if LLVM_VERSION_MAJOR < 11
70
- return SVI->getMask ();
70
+ return SVI->getMask ();
71
71
#else
72
- return SVI->getShuffleMaskForBitcode ( );
72
+ return llvm::ShuffleVectorInst::convertShuffleMaskForBitcode ( SVI->getShuffleMask (), SVI-> getType () );
73
73
#endif
74
- }
74
+ }
75
75
76
- inline bool isFreezeInst (llvm::Instruction* I)
77
- {
76
+ inline bool isFreezeInst (llvm::Instruction* I)
77
+ {
78
78
#if LLVM_VERSION_MAJOR < 10
79
- (void )I;
80
- return false ;
79
+ (void )I;
80
+ return false ;
81
81
#else
82
- return llvm::isa<llvm::FreezeInst>(I);
82
+ return llvm::isa<llvm::FreezeInst>(I);
83
83
#endif
84
- }
84
+ }
85
85
86
- inline bool isDebugOrPseudoInst (llvm::Instruction& I)
87
- {
86
+ inline bool isDebugOrPseudoInst (llvm::Instruction& I)
87
+ {
88
88
#if LLVM_VERSION_MAJOR < 14
89
- return llvm::isa<llvm::DbgInfoIntrinsic>(&I);
89
+ return llvm::isa<llvm::DbgInfoIntrinsic>(&I);
90
90
#else
91
- return I.isDebugOrPseudoInst ();
91
+ return I.isDebugOrPseudoInst ();
92
92
#endif
93
- }
93
+ }
94
94
}
95
95
96
96
#endif
0 commit comments