File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -376,15 +376,7 @@ static bool HasNative(AMDGPULibFunc::EFuncId id) {
376376 return false ;
377377}
378378
379- struct TableRef {
380- size_t size;
381- const TableEntry *table; // variable size: from 0 to (size - 1)
382-
383- TableRef () : size(0 ), table(nullptr ) {}
384-
385- template <size_t N>
386- TableRef (const TableEntry (&tbl)[N]) : size(N), table(&tbl[0 ]) {}
387- };
379+ using TableRef = ArrayRef<TableEntry>;
388380
389381static TableRef getOptTable (AMDGPULibFunc::EFuncId id) {
390382 switch (id) {
@@ -698,11 +690,11 @@ bool AMDGPULibCalls::fold(CallInst *CI, AliasAnalysis *AA) {
698690bool AMDGPULibCalls::TDOFold (CallInst *CI, const FuncInfo &FInfo) {
699691 // Table-Driven optimization
700692 const TableRef tr = getOptTable (FInfo.getId ());
701- if (tr.size == 0 )
693+ if (tr.empty () )
702694 return false ;
703695
704- int const sz = (int )tr.size ;
705- const TableEntry * const ftbl = tr.table ;
696+ int const sz = (int )tr.size () ;
697+ const TableEntry * const ftbl = tr.data () ;
706698 Value *opr0 = CI->getArgOperand (0 );
707699
708700 if (getVecSize (FInfo) > 1 ) {
You can’t perform that action at this time.
0 commit comments