[all-commits] [llvm/llvm-project] 1373f2: [ConstraintSystem] Remove last variable, use move ...

Florian Hahn via All-commits all-commits at lists.llvm.org
Thu Feb 2 08:03:42 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1373f203cea89abc21f257b4f965cf8697ebd076
      https://github.com/llvm/llvm-project/commit/1373f203cea89abc21f257b4f965cf8697ebd076
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2023-02-02 (Thu, 02 Feb 2023)

  Changed paths:
    M llvm/lib/Analysis/ConstraintSystem.cpp

  Log Message:
  -----------
  [ConstraintSystem] Remove last variable, use move instead of copy. (NFC)

At the moment, a large amount of time is spent construction vectors
by pushing back all elements except the first variable. For large
inputs, such as discussed in https://reviews.llvm.org/D135915#4057050
this can result in excessive compile-time.

Instead, it is more efficient to remove the last variable. Then the
original vector can be re-used by simply popping the last element and
then moving the contents to the new system.

This improves time spent in ConstraintElimination for the linked
reproducer from ~43s to ~3s.




More information about the All-commits mailing list