Skip to content

Commit 4ff45ee

Browse files
authored
[GlobalISel][KnownBits] Simplify G_CONSTANT handling (#91946)
We called getIConstantVRegVal which again queried MRI to get the VReg def. We already have the def, so just get the CImm directly. It can't fail.
1 parent 7ce3dd4 commit 4ff45ee

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,7 @@ void GISelKnownBits::computeKnownBitsImpl(Register R, KnownBits &Known,
256256
break;
257257
}
258258
case TargetOpcode::G_CONSTANT: {
259-
auto CstVal = getIConstantVRegVal(R, MRI);
260-
if (!CstVal)
261-
break;
262-
Known = KnownBits::makeConstant(*CstVal);
259+
Known = KnownBits::makeConstant(MI.getOperand(1).getCImm()->getValue());
263260
break;
264261
}
265262
case TargetOpcode::G_FRAME_INDEX: {

0 commit comments

Comments
 (0)