Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport 12.0.1 to release_12x #96

Closed

Conversation

bryanpkc
Copy link
Collaborator

Backport recent fixes from LLVM 12.0.1 to the release_12x branch. This should fix issue #91.

I also cherry-picked 54f059c to prevent OpenMP tests from failing when LLVM is built in Debug mode.

@bryanpkc
Copy link
Collaborator Author

I'm not sure why GitHub complains that the branch cannot be rebased. It is already based on release_12x and should be mergeable as-is.

@bryanpkc
Copy link
Collaborator Author

We probably need to push these commits to the target branch by hand. According to the following discussion, there is no workaround for this GitHub limitation:

https://github.community/t/weird-problem-with-cannot-be-rebased-due-to-conflicts/178433

@kiranchandramohan
Copy link
Collaborator

We will wave the review. @bryanpkc will merge this.

bryanpkc pushed a commit that referenced this pull request Apr 20, 2022
This patch implemented TTI.IntImmCost() properly.
Each BPF insn has 32bit immediate space, so for any immediate
which can be represented as 32bit signed int, the cost
is technically free. If an int cannot be presented as
a 32bit signed int, a ld_imm64 instruction is needed
and a TCC_Basic is returned.

This change is motivated when we observed that
several bpf selftests failed with latest llvm trunk, e.g.,
  #10/16 strobemeta.o:FAIL
  #10/17 strobemeta_nounroll1.o:FAIL
  #10/18 strobemeta_nounroll2.o:FAIL
  #10/19 strobemeta_subprogs.o:FAIL
  #96 snprintf_btf:FAIL

The reason of the failure is due to that
SpeculateAroundPHIsPass did aggressive transformation
which alters control flow for which currently verifer
cannot handle well. In llvm12, SpeculateAroundPHIsPass
is not called.

SpeculateAroundPHIsPass relied on TTI.getIntImmCost()
and TTI.getIntImmCostInst() for profitability
analysis. This patch implemented TTI.getIntImmCost()
properly for BPF backend which also prevented
transformation which caused the above test failures.

Differential Revision: https://reviews.llvm.org/D96448

(cherry picked from commit a260ae7)
@bryanpkc bryanpkc closed this Apr 20, 2022
@bryanpkc bryanpkc deleted the backport-12.0.1 branch April 20, 2022 23:04
@bryanpkc bryanpkc restored the backport-12.0.1 branch April 21, 2022 01:08
@bryanpkc bryanpkc deleted the backport-12.0.1 branch April 21, 2022 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants