[llvm] bdad24c - GlobalISel: Fix insert point in CSEMIRBuilder unit test
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 29 12:08:50 PDT 2020
Author: Matt Arsenault
Date: 2020-07-29T15:08:42-04:00
New Revision: bdad24c2cc9f759a974cb63aaa3fff62b978726d
URL: https://github.com/llvm/llvm-project/commit/bdad24c2cc9f759a974cb63aaa3fff62b978726d
DIFF: https://github.com/llvm/llvm-project/commit/bdad24c2cc9f759a974cb63aaa3fff62b978726d.diff
LOG: GlobalISel: Fix insert point in CSEMIRBuilder unit test
This was using invalid MIR for the test instructions. The test add was
the first instruction in the block, before the trunc inputs or copies
from physical registers which I assume was not intended.
Added:
Modified:
llvm/unittests/CodeGen/GlobalISel/CSETest.cpp
Removed:
################################################################################
diff --git a/llvm/unittests/CodeGen/GlobalISel/CSETest.cpp b/llvm/unittests/CodeGen/GlobalISel/CSETest.cpp
index 69c21d6afb00..0ef7b3d207fe 100644
--- a/llvm/unittests/CodeGen/GlobalISel/CSETest.cpp
+++ b/llvm/unittests/CodeGen/GlobalISel/CSETest.cpp
@@ -27,8 +27,8 @@ TEST_F(AArch64GISelMITest, TestCSE) {
B.setCSEInfo(&CSEInfo);
CSEMIRBuilder CSEB(B.getState());
- CSEB.setInsertPt(*EntryMBB, EntryMBB->begin());
- unsigned AddReg = MRI->createGenericVirtualRegister(s16);
+ CSEB.setInsertPt(B.getMBB(), B.getInsertPt());
+ Register AddReg = MRI->createGenericVirtualRegister(s16);
auto MIBAddCopy =
CSEB.buildInstr(TargetOpcode::G_ADD, {AddReg}, {MIBInput, MIBInput});
EXPECT_EQ(MIBAddCopy->getOpcode(), TargetOpcode::COPY);
More information about the llvm-commits
mailing list