Current v:t = zext(setcc x,y,cc) will be transformed to select x, y, 1:t, 0:t, cc. It misses some opportunities if x's type size is less than t's size. This patch enhances the above transformation.
Details
- Reviewers
spatel dmgreen qiucf steven.zhang xbolva00 lebedev.ri - Group Reviewers
Restricted Project - Commits
- rGb904324788a8: [DAGCombiner] Enhance (zext(setcc))
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/test/CodeGen/AArch64/hoist-and-by-const-from-lshr-in-eqcmp-zero.ll | ||
---|---|---|
312–313 | Adjust comment? |
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
10551 | Use 'DAG.getBoolConstant' ? EVT N0VT = N0.getValueType(); EVT N00VT = N0.getOperand(0).getValueType(); if (SDValue SCC = SimplifySelectCC( DL, N0.getOperand(0), N0.getOperand(1), DAG.getBoolConstant(true, DL, N0VT, N00VT), DAG.getBoolConstant(false, DL, N0VT, N00VT), cast<CondCodeSDNode>(N0.getOperand(2))->get(), true)) return DAG.getNode(ISD::ZERO_EXTEND, DL, VT, SCC); | |
10556 | I think you can delete the existing transform as a special-case - the ZERO_EXTEND node will not be created if VT == N0VT. |
llvm/test/CodeGen/AArch64/hoist-and-by-const-from-lshr-in-eqcmp-zero.ll | ||
---|---|---|
312–313 | Hmmm, interesting, the function name also indicates it's negative. |
llvm/test/CodeGen/AArch64/hoist-and-by-const-from-lshr-in-eqcmp-zero.ll | ||
---|---|---|
312–313 | Yes, please update comment. |
llvm/test/CodeGen/AArch64/hoist-and-by-const-from-lshr-in-eqcmp-zero.ll | ||
---|---|---|
312–313 | "negative" in this context means the test was trying to show that the icmp transform that applies to other tests in this file is not applicable to this test. |
llvm/test/CodeGen/AArch64/hoist-and-by-const-from-lshr-in-eqcmp-zero.ll | ||
---|---|---|
312–313 | Ok, I see. Looks my latest revision doesn't catch your point. I'll update it. |
Use 'DAG.getBoolConstant' ?