-
Notifications
You must be signed in to change notification settings - Fork 329
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
Update llvm-project to llvm/llvm-project@01d233ff403823389f848 #3011
Changes from 9 commits
2b95eaf
33cdacf
d99d0a8
d842719
9c890e9
fa9ed4d
e198ed9
d13fc9e
9ce6ac1
4a7036f
bc90d56
ba873d9
ce2cfe6
c5d6f9b
c211144
e9268d7
90ae853
9331bb7
2239a56
8bff525
330f7c0
1d3331e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -627,12 +627,14 @@ Value MathBuilder::constant(Type type, double val) const { | |
// If unsigned, create a signless constant, then cast it to unsigned. | ||
if (elementType.isUnsignedInteger()) { | ||
Type signlessTy = b().getIntegerType(width); | ||
constant = b().create<arith::ConstantOp>(loc(), | ||
b().getIntegerAttr(signlessTy, APInt(width, (int64_t)val))); | ||
constant = b().create<arith::ConstantOp>( | ||
loc(), b().getIntegerAttr(signlessTy, | ||
APInt(width, (int64_t)val, false, true))); | ||
constant = castToUnsigned(constant, width); | ||
} else { | ||
constant = b().create<arith::ConstantOp>(loc(), | ||
b().getIntegerAttr(elementType, APInt(width, (int64_t)val))); | ||
constant = b().create<arith::ConstantOp>( | ||
loc(), b().getIntegerAttr(elementType, | ||
APInt(width, (int64_t)val, false, true))); | ||
} | ||
} | ||
}) | ||
|
@@ -695,7 +697,7 @@ TypedAttr MathBuilder::negativeInfAttr(Type type) const { | |
default: | ||
llvm_unreachable("unsupported element type"); | ||
} | ||
attr = b().getIntegerAttr(type, APInt(width, value)); | ||
attr = b().getIntegerAttr(type, APInt(width, value, false, true)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had to update the Previously truncation was set to true as default and they changed it to false, we need the truncation on for our lit tests to pass and to be consistent with the previous behavior. |
||
}) | ||
.Default([](Type) { llvm_unreachable("unsupported element type"); }); | ||
assert(attr != nullptr && "Expecting valid attribute"); | ||
|
@@ -740,7 +742,7 @@ TypedAttr MathBuilder::positiveInfAttr(Type type) const { | |
default: | ||
llvm_unreachable("unsupported element type"); | ||
} | ||
attr = b().getIntegerAttr(type, APInt(width, value)); | ||
attr = b().getIntegerAttr(type, APInt(width, value, false, true)); | ||
}) | ||
.Default([](Type) { llvm_unreachable("unsupported element type"); }); | ||
assert(attr != nullptr && "Expecting valid attribute"); | ||
|
@@ -2263,7 +2265,8 @@ Value LLVMBuilder::constant(Type type, int64_t val) const { | |
assert(type.isSignless() && | ||
"LLVM::ConstantOp requires a signless type."); | ||
constant = b().create<LLVM::ConstantOp>(loc(), type, | ||
b().getIntegerAttr(type, APInt(width, (int64_t)val))); | ||
b().getIntegerAttr( | ||
type, APInt(width, (int64_t)val, false, true))); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as previous file. Please change to c++ style cast. |
||
} | ||
}) | ||
.Case<IndexType>([&](Type) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
git clone -n https://github.com/llvm/llvm-project.git | ||
# Check out a specific branch that is known to work with ONNX-MLIR. | ||
cd llvm-project && git checkout 00128a20eec27246719d73ba427bf821883b00b4 && cd .. | ||
cd llvm-project && git checkout 01d233ff403823389f8480897e41aea84ecbb3d3 && cd .. |
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.
Please change to c++ style cast to prevent code scan finding.
static_cast<int64_t>(val) instead of (int64_t)val
Also line 637.
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.
@mikeessen Thanks for keeping track of the casts. Could you look into seeing if there is away to have the compiler issue a warning (probably clang for us since that what we are using)? I am afraid that I may not be as vigilant as we should be on this issue (speaking for me on the code I modify...).
That would be greatly appreciated. Thanks
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.
@mikeessen There are actually four places that needed to be updated...so I did that for you. Thanks!
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.
Thanks, I will take a look.
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.
Thank you for updating!