Skip to content

Conversation

@antoniofrighetto
Copy link
Contributor

@antoniofrighetto antoniofrighetto commented Mar 27, 2024

Nowrap poison-generating flags to trunc have been recently introduced in LLVM.

@antoniofrighetto
Copy link
Contributor Author

(To undraft when PR85592 lands in LLVM.)

@antoniofrighetto antoniofrighetto force-pushed the feature/handle-trunc-zero-or-sign branch from e905853 to 86725bc Compare March 27, 2024 10:13
ir/instr.cpp Outdated
if (flags & NSW)
non_poison.add(val.trunc(trunc_bits).sext(orig_bits - trunc_bits) ==
val);
return {val.trunc(trunc_bits), non_poison()};
Copy link
Member

Choose a reason for hiding this comment

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

I suggest don't computing trunc() 3x times by saving this in a tmp var.
These functions do pre-processing and can be expensive.

The rest of the patch is great, thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Definitely, thanks for the quick review! :)

@nunoplopes
Copy link
Member

fixes #1023.

Nowrap poison-generating flags to `trunc`
have been recently introduced in LLVM.
@antoniofrighetto antoniofrighetto force-pushed the feature/handle-trunc-zero-or-sign branch from 86725bc to 2504d5e Compare March 27, 2024 15:16
@antoniofrighetto antoniofrighetto marked this pull request as ready for review March 29, 2024 07:13
@nunoplopes nunoplopes merged commit 2fccad2 into AliveToolkit:master Mar 29, 2024
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