Skip to content

Commit 2007d0a

Browse files
Pierre-vhfrederik-h
authored andcommitted
[GlobalISel] Preserve original flags of output instructions in matchtable (llvm#130937)
We don't have any combine in trunk that uses output MIFlags when using MIR patterns, but I tried writing one and noticed that the flags were lost. The reason is that the MatchTableExecutor was overwriting the flags.
1 parent 86e3d91 commit 2007d0a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutorImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ bool GIMatchTableExecutor::executeMatchTable(
8080
for (auto MIB : OutMIs) {
8181
// Set the NoFPExcept flag when no original matched instruction could
8282
// raise an FP exception, but the new instruction potentially might.
83-
uint16_t MIBFlags = Flags;
83+
uint16_t MIBFlags = Flags | MIB.getInstr()->getFlags();
8484
if (NoFPException && MIB->mayRaiseFPException())
8585
MIBFlags |= MachineInstr::NoFPExcept;
8686
if (Observer)

0 commit comments

Comments
 (0)