-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[GISel] Add more FP opcodes to CSE #123949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-llvm-globalisel Author: lialan (lialan) ChangesFull diff: https://github.com/llvm/llvm-project/pull/123949.diff 1 Files Affected:
diff --git a/llvm/unittests/CodeGen/GlobalISel/CSETest.cpp b/llvm/unittests/CodeGen/GlobalISel/CSETest.cpp
index 92d5289eb16312..6c7326c0f45ab3 100644
--- a/llvm/unittests/CodeGen/GlobalISel/CSETest.cpp
+++ b/llvm/unittests/CodeGen/GlobalISel/CSETest.cpp
@@ -81,10 +81,10 @@ TEST_F(AArch64GISelMITest, TestCSE) {
auto MIBFAdd2 = CSEB.buildFAdd(s32, Copies[0], Copies[1]);
EXPECT_TRUE(&*MIBFAdd == &*MIBFAdd2);
- MIBFAdd2.setFlag(MachineInstr::FmNsz);
+ MIBFAdd2->setFlag(MachineInstr::FmNsz);
EXPECT_FALSE(&*MIBFAdd == &*MIBFAdd2);
- MIBFAdd2.clearFlag(MachineInstr::FmNsz);
+ MIBFAdd2->clearFlag(MachineInstr::FmNsz);
EXPECT_TRUE(&*MIBFAdd == &*MIBFAdd2);
}
@@ -94,10 +94,10 @@ TEST_F(AArch64GISelMITest, TestCSE) {
auto MIBFSub2 = CSEB.buildFSub(s32, Copies[0], Copies[1]);
EXPECT_TRUE(&*MIBFSub == &*MIBFSub2);
- MIBFSub2.setFlag(MachineInstr::FmNoNans);
+ MIBFSub2->setFlag(MachineInstr::FmNoNans);
EXPECT_FALSE(&*MIBFSub == &*MIBFSub2);
- MIBFSub2.clearFlag(MachineInstr::FmNoNans);
+ MIBFSub2->clearFlag(MachineInstr::FmNoNans);
EXPECT_TRUE(&*MIBFSub == &*MIBFSub2);
}
@@ -107,10 +107,10 @@ TEST_F(AArch64GISelMITest, TestCSE) {
auto MIBFMul2 = CSEB.buildFMul(s32, Copies[0], Copies[1]);
EXPECT_TRUE(&*MIBFMul == &*MIBFMul2);
- MIBFMul2.setFlag(MachineInstr::FmNoNans);
+ MIBFMul2->setFlag(MachineInstr::FmNoNans);
EXPECT_FALSE(&*MIBFMul == &*MIBFMul2);
- MIBFMul2.clearFlag(MachineInstr::FmNoNans);
+ MIBFMul2->clearFlag(MachineInstr::FmNoNans);
EXPECT_TRUE(&*MIBFMul == &*MIBFMul2);
}
@@ -120,10 +120,10 @@ TEST_F(AArch64GISelMITest, TestCSE) {
auto MIBFDiv2 = CSEB.buildFDiv(s32, Copies[0], Copies[1]);
EXPECT_TRUE(&*MIBFDiv == &*MIBFDiv2);
- MIBFDiv2.setFlag(MachineInstr::FmNoNans);
+ MIBFDiv2->setFlag(MachineInstr::FmNoNans);
EXPECT_FALSE(&*MIBFDiv == &*MIBFDiv2);
- MIBFDiv2.clearFlag(MachineInstr::FmNoNans);
+ MIBFDiv2->clearFlag(MachineInstr::FmNoNans);
EXPECT_TRUE(&*MIBFDiv == &*MIBFDiv2);
}
@@ -133,10 +133,10 @@ TEST_F(AArch64GISelMITest, TestCSE) {
auto MIBFAbs2 = CSEB.buildFAbs(s32, Copies[0]);
EXPECT_TRUE(&*MIBFAbs == &*MIBFAbs2);
- MIBFAbs2.setFlag(MachineInstr::FmNsz);
+ MIBFAbs2->setFlag(MachineInstr::FmNsz);
EXPECT_FALSE(&*MIBFAbs == &*MIBFAbs2);
- MIBFAbs2.clearFlag(MachineInstr::FmNsz);
+ MIBFAbs2->clearFlag(MachineInstr::FmNsz);
EXPECT_TRUE(&*MIBFAbs == &*MIBFAbs2);
}
@@ -146,10 +146,10 @@ TEST_F(AArch64GISelMITest, TestCSE) {
auto MIBFMinNum2 = CSEB.buildFMinNum(s32, Copies[0], Copies[1]);
EXPECT_TRUE(&*MIBFMinNum == &*MIBFMinNum2);
- MIBFMinNum2.setFlag(MachineInstr::FmNsz);
+ MIBFMinNum2->setFlag(MachineInstr::FmNsz);
EXPECT_FALSE(&*MIBFMinNum == &*MIBFMinNum2);
- MIBFMinNum2.clearFlag(MachineInstr::FmNsz);
+ MIBFMinNum2->clearFlag(MachineInstr::FmNsz);
EXPECT_TRUE(&*MIBFMinNum == &*MIBFMinNum2);
}
@@ -158,10 +158,10 @@ TEST_F(AArch64GISelMITest, TestCSE) {
auto MIBFMaxNum2 = CSEB.buildFMaxNum(s32, Copies[0], Copies[1]);
EXPECT_TRUE(&*MIBFMaxNum == &*MIBFMaxNum2);
- MIBFMaxNum2.setFlag(MachineInstr::FmNsz);
+ MIBFMaxNum2->setFlag(MachineInstr::FmNsz);
EXPECT_FALSE(&*MIBFMaxNum == &*MIBFMaxNum2);
- MIBFMaxNum2.clearFlag(MachineInstr::FmNsz);
+ MIBFMaxNum2->clearFlag(MachineInstr::FmNsz);
EXPECT_TRUE(&*MIBFMaxNum == &*MIBFMaxNum2);
}
@@ -171,10 +171,10 @@ TEST_F(AArch64GISelMITest, TestCSE) {
auto MIBFMinNumIEEE2 = CSEB.buildFMinNumIEEE(s32, Copies[0], Copies[1]);
EXPECT_TRUE(&*MIBFMinNumIEEE == &*MIBFMinNumIEEE2);
- MIBFMinNumIEEE2.setFlag(MachineInstr::FmNsz);
+ MIBFMinNumIEEE2->setFlag(MachineInstr::FmNsz);
EXPECT_FALSE(&*MIBFMinNumIEEE == &*MIBFMinNumIEEE2);
- MIBFMinNumIEEE2.clearFlag(MachineInstr::FmNsz);
+ MIBFMinNumIEEE2->clearFlag(MachineInstr::FmNsz);
EXPECT_TRUE(&*MIBFMinNumIEEE == &*MIBFMinNumIEEE2);
}
@@ -183,10 +183,10 @@ TEST_F(AArch64GISelMITest, TestCSE) {
auto MIBFMaxNumIEEE2 = CSEB.buildFMaxNumIEEE(s32, Copies[0], Copies[1]);
EXPECT_TRUE(&*MIBFMaxNumIEEE == &*MIBFMaxNumIEEE2);
- MIBFMaxNumIEEE2.setFlag(MachineInstr::FmNsz);
+ MIBFMaxNumIEEE2->setFlag(MachineInstr::FmNsz);
EXPECT_FALSE(&*MIBFMaxNumIEEE == &*MIBFMaxNumIEEE2);
- MIBFMaxNumIEEE2.clearFlag(MachineInstr::FmNsz);
+ MIBFMaxNumIEEE2->clearFlag(MachineInstr::FmNsz);
EXPECT_TRUE(&*MIBFMaxNumIEEE == &*MIBFMaxNumIEEE2);
}
|
d7879a6
to
fd8c115
Compare
e688b3a
to
6df665a
Compare
@@ -75,6 +75,138 @@ TEST_F(AArch64GISelMITest, TestCSE) { | |||
auto MIBUnmerge2 = CSEB.buildUnmerge({s32, s32}, Copies[0]); | |||
EXPECT_TRUE(&*MIBUnmerge == &*MIBUnmerge2); | |||
|
|||
// Check G_FADD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a cleanup you could use buildInstr and loop over the opcodes, these are all going to behave the same way
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/52/builds/5472 Here is the relevant piece of the build log for the reference
|
Resubmit, previously PR has compilation issues.