In D156444#4649111, @craig.topper wrote:I don't see tests for constantexpr.
Please use GitHub pull requests for new patches. Phabricator shutdown timeline
- Queries
- All Stories
- Search
- Advanced Search
- Transactions
- Transaction Logs
Feed Advanced Search
Advanced Search
Advanced Search
Yesterday
Yesterday
Updated clang-format and fixed minor errors.
Mon, Sep 18
Mon, Sep 18
In D156444#4633397, @karouzakisp wrote:In D156444#4632536, @craig.topper wrote:In D156444#4632497, @karouzakisp wrote:In D156444#4624088, @nikic wrote:This is still missing LangRef changes.
I think you should also drop everything here that is related to supporting zext constant expressions. These will be removed in the near future, and I don't think it makes sense to add nneg support for them just to drop them again.
"
Semantics:The zext fills the high order bits of the value with zero bits until it reaches the size of the destination type, ty2.
When zero extending from i1, the result will always be either 0 or 1.
The nneg flag means the value to be zero extended is non negative.
So we can safely convert the zext to a sext.
This applies only for the RISC-V target because sext i32 to i64 can be a no op for RV64
and it is always cheaper than performing a zero extension .Example:
%X = zext i32 257 to i64 ; yields i64:257
%Y = zext i1 true to i32 ; yields i32:1
%Z = zext <2 x i16> <i16 8, i16 7> to <2 x i32> ; yields <i32 8, i32 7>
%H = zext nneg 8 i32 to i64 ; yields to i64:8I don't think we need to mention RISC-V. I've seen cases where the middle end needs this information. This issue https://discourse.llvm.org/t/aggressive-conversion-of-sext-to-zext-blocks-indvarsimplify/61561 was independent of RISC-V.
Semantics:
The zext fills the high order bits of the value with zero bits until it reaches the size of the destination type, ty2.
When zero extending from i1, the result will always be either 0 or 1.
The nneg flag means the value to be zero extended is non negative.
So we can safely convert the zext to a sext.Example:
%X = zext i32 257 to i64 ; yields i64:257
%Y = zext i1 true to i32 ; yields i32:1
%Z = zext <2 x i16> <i16 8, i16 7> to <2 x i32> ; yields <i32 8, i32 7>
%H = zext nneg 8 i32 to i64 ; yields to i64:8
Mon, Sep 4
Mon, Sep 4
karouzakisp updated the diff for D156449: [LLVM][Transforms] Zext flag in various optimization passes for RISC-V.
Added nneg flag in InstCombine::visitZExt. Also Added nneg flag in CorrelatedValuePropagation::processZExt.
Removed IsKnownNonNegative from RISCVCodeGen and added in InstCombine::visitZExt
Fri, Sep 1
Fri, Sep 1
Fixed the test that failed to convert the zext(value) to sext(value) whenever the value was assumed to be non negative by llvm.assume
Thu, Aug 31
Thu, Aug 31
In D156444#4632536, @craig.topper wrote:In D156444#4632497, @karouzakisp wrote:In D156444#4624088, @nikic wrote:This is still missing LangRef changes.
I think you should also drop everything here that is related to supporting zext constant expressions. These will be removed in the near future, and I don't think it makes sense to add nneg support for them just to drop them again.
"
Semantics:The zext fills the high order bits of the value with zero bits until it reaches the size of the destination type, ty2.
When zero extending from i1, the result will always be either 0 or 1.
The nneg flag means the value to be zero extended is non negative.
So we can safely convert the zext to a sext.
This applies only for the RISC-V target because sext i32 to i64 can be a no op for RV64
and it is always cheaper than performing a zero extension .Example:
%X = zext i32 257 to i64 ; yields i64:257
%Y = zext i1 true to i32 ; yields i32:1
%Z = zext <2 x i16> <i16 8, i16 7> to <2 x i32> ; yields <i32 8, i32 7>
%H = zext nneg 8 i32 to i64 ; yields to i64:8I don't think we need to mention RISC-V. I've seen cases where the middle end needs this information. This issue https://discourse.llvm.org/t/aggressive-conversion-of-sext-to-zext-blocks-indvarsimplify/61561 was independent of RISC-V.
In D156444#4624088, @nikic wrote:This is still missing LangRef changes.
I think you should also drop everything here that is related to supporting zext constant expressions. These will be removed in the near future, and I don't think it makes sense to add nneg support for them just to drop them again.
Tue, Aug 29
Tue, Aug 29
Removed more redudant white spaces.
Removed redudant whitespaces.
Mon, Aug 28
Mon, Aug 28
Added simple tests.
Changed flag's name from `was_sext to nneg`. Updated the LangRef and all the required changes such as Instruction.h Operator.h.
karouzakisp updated the diff for D156449: [LLVM][Transforms] Zext flag in various optimization passes for RISC-V.
Removed some redudant and inappropriate settings of the flag in the Transforms. Also updated the transforms calling method name from setWasSext to setNonNeg to set the flag.
Jul 27 2023
Jul 27 2023
karouzakisp retitled D156449: [LLVM][Transforms] Zext flag in various optimization passes for RISC-V from Zext flag in various optimization passes for RISC-V to [LLVM][Transforms] Zext flag in various optimization passes for RISC-V.
karouzakisp retitled D156444: [llvm][RISCV][IR] Zext flag in IR for RISC-V from Zext flag in IR for RISC-V to [llvm][RISCV][IR] Zext flag in IR for RISC-V.
Added -U999999 in
git show
to make possible the reviewing via the web interface.
karouzakisp retitled D156442: [RISCV][Backend] Zext flag conversion in RISC-V Backend from Zext flag conversion in RISC-V Backend to [RISCV][Backend] Zext flag conversion in RISC-V Backend.
karouzakisp set the repository for D156444: [llvm][RISCV][IR] Zext flag in IR for RISC-V to rG LLVM Github Monorepo.
karouzakisp updated the diff for D156449: [LLVM][Transforms] Zext flag in various optimization passes for RISC-V.
Added -U999999 in
git show
to make possible the reviewing via the web interface.
Added -U999999 in
git show
to make the reviewing possible via the web interface
karouzakisp retitled D156442: [RISCV][Backend] Zext flag conversion in RISC-V Backend from [llvm][RISCV][Backend] to Zext flag conversion in RISC-V Backend.
karouzakisp retitled D156449: [LLVM][Transforms] Zext flag in various optimization passes for RISC-V from [LLVM][Transforms] to Zext flag in various optimization passes for RISC-V.
karouzakisp retitled D156444: [llvm][RISCV][IR] Zext flag in IR for RISC-V from [llvm][IR] to Zext flag in IR for RISC-V.
karouzakisp removed a project from D156442: [RISCV][Backend] Zext flag conversion in RISC-V Backend: Restricted Project.