Skip to content

Conversation

@eeckstein
Copy link
Contributor

For example:

func test3(_ arr: Array<Int>, index: Int) -> Int {
  return arr[index] + arr[index]
}

rdar://138519664

@eeckstein eeckstein requested review from atrick and meg-gupta October 25, 2024 17:28
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein
Copy link
Contributor Author

@swift-ci benchmark

Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a reasonable approach to me

@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein
Copy link
Contributor Author

@swift-ci test macos

Add `Value.constantAccessPath`. It is like `accessPath`, but ensures that the projectionPath only contains "constant" elements.
This means: if the access contains an `index_addr` projection with a non-constant index, the `projectionPath` does _not_ contain the `index_addr`.
Instead, the `base` is an `AccessBase.index` which refers to the `index_addr`.
…ith non-constant index

For example:
```
func test3(_ arr: Array<Int>, index: Int) -> Int {
  return arr[index] + arr[index]
}
```

rdar://138519664
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein eeckstein merged commit 6d76534 into swiftlang:main Nov 5, 2024
5 checks passed
@eeckstein eeckstein deleted the improve-rle branch November 5, 2024 07:34
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