[PATCH] D114413: [OpenMPIRBuilder] Implement static-chunked workshare-loop schedules.

Peixin Qiao via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 28 23:19:43 PST 2022


peixin added a comment.

When I investigated the edge cases you mentioned in D116292 <https://reviews.llvm.org/D116292>. Found one unsupported case as follows

  #include <climits>
  #include <iostream>
  using namespace std;
  
  void func(unsigned long long lb, unsigned long long ub, unsigned long long step) {
    unsigned long long i;
    #pragma omp for schedule(static, 1)
    for (i = lb; i > ub; i -= step) {
      cout << i << endl;
    }
  }
  
  int main() {
    unsigned long long lb, ub, step;
    lb = ULLONG_MAX;
    ub = ULLONG_MAX / 10;
    step = ULLONG_MAX / 10;
    cout << "lb: " << lb << endl;
    cout << "ub: " << ub << endl;
    cout << "step: " << step << endl;
  
    func(lb, ub, step);
  
    cout << endl;
    return 0;
  }

  $ clang++ temp.cpp -fopenmp && ./a.out
  lb: 18446744073709551615
  ub: 1844674407370955161
  step: 1844674407370955161
  18446744073709551615
  16602069666338596454
  14757395258967641293
  12912720851596686132
  11068046444225730971
  9223372036854775810
  7378697629483820649
  5534023222112865488
  3689348814741910327
  1844674407370955166
  $ clang++ temp.cpp -fopenmp -fopenmp-enable-irbuilder
  clang-14: /home/qpx/compilers/llvm-community/static-chunk-codegen/llvm-project/llvm/lib/IR/Instructions.cpp:506: void llvm::CallInst::init(llvm::FunctionType*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >, const llvm::Twine&): Assertion `(i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && "Calling a function with a bad signature!"' failed.
  PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
  Stack dump:

This is also for `schedule(static)`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114413/new/

https://reviews.llvm.org/D114413



More information about the cfe-commits mailing list