---------------------------------------- define i32 @src(i16 %x, i1 %b) { %0: %z = sext i16 %x to i32 %p = cttz i32 %z, %b ret i32 %p } => define i32 @tgt(i16 %x, i1 %b) { %0: %z = zext i16 %x to i32 %p = cttz i32 %z, %b ret i32 %p } Transformation seems to be correct!
Details
Details
- Reviewers
spatel RKSimon - Commits
- rG08c08577f94f: [InstCombine] cttz(sext(x)) -> cttz(zext(x))
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
I meant this one basically as cttz(sext(x)) -> cttz(zext(x)) and cttz(zext(x)) -> zext(cttz(x)) if the 'ZeroIsUndef' parameter is 'true' gives us what we want: cttz(sext(x)) -> zext(cttz(x)) if the 'ZeroIsUndef' parameter is 'true'
Thanks, updated.
Comment Actions
LGTM
llvm/test/Transforms/InstCombine/cttz.ll | ||
---|---|---|
82 | Best to fix the test typo as a pre-commit. |
Best to fix the test typo as a pre-commit.