Skip to content

Commit b2377ae

Browse files
committed
Reject binops we haven't thought about.
1 parent 7901e2c commit b2377ae

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

llvm/lib/YkIR/YkIRWriter.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,22 @@ class YkIRWriter {
371371
unsigned &InstIdx) {
372372
assert(I->getNumOperands() == 2);
373373

374+
// We don't yet support:
375+
// - fast math flags (for float operations).
376+
// - the `exact` keyword
377+
// - vector variants
378+
if ((isa<FPMathOperator>(I) && (I->getFastMathFlags().any())) ||
379+
(isa<PossiblyExactOperator>(I) && I->isExact()) ||
380+
I->getType()->isVectorTy()) {
381+
serialiseUnimplementedInstruction(I, FLCtxt, BBIdx, InstIdx);
382+
return;
383+
}
384+
385+
// Note that we do nothing with the `nsw` and `nuw` (no {signed,unsigned}
386+
// wrap) keywords, which may generate poison values. If they do, the rules
387+
// of deferred UB allow us to make any value we wish, including (as
388+
// we do) the wrapped value.
389+
374390
// opcode:
375391
serialiseOpcode(OpCodeBinOp);
376392
// left-hand side:

0 commit comments

Comments
 (0)