Skip to content

[InstCombine][AIEX] Add load->trunc->inttoptr combine pattern#837

Open
andcarminati wants to merge 1 commit intoaie-publicfrom
andreu.fix.ptr.load
Open

[InstCombine][AIEX] Add load->trunc->inttoptr combine pattern#837
andcarminati wants to merge 1 commit intoaie-publicfrom
andreu.fix.ptr.load

Conversation

@andcarminati
Copy link
Copy Markdown
Collaborator

InstCombine optimization for load->trunc->inttoptr pattern on aie The aie target has 20-bit pointers, which are stored as i24 (3 bytes) This optimization converts: load i24 -> trunc i20 -> inttoptr Into: load ptr -> ptrtoint -> zext i24
This allows SROA to recognize pointer-only allocas and promote them

InstCombine optimization for load->trunc->inttoptr pattern on aie
The aie target has 20-bit pointers, which are stored as i24 (3 bytes)
This optimization converts: load i24 -> trunc i20 -> inttoptr
Into: load ptr -> ptrtoint -> zext i24
This allows SROA to recognize pointer-only allocas and promote them
// CHECK-NEXT: entry:
// CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.aie2p.put.ms.nb(i32 [[VAL:%.*]], i32 [[TLAST:%.*]])
// CHECK-NEXT: [[TOBOOL_I:%.*]] = icmp ne i32 [[TMP0]], 0
// CHECK-NEXT: [[FROMBOOL_I:%.*]] = zext i1 [[TOBOOL_I]] to i8
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do we have to update the tests?

Copy link
Copy Markdown
Collaborator

@F-Stuckmann F-Stuckmann left a comment

Choose a reason for hiding this comment

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

If you want to NRC update the labels in unit-tests could this be commit 1? Commit 2 could be the baseline unit-test and 3 then the actual implementation?

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