[all-commits] [llvm/llvm-project] 08c085: [InstCombine] cttz(sext(x)) -> cttz(zext(x))
Dávid Bolvanský via All-commits
all-commits at lists.llvm.org
Mon May 3 14:59:54 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 08c08577f94fd7efd2a670d0e5c3c6f72882fa0a
https://github.com/llvm/llvm-project/commit/08c08577f94fd7efd2a670d0e5c3c6f72882fa0a
Author: Dávid Bolvanský <david.bolvansky at gmail.com>
Date: 2021-05-03 (Mon, 03 May 2021)
Changed paths:
M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
M llvm/test/Transforms/InstCombine/cttz.ll
Log Message:
-----------
[InstCombine] cttz(sext(x)) -> cttz(zext(x))
```
----------------------------------------
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!
```
https://alive2.llvm.org/ce/z/evomeg
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D101764
More information about the All-commits
mailing list